commit e4b606b8e0bc631a6f8e9109932572d795c0d994 Author: jonas@geiger-natur.de Date: Wed Nov 27 20:33:40 2024 +0100 initial commit diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..371a5c0 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,85 @@ +name: VSIX + +on: + push: + branches: + - main + +jobs: + create_release: + runs-on: ubuntu-latest + + steps: + # Step 1: Checkout the repository + - name: Checkout Repository + uses: actions/checkout@v3 + + # Step 2: Install dependencies + - name: Install Dependencies + run: | + sudo apt-get update + sudo apt-get install -y zip npm jq + npm install -g vsce + + # Step 3: Install GitHub CLI + - name: Install GitHub CLI + run: | + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null + curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo tee /usr/share/keyrings/githubcli-archive-keyring.gpg > /dev/null + sudo apt-get update + sudo apt-get install -y gh + + # Step 4: Authenticate GitHub CLI + - name: Authenticate GitHub CLI + run: | + echo "${{ secrets.GH_TOKEN }}" | gh auth login --with-token + gh auth status + + # Step 5: Extract Version from package.json + - name: Extract Version + id: extract_version + run: | + VERSION=$(jq -r '.version' package.json) + echo "VERSION=$VERSION" >> $GITHUB_ENV + + # Step 6: Create a new draft release + - name: Create Draft Release + id: create_release + env: + GH_TOKEN: ${{ secrets.GH_TOKEN }} + run: | + RELEASE_TITLE="Release $VERSION" + RELEASE_TAG="v$VERSION" + echo "RELEASE_TAG=$RELEASE_TAG" >> $GITHUB_ENV + gh release create "$RELEASE_TAG" --draft --title "$RELEASE_TITLE" + + # Step 7: Generate the .vsix file + - name: Generate .vsix File + run: | + vsce package + + # Step 8: Publish the extension + - name: Publish Extension + env: + AZURE_DEVOPS_TOKEN: ${{ secrets.AZURE_DEVOPS_TOKEN }} + run: | + vsce publish -p $AZURE_DEVOPS_TOKEN + + # Step 9: Upload .vsix file to the release + - name: Upload .vsix File to Release + env: + GH_TOKEN: ${{ secrets.GH_TOKEN }} + run: | + if [ -f ./*.vsix ]; then + gh release upload "$RELEASE_TAG" ./*.vsix + else + echo "No .vsix file found. Skipping upload." + exit 1 + fi + + # Step 10: Publish the release + - name: Publish Release + env: + GH_TOKEN: ${{ secrets.GH_TOKEN }} + run: | + gh release edit "$RELEASE_TAG" --draft=false diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..44a86ab --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,17 @@ +// A launch configuration that launches the extension inside a new window +// Use IntelliSense to learn about possible attributes. +// Hover to view descriptions of existing attributes. +// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Extension", + "type": "extensionHost", + "request": "launch", + "args": [ + "--extensionDevelopmentPath=${workspaceFolder}" + ] + } + ] +} diff --git a/.vscodeignore b/.vscodeignore new file mode 100644 index 0000000..f369b5e --- /dev/null +++ b/.vscodeignore @@ -0,0 +1,4 @@ +.vscode/** +.vscode-test/** +.gitignore +vsc-extension-quickstart.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..65d4df5 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,24 @@ +# Change Log + +## 1.0.0 + +- Initial version + +### altert.code-snippets + +```markdown +> [!NOTE] +> Highlights information that users should take into account, even when skimming. + +> [!TIP] +> Optional information to help a user be more successful. + +> [!IMPORTANT] +> Crucial information necessary for users to succeed. + +> [!WARNING] +> Critical content demanding immediate user attention due to potential risks. + +> [!CAUTION] +> Negative potential consequences of an action. +``` \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..93b1855 --- /dev/null +++ b/README.md @@ -0,0 +1,20 @@ +# JG2401 - Custom Markdown Snippets + +Contains some custom snippets for markdown, alerts for example: + +```markdown +> [!NOTE] +> Highlights information that users should take into account, even when skimming. + +> [!TIP] +> Optional information to help a user be more successful. + +> [!IMPORTANT] +> Crucial information necessary for users to succeed. + +> [!WARNING] +> Critical content demanding immediate user attention due to potential risks. + +> [!CAUTION] +> Negative potential consequences of an action. +``` \ No newline at end of file diff --git a/images/icon.jpg b/images/icon.jpg new file mode 100644 index 0000000..c5f9e99 Binary files /dev/null and b/images/icon.jpg differ diff --git a/package.json b/package.json new file mode 100644 index 0000000..2ec0ede --- /dev/null +++ b/package.json @@ -0,0 +1,32 @@ +{ + "name": "jg2401-markdown", + "displayName": "JG2401 - Custom Markdown Snippets", + "description": "Custom Snippets for Markdown", + "version": "1.0.0", + "publisher": "jg2401", + "engines": { + "vscode": "^1.95.0" + }, + "categories": [ + "Snippets" + ], + "contributes": { + "languages": [ + { + "id": "markdown", + "aliases": ["Markdown", "markdown"], + "extensions": [".md"], + "icon": { + "dark": "./images/Integris.jpg", + "light": "./images/Integris.jpg" + } + } + ], + "snippets": [ + { + "language": "markdown", + "path": "./snippets/alert.code-snippets" + } + ] + } +} diff --git a/snippets/alert.code-snippets b/snippets/alert.code-snippets new file mode 100644 index 0000000..7f0b6b4 --- /dev/null +++ b/snippets/alert.code-snippets @@ -0,0 +1,42 @@ +{ + "Note": { + "prefix": "note", + "body": [ + "> [!NOTE]", + "> ${1}" + ], + "description": "Highlights information that users should take into account, even when skimming" + }, + "Tip": { + "prefix": "tip", + "body": [ + "> [!TIP]", + "> ${1}" + ], + "description": "Optional information to help a user be more successful" + }, + "Important": { + "prefix": "important", + "body": [ + "> [!IMPORTANT]", + "> ${1}" + ], + "description": "Crucial information necessary for users to succeed" + }, + "Warning": { + "prefix": "warning", + "body": [ + "> [!WARNING]", + "> ${1}" + ], + "description": "Critical content demanding immediate user attention due to potential risks" + }, + "Caution": { + "prefix": "caution", + "body": [ + "> [!CAUTION]", + "> ${1}" + ], + "description": "Negative potential consequences of an action" + } +}