@@ -6,6 +6,7 @@ DOCSIFY_SERVE_PATH="/usr/local/bin/docsify-serve"
6
6
DOCS_PATH=${DOCS_PATH:- docs}
7
7
8
8
echo " Activating feature 'docsify-cli'..."
9
+
9
10
npm install -g docsify-cli
10
11
11
12
# The fallback/default index.html file to use when the documents directory does
@@ -14,23 +15,23 @@ DEFAULT_INDEX_HTML=$(cat <<EOF
14
15
<!DOCTYPE html>
15
16
<html lang="en">
16
17
<head>
17
- <meta charset="UTF-8">
18
- <title>Fake Site</title>
19
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
20
- <meta name="description" content="Description">
21
- <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
22
- <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify@4/lib/themes/vue.css">
18
+ <meta charset="UTF-8">
19
+ <title>Fake Site</title>
20
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
21
+ <meta name="description" content="Description">
22
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
23
+ <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify@4/lib/themes/vue.css">
23
24
</head>
24
25
<body>
25
- <div id="app"></div>
26
- <script>
27
- window.$docsify = {
28
- name: 'fakesite',
29
- repo: 'fakerepo'
30
- }
31
- </script>
32
- <!-- Docsify v4 -->
33
- <script src="//cdn.jsdelivr.net/npm/docsify@4"></script>
26
+ <div id="app"></div>
27
+ <script>
28
+ window.$docsify = {
29
+ name: 'fakesite',
30
+ repo: 'fakerepo'
31
+ }
32
+ </script>
33
+ <!-- Docsify v4 -->
34
+ <script src="//cdn.jsdelivr.net/npm/docsify@4"></script>
34
35
</body>
35
36
</html>
36
37
EOF
48
49
tee " ${DOCSIFY_SERVE_PATH} " > /dev/null \
49
50
<< EOF
50
51
#!/usr/bin/env sh
52
+
53
+ # we need to explicitly "activate" (the current) node here, as otherwise
54
+ # devcontainers using our feature and also setting their remoteEnv PATH will
55
+ # cause our script to fail when run as the postStartCommand.
56
+ . /usr/local/share/nvm/nvm.sh
57
+ nvm use node
58
+
51
59
mkdir -p "${DOCS_PATH} "
52
60
if [ ! -f "${DOCS_PATH} /index.html" ]; then
53
61
echo "${DEFAULT_INDEX_HTML} " > "${DOCS_PATH} /index.html"
54
62
echo "${DEFAULT_README_MD} " > "${DOCS_PATH} /README.md"
55
63
fi
56
- nohup bash -c "docsify serve -p=${PORT} -P=${LIVERELOAD_PORT} --no-open ./${DOCS_PATH} &" >/tmp/nohup.log 2>&1
64
+
65
+ nohup bash -c "\
66
+ docsify serve \
67
+ -p=${PORT} \
68
+ -P=${LIVERELOAD_PORT} \
69
+ --no-open \
70
+ ${DOCS_PATH} \
71
+ &" >/tmp/nohup-docsify.log 2>&1
57
72
EOF
73
+
58
74
chmod 0755 " ${DOCSIFY_SERVE_PATH} "
0 commit comments