【问题标题】:Debug Docsify.js with Visual Studio Code使用 Visual Studio Code 调试 Docsify.js
【发布时间】:2022-08-11 19:44:09
【问题描述】:

我正在使用Docsify.js 加上一些插件创建一些文档。我真的很喜欢这个工具来创建文档。如果您需要,我在GitHub 上创建了一个带有模板的仓库。

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

只有当我在服务器上发布页面时,它才能工作。所以,我尝试使用 Visual Studio Code 来运行这些文件。我添加了 Microsoft Edge 工具。

Visual Studio Code 会自动为我创建一个launch.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 Code?

    标签: visual-studio-code markdown docsify


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-10-31
      • 1970-01-01
      • 2015-12-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多