如何离线安装 Material Design Lite 文档?

3

我在本地安装Material Design Lite文档时遇到了一些问题。我按照这个文件中的命令操作:

git clone https://github.com/google/material-design-lite
cd material-design-lite
npm install && npm install -g gulp
gulp all && gulp serve

当运行gulp all时,会出现错误:
root@c54a089ac69c:/home/material-design-lite# gulp all
[21:18:38] Requiring external module babel-register
[21:18:42] Using gulpfile /home/material-design-lite/gulpfile.babel.js
[21:18:42] Starting 'clean'...
[21:18:42] Finished 'clean' after 106 ms
[21:18:42] Starting 'all'...
[21:18:42] Starting 'lint:aux'...
[21:18:45] 
/home/material-design-lite/gulpfile.babel.js
  136:1  warning  Unexpected 'todo' comment  no-warning-comments
  807:3  warning  Unexpected 'todo' comment  no-warning-comments

✖ 2 problems (0 errors, 2 warnings)

[21:18:45] Finished 'lint:aux' after 2.39 s
[21:18:45] Starting 'styletemplates'...
[21:18:49] styles all files 1.07 MB
[21:18:49] Finished 'styletemplates' after 4.04 s
[21:18:49] Starting 'styles-grid'...
[21:18:49] Starting 'styles'...
[21:18:49] styles-grid all files 17.77 kB
[21:18:49] Finished 'styles-grid' after 187 ms
[21:18:50] styles all files 714.08 kB
[21:18:50] Finished 'styles' after 1.39 s
[21:18:50] Starting 'styles:gen'...
[21:18:52] Finished 'styles:gen' after 2.36 s
[21:18:52] Starting 'lint:sources'...
[21:18:56] 
/home/material-design-lite/src/mdlComponentHandler.js
  232:49  error  Properties shouldn't be quoted as all quotes are redundant  quote-props
  366:51  error  Properties shouldn't be quoted as all quotes are redundant  quote-props

/home/material-design-lite/src/checkbox/checkbox.js
  123:5  warning  Unexpected 'todo' comment  no-warning-comments

/home/material-design-lite/src/icon-toggle/icon-toggle.js
  119:5  warning  Unexpected 'todo' comment  no-warning-comments

/home/material-design-lite/src/radio/radio.js
  133:5  warning  Unexpected 'todo' comment  no-warning-comments

/home/material-design-lite/src/switch/switch.js
  122:5  warning  Unexpected 'todo' comment  no-warning-comments

/home/material-design-lite/src/tabs/tabs.js
  88:7  warning  Do not use 'new' for side effects  no-new

/home/material-design-lite/src/textfield/textfield.js
  273:11  warning  Unexpected 'todo' comment  no-warning-comments

/home/material-design-lite/src/layout/layout.js
  520:11  warning  Do not use 'new' for side effects        no-new
  570:3   error    Block must not be padded by blank lines  padded-blocks

✖ 10 problems (3 errors, 7 warnings)

[21:18:56] 'lint:sources' errored after 3.59 s
[21:18:56] ESLintError in plugin 'gulp-eslint'
Message:
    Failed with 3 errors
[21:18:56] 'all' errored after 14 s
[21:18:56] Error in plugin 'run-sequence'
Message:
    An error occured in task 'lint:sources'.

但是,当我使用gulp serve来运行它时,它只是显示这个:

Screenshot

它只是显示文件!如何为material-design-lite生成离线文档?有什么想法吗?谢谢。

谢谢;

附言:

我在NodeJS容器上使用Docker运行它。

Material Design Lite网站:https://getmdl.io


你能否在你的问题中添加一下运行Docker容器的命令? - Daniel Cerecedo
我已经授予了悬赏,因为我尝试使用 npm 安装。在克隆 github 存储库之后,我继续输入 npm install 命令安装所有依赖项,但是 npm start 命令无法启动应用程序。 - Geoff
@GEOFFREY MWANGI请在您执行npm start时发布错误,并检查是否安装了兼容版本node - Pritish Vaidya
2个回答

1

我从未尝试克隆该仓库,但使用这种方法可以获取离线文档。只需使用wget工具。 wget -mkEpnp https://getmdl.io 然后,您就可以在桌面上拥有网站的副本。


0

如在 GitHub 问题 这里 中提到的

您需要使用 Unix 样式的行结尾进行检出。该过程在 README 中有详细说明。

如果 Windows 用户由于行尾而无法编译,请确保您配置了 git 以使用 lf (unix) 行尾 检出存储库。可以通过设置 core.eol 来实现此目的。

git config core.eol lf
git config core.autocrlf input
git rm --cached -r .
git reset --hard

其他错误

error  Properties shouldn't be quoted as all quotes are redundant  quote-props

已经修复了版本大于mdl-1.1的问题,如此处所述。

希望能有所帮助!干杯!


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接