首页 > 解决方案 > 如何在 Windows 10 中使用 Docker 中的 thenets/parsoid 将本地文本文件转换为 html?

问题描述

我已经在 Windows 10 上的 Docker 上安装了thenets/parsoid。我想将pomme.txt带有目录路径的文本转换F:\zim\pomme.txt为 html。我试过了

docker run --name myparsoid -d -t -i -v /f/zim:/zim thenets/parsoid:latest sh
type /zim/pomme.txt | docker exec myparsoid node bin/parse.js --wt2html --offline

但它返回一个错误

Microsoft Windows [Version 10.0.19042.928]
(c) Microsoft Corporation. All rights reserved.

C:\Users\Akira>docker run --name myparsoid -d -t -i -v /f/zim:/zim thenets/parsoid:latest sh
7912b0cef8fba4244b2519f4f9603ec8e278b67bcc4fe08f4658721b98f941f3

C:\Users\Akira>type /zim/pomme.txt | docker exec myparsoid node bin/parse.js --wt2html --offline
The syntax of the command is incorrect.
internal/modules/cjs/loader.js:638
    throw err;
    ^

Error: Cannot find module '/bin/parse.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)

我非常不清楚使用哪个命令将本地文本文件转换为 html。您能否详细说明如何解决此问题?

标签: dockerparsoid

解决方案


推荐阅读