diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 771dc90..d8389fa 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -9,8 +9,15 @@ jobs: - name: Checkout uses: actions/checkout@v2 - run: npm install - - uses: lannonbr/vsce-action@master + - name: Publish to Open VSX Registry + uses: HaaLeo/publish-vscode-extension@v0 + id: publishToOpenVSX with: - args: 'publish -p $VSCE_TOKEN' - env: - VSCE_TOKEN: ${{ secrets.VSCE_PAT }} + pat: ${{ secrets.OPEN_VSX_TOKEN }} + - name: Publish to Visual Studio Marketplace + uses: HaaLeo/publish-vscode-extension@v0 + with: + pat: ${{ secrets.VSCE_PAT }} + registryUrl: https://marketplace.visualstudio.com + extensionFile: ${{ steps.publishToOpenVSX.outputs.vsixPath }} + packagePath: '' diff --git a/README.md b/README.md index e6f4111..a958602 100644 --- a/README.md +++ b/README.md @@ -8,12 +8,35 @@ Write down notes directly in the sidebar using markdown. - Multiple pages - Github Flavored Markdown Support +- The notes are saved when you close the editor + +## Available configurations + +- `sidebar-markdown-notes.leftMargin`: Adds a left margin to the entire view so it aligns with other content in the sidebar. ## Release Notes +### 1.0.4 + +- Added the `sidebar-markdown-notes.leftMargin` setting +- Changed background color from `--vscode-editor-background` to `--vscode-sideBar-background` +- Added the extension to [Open VSX Registry](https://open-vsx.org/) + +### 1.0.3 + +- Fixed a bug where switching from preview/edit mode would not display anything + +### 1.0.2 + +- Fixed a bug when loading saved nodes when switching pages + +### 1.0.1 + +- Fixed a readme typo + ### 1.0.0 -Initial Release 🎉 +- Initial Release 🎉 --- diff --git a/media/main.css b/media/main.css index f6533e4..7f3fac3 100644 --- a/media/main.css +++ b/media/main.css @@ -2,6 +2,7 @@ height: 100%; resize: none; outline: 0; + white-space: break-spaces; } html, diff --git a/media/vscode.css b/media/vscode.css index 5bb767c..0d3f45b 100644 --- a/media/vscode.css +++ b/media/vscode.css @@ -11,7 +11,7 @@ body { font-size: var(--vscode-font-size); font-weight: var(--vscode-font-weight); font-family: var(--vscode-font-family); - background-color: var(--vscode-editor-background); + background-color: var(--vscode-sideBar-background); } ol, diff --git a/package.json b/package.json index 166cca8..aeefddf 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "sidebar-markdown-notes", "displayName": "sidebar-markdown-notes", "description": "Take notes in your sidebar using markdown", - "version": "1.0.3", + "version": "1.0.4", "publisher": "assisrMatheus", "author": { "email": "assisr.matheus@gmail.com", @@ -96,7 +96,17 @@ "when": "view == sidebarMarkdownNotes.webview" } ] - } + }, + "configuration": [{ + "title": "Sidebar markdown notes", + "properties": { + "sidebar-markdown-notes.leftMargin": { + "type": "boolean", + "default": false, + "description": "Whether or not a left margin should be added to the main view. To align it with other elements" + } + } + }] }, "scripts": { "vscode:prepublish": "npm run compile", diff --git a/src/webviewProvider.ts b/src/webviewProvider.ts index dec63ff..19eb960 100644 --- a/src/webviewProvider.ts +++ b/src/webviewProvider.ts @@ -7,6 +7,8 @@ export default class SidebarMarkdownNotesProvider implements vscode.WebviewViewP private _view?: vscode.WebviewView; + private config = vscode.workspace.getConfiguration('sidebar-markdown-notes'); + constructor(private readonly _extensionUri: vscode.Uri, private _statusBar?: vscode.StatusBarItem) {} /** @@ -45,6 +47,13 @@ export default class SidebarMarkdownNotesProvider implements vscode.WebviewViewP } } }); + + vscode.workspace.onDidChangeConfiguration((e) => { + if (e.affectsConfiguration('sidebar-markdown-notes')) { + this.config = vscode.workspace.getConfiguration('sidebar-markdown-notes'); + webviewView.webview.html = this._getHtmlForWebview(webviewView.webview); + } + }); } public resetData() { @@ -110,7 +119,9 @@ export default class SidebarMarkdownNotesProvider implements vscode.WebviewViewP Use a content security policy to only allow loading images from https or from our extension directory, and only allow scripts that have a specific nonce. --> - + @@ -126,6 +137,15 @@ export default class SidebarMarkdownNotesProvider implements vscode.WebviewViewP
+