initial commit

This commit is contained in:
jonas@geiger-natur.de
2024-11-27 20:33:40 +01:00
commit e4b606b8e0
8 changed files with 224 additions and 0 deletions

85
.github/workflows/deploy.yml vendored Normal file
View File

@@ -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

17
.vscode/launch.json vendored Normal file
View File

@@ -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}"
]
}
]
}

4
.vscodeignore Normal file
View File

@@ -0,0 +1,4 @@
.vscode/**
.vscode-test/**
.gitignore
vsc-extension-quickstart.md

24
CHANGELOG.md Normal file
View File

@@ -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.
```

20
README.md Normal file
View File

@@ -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.
```

BIN
images/icon.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

32
package.json Normal file
View File

@@ -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"
}
]
}
}

View File

@@ -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"
}
}