Skip to content

Commit

Permalink
feat: add language and framework docs
Browse files Browse the repository at this point in the history
  • Loading branch information
selemondev committed Jan 25, 2024
1 parent 00dc5c0 commit 0e522dc
Show file tree
Hide file tree
Showing 22 changed files with 429 additions and 851 deletions.
24 changes: 7 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,17 @@

This VSCode Extension enables you to preview language and framework documentations directly within your IDE ✨.

# Breaking Changes 🚧
Preview Docs automatically scans your `package.json` file and generates documentation specific to each language and framework.

With the next release around the corner, it is recommended to downgrade `Preview Doc`s version to v0.0.3 as shown below to avoid encountering errors:
## Preview Vue based framework and library documentations

```bash
code --install-extension selemondev.vscode-preview-docs@0.0.3
```
![Preview Vue based framework and library documentations](https://raw.githubusercontent.com/selemondev/vscode-preview-docs/master/src/assets/images/vue.png)

## CTRL + SHIFT + P to open the VSCode command palette and type in Preview Docs: Open Preview Docs
## Preview React based framework and library documentations

![CTRL + SHIFT + P to open the VSCode command palette and type in Preview Docs: Open Preview Docs](https://raw.githubusercontent.com/selemondev/vscode-preview-docs/master/src/assets/images/terminal-window.png)
![Preview React based framework and library documentations](https://raw.githubusercontent.com/selemondev/vscode-preview-docs/master/src/assets/images/react.png)

## Choose a framework
## Preview Svelte based framework and library documentations

![Choose a framework](https://raw.githubusercontent.com/selemondev/vscode-preview-docs/master/src/assets/images/framework-select.png)

## Choose framework documentation

![Choose framework documentation](https://raw.githubusercontent.com/selemondev/vscode-preview-docs/master/src/assets/images/framework-docs.png)

## Preview Documentation

![Preview Documentation](https://raw.githubusercontent.com/selemondev/vscode-preview-docs/master/src/assets/images/docs.png)
![Preview Svelte based framework and library documentations](https://raw.githubusercontent.com/selemondev/vscode-preview-docs/master/src/assets/images/svelte.png)

15 changes: 5 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,21 @@
"onView:previewDocSidebar"
],
"files": [
"out"
"dist"
],
"main": "./out/index.js",
"main": "./dist/extension.js",
"contributes": {
"viewsContainers": {
"activitybar": [
{
"id": "sidebar-view",
"id": "sidebar-preview-docs-view",
"title": "Preview Docs",
"icon": "./assets/logo.svg"
}
]
},
"views": {
"sidebar-view": [
"sidebar-preview-docs-view": [
{
"type": "webview",
"id": "previewDocSidebar",
Expand All @@ -64,12 +64,7 @@
}
]
},
"commands": [
{
"command": "previewDocs.initPreviewDocs",
"title": "Preview Docs: Open Preview Docs"
}
]
"commands": []
},
"permissions": [
"webview",
Expand Down
Binary file removed src/assets/images/docs.png
Binary file not shown.
Binary file removed src/assets/images/framework-docs.png
Binary file not shown.
Binary file removed src/assets/images/framework-select.png
Binary file not shown.
Binary file added src/assets/images/react.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/svelte.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/assets/images/terminal-window.png
Binary file not shown.
Binary file added src/assets/images/vue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 4 additions & 10 deletions src/extension.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
import type { ExtensionContext } from "vscode";
import * as vscode from "vscode";
import { DocsView } from './sidebar';
import { filesWatcher } from './watchers';
import { getWebviewContent } from "./utils/getWebViewContent";
export async function activateExtension(context: ExtensionContext) {

const sidebarProvider = new DocsView(context.extensionUri);
sidebarProvider.goToProjectView();


// Initialize file watchers
// new filesWatcher(sidebarProvider, context);
export async function activate(context: ExtensionContext) {
const provider = new DocsView(context.extensionUri);
provider.getDependencies();
context.subscriptions.push(vscode.window.registerWebviewViewProvider(DocsView.viewType, provider));
}

// This method is called when your extension is deactivated
Expand Down
12 changes: 0 additions & 12 deletions src/index.ts

This file was deleted.

11 changes: 3 additions & 8 deletions src/sidebar/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,19 @@ export class DocsView implements vscode.WebviewViewProvider {
this._setWebviewMessageListener(webviewView.webview);

// Call the method to initialize dependencies
this.goToProjectView();
this.getDependencies();

// in case the user reloads the window while opening the extension tab
if (webviewView.visible) {
this.goToProjectView();
this.getDependencies();
}

webviewView.onDidChangeVisibility((e) => {
if (webviewView.visible) {
this.goToProjectView();
this.getDependencies();
}
});
}

public async goToProjectView() {
this.getDependencies();
}

public async getDependencies() {
const dependencies = await getProjectDependencies();
this.postMessage({
Expand Down
21 changes: 0 additions & 21 deletions src/utils/getFrameworks.ts

This file was deleted.

Loading

0 comments on commit 0e522dc

Please sign in to comment.