Debug Docsify.js with Visual Studio Code

147 views Asked by At

I'm creating some documentation using Docsify.js plus some plugins. I really like this tool to create documentation. If you need I created a repo with a template on GitHub.

The problem I'm facing is when I open the index.html on my local machine, the browser can't read the .md files.

enter image description here

Only when I publish the pages on a server, it is working. So, I tried to use Visual Studio Code to run the files. I added the Microsoft Edge Tools.

enter image description here

Automatically, Visual Studio Code creates a launch.json for me

{
    "configurations": [
        {
            "type": "pwa-msedge",
            "name": "Launch Microsoft Edge",
            "request": "launch",
            "runtimeArgs": [
                "--remote-debugging-port=9222"
            ],
            "url": "C:\\Projects\\FromGitHub\\agile\\index.html",
            "presentation": {
                "hidden": true
            }
        },
        {
            "type": "pwa-msedge",
            "name": "Launch Microsoft Edge in headless mode",
            "request": "launch",
            "runtimeArgs": [
                "--headless",
                "--remote-debugging-port=9222"
            ],
            "url": "C:\\Projects\\FromGitHub\\agile\\index.html",
            "presentation": {
                "hidden": true
            }
        },
        {
            "type": "vscode-edge-devtools.debug",
            "name": "Open Edge DevTools",
            "request": "attach",
            "url": "C:\\Projects\\FromGitHub\\agile\\index.html",
            "presentation": {
                "hidden": true
            }
        }
    ],
    "compounds": [
        {
            "name": "Launch Edge Headless and attach DevTools",
            "configurations": [
                "Launch Microsoft Edge in headless mode",
                "Open Edge DevTools"
            ]
        },
        {
            "name": "Launch Edge and attach DevTools",
            "configurations": [
                "Launch Microsoft Edge",
                "Open Edge DevTools"
            ]
        }
    ]
}

but, again, I have the same problem. How can I allow the browser to access my local file to debug the documentation? Is there a way to configure Visual Studio Code for it?

1

There are 1 answers

0
ewan.chalmers On

Did you try using docsify serve ?

git clone https://github.com/erossini/docsify-template.git
cd docsify-template
docsify serve .
Serving /Users/xyz/git/github.ibm.com/erossin/docsify-template now.
Listening at http://localhost:3000