gpt4 book ai didi

node.js - 如何生成Semantic UI离线文档

转载 作者:搜寻专家 更新时间:2023-10-31 23:30:06 26 4
gpt4 key购买 nike

我已经很长时间没有生成文档了(从 0.19.3 开始),似乎 doc was separated .

我不知道如何生成文档,因为它没有得到很好的解释:

Before running server you will need to build your UI files for the docs. Semantic UI includes a special command to build files for a docs instance that must be run from an adjacent Semantic UI folder. for example with a directory vendor -> SemanticUI place docs folder inside vendor to reflect vendor -> SemanticUI | docs

你能指导我怎么做吗?

来自Semantic UI source ,我运行 npm install ,它安装了所有需要的东西,然后当我运行 gulp build-docs 时,它生成了一个 docs 文件夹,它在外面源代码,这个,如果我在其中运行命令 docpad run,我没有得到正确的 HTML,因为我不知道将下载的 Separated Docs 放在哪里。

最佳答案

已回答 here

只需选择您缺少的内容即可完成。(它可能有一些错别字。)

需要一个终端。

假定的文件夹结构:

path/to/your/bull polished/project
|
`_ docs
|
`_ learn
|
`_ ui

注意

所有 3 个子文件夹 docs、learn、ui 可能有不同的名称。子文件夹 docsui 必须是相邻的文件夹

目前 learnsemantic.com (learn) 独立于其他 2 个 repos。所以它可以放在任何你喜欢的地方。

克隆存储库:

cd path/to/your/bull polished/project

文档:

git clone --recursive --progress -v "git@github.com:Semantic-Org/Semantic-UI-Docs.git" "docs"
Cloned https://github.com/Semantic-Org/Semantic-UI-Docs (http://semantic-ui.com/)

学习:

git clone --recursive --progress -v "git@github.com:Semantic-Org/Learn-Semantic.git" "learn"
Cloned https://github.com/Semantic-Org/Learn-Semantic (http://learnsemantic.com/)

用户界面:

git clone --recursive --progress -v "git@github.com:Semantic-Org/Semantic-UI.git" "ui"
Cloned https://github.com/Semantic-Org/Semantic-UI (The Semantic UI framework)

注意

如果您不想克隆所有 SUI 存储库历史记录,请阅读:#220 (comment)

全局和本地安装 Gulp。

npm install -g gulp
cd "path/to/your/bull polished/project/ui"
npm install gulp

安装语义 UI 框架。

(Still in : "path/to/your/bull polished/project/ui")

npm install
gulp

或者:

gulp install

全局和本地安装 Docpad。在本地安装 Docpad 插件。

全局安装:

npm install -g docpad

注意:要全局更新docpad upgrade

然后在本地安装到文档中:

cd "path/to/your/bull polished/project/docs"
npm install docpad
docpad install eco

然后安装到本地学习:

cd "path/to/your/bull polished/project/learn"
npm install docpad
docpad install eco

注意要在本地更新(docpad 和插件)运行:docslearn 中的docpad update文件夹。

注意

docpad update 清除/删除了 docs/out 文件夹(其中充满了 dist 和 src 文件夹,以及 gulp build-docsgulp-serve-docs 的文件) , 和 docpad run)因此,当时机成熟时,在从 ui 文件夹构建文档之前运行 docpad update。以 root/管理员身份运行 npm install docpad(以避免权限问题)。

肯定是在 Windows 上。

有时在 Linux/OS X 上,如果 Node 安装“不正确”。但至少在 Linux/OS X 上你可以重新安装 Node 来纠正这个问题。请参阅:node-forward/help#4

构建语义 UI 框架:

cd "path/to/your/bull polished/project/ui"
Only if required:

gulp clean
Followed by:

gulp build OR gulp watch

为 docs 文件夹中的文档构建语义 UI 框架:

cd "path/to/your/bull polished/project/ui"

gulp build-docsgulp serve-docs gulp build-docs :创建并填充 docs/out/dist 和 docs/out/src gulp serve-docs :监视 ui 文件夹中的源文件更改并更新文件夹 docs/out/dist 和 docs/out/src。

生成语义 UI 文档页面并启动本地服务器:

cd "path/to/your/bull polished/project/docs"
docpad run
docpad run : Creates all documentation files and folders (other than docs/out/dist and docs/out/src) in the docs/out folder.

生成 learnsemantic.com 页面并启动本地服务器:

cd "path/to/your/bull polished/project/learn"
docpad run
docpad run : Creates all documentation files and folders in the learn/out folder.

当您更改 SUI 框架变量等时

1) 对框架进行更改。

2) 重建框架:

gulp clean (only when necessary)
gulp build OR gulp watch

3) 更新文档: gulp build-docs 或 gulp serve-docs

4) 生成文档页面。 docpad 运行或 docpad 服务器

回到1)

如果你使用了 gulp watchgulp serve-docs 你应该是全自动的。

关于node.js - 如何生成Semantic UI离线文档,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28069067/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com