带有Visual Studio代码的Debug Docsify.js

发布于 2025-02-07 18:23:51 字数 2196 浏览 1 评论 0原文

我正在使用

我面临的问题是,当我在本地计算机上打开index.html时,浏览器无法读取.md文件。

仅当我在服务器上发布页面时,它才能正常工作。因此,我尝试使用Visual Studio代码运行文件。我添加了Microsoft Edge工具。

自动,Visual Studio代码为我创建启动> JSON

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

,但同样,我也有同样的问题。如何允许浏览器访问我的本地文件以调试文档?有没有办法为其配置Visual Studio代码?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

醉态萌生 2025-02-14 18:23:51

您是否尝试使用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

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
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文