File tree Expand file tree Collapse file tree 4 files changed +72
-0
lines changed Expand file tree Collapse file tree 4 files changed +72
-0
lines changed Original file line number Diff line number Diff line change 22
22
_yardoc
23
23
doc /
24
24
.idea /
25
+ source /index.html.md
Original file line number Diff line number Diff line change
1
+ FROM ruby:2.7-alpine
2
+
3
+ COPY build-local-doc.sh /usr/bin/
4
+
5
+ RUN apk --no-cache --update add nodejs g++ make coreutils git && \
6
+ git clone https://github.com/slatedocs/slate.git /slate && cd slate \
7
+ && echo 'gem "middleman-livereload", "~> 3.4.3"' >> Gemfile \
8
+ && echo 'activate :livereload' >> config.rb \
9
+ && bundle install \
10
+ && chmod +x /usr/bin/*.sh
11
+
12
+ WORKDIR /slate
13
+
14
+ EXPOSE 4567
15
+
16
+ ENTRYPOINT ["sh" , "/usr/bin/build-local-doc.sh" ]
Original file line number Diff line number Diff line change
1
+ # Local Setup
2
+
3
+ We use a dockerized ruby environment to build and watch your local changes.
4
+
5
+ ## Building your docker
6
+
7
+ Run the following command in this directory to set up the docker container
8
+
9
+ ``` docker build -t wiapi-doc . ```
10
+
11
+ ## Run your docker container
12
+
13
+ Run the following command in this directory to build and watch the external document
14
+
15
+ ``` docker run --rm -v ${PWD%/*}/source:/slate/source -p 4567:4567 -it wiapi-doc external ```
16
+
17
+ Run the following command in this directory to build and watch the internal document
18
+
19
+ ``` docker run --rm -v ${PWD%/*}/source:/slate/source -p 4567:4567 -it wiapi-doc internal ```
20
+
21
+ ## View the document in your local
22
+
23
+ The document would be available in [ http://localhost:4567 ] ( http://localhost:4567 ) .
24
+
25
+ Once, you have your docker container running.
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ function cleanup {
4
+ echo " Removing the generated index.html.md file"
5
+ rm source/index.html.md
6
+ }
7
+
8
+ trap cleanup EXIT
9
+
10
+ echo " Deleting old 'build' folder if exists ..."
11
+ rm -rf source/build
12
+
13
+ echo " Generating a index.html.md file for the $1 doc..."
14
+ if [ $1 = " external" ]; then
15
+ cp source/index.html.external.md source/index.html.md
16
+ elif [ $1 = " internal" ]; then
17
+ cp source/index.html.internal.md source/index.html.md
18
+ else
19
+ echo " Unknown argument '$1 ', will do nothing and exit"
20
+ echo " Accepted arguments: external, internal"
21
+ fi
22
+
23
+ echo " Building static html doc to 'build' folder ..."
24
+ bundle exec middleman build --clean
25
+
26
+ echo " Copying result into 'build' folder ..."
27
+ cp -r build source/
28
+
29
+ echo " Serving live doc at http://127.0.0.1:4567 ..."
30
+ bundle exec middleman server
You can’t perform that action at this time.
0 commit comments