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

时间:2016-04-15 21:25:04

标签: node.js docker material-design-lite

我在本地安装Material Design Lite的文档时遇到了一些问题。我在this file中执行了一个命令:

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生成离线文档?有任何想法吗?感谢。

谢谢;

PS:

我在Docker上运行NodeJS Container.

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

2 个答案:

答案 0 :(得分:1)

我从未尝试克隆回购,但通过这种方式,我可以获得离线文档。仅使用wget工具。 wget -mkEpnp https://getmdl.io 瞧,你的桌面上有网站的副本。

答案 1 :(得分:0)

如引用here

的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
已针对问题here

中提及的大于mdl-1.1的版本修复了

希望它有所帮助!干杯!