Browse Source

add docs

master
zeus 3 years ago
parent
commit
0547220d61
  1. 17
      README.md
  2. 5
      build-intro.sh
  3. 11
      build.sh
  4. 21
      code/my_app.rb
  5. 4
      docs/run/build-intro.sh
  6. 21
      docs/site-intro.yml
  7. 12
      docs/site.yml

17
README.md

@ -1,2 +1,17 @@
# Documentation # swarmlab docs
A [swarmlab.io](http://www.swarmlab.io) sidecar container.
Documentation is a multi-repository site generator (Antora based)
## Build from git
> git clone https://git.swarmlab.io:3000/docs/Documentation.git
>
> cd docs
> ./build.sh
>
>

5
build-intro.sh

@ -0,0 +1,5 @@
docker stop swarmlab-documentation
docker container rm swarmlab-documentation
docker pull hub.swarmlab.io:5480/antora
docker run -ti --name swarmlab-documentation -v $PWD/docs:/antora hub.swarmlab.io:5480/antora /bin/sh -c "DOCSEARCH_ENABLED=true DOCSEARCH_ENGINE=lunr DOCSEARCH_INDEX_VERSION=latest NODE_PATH=/usr/local/lib/node_modules:\$NODE_PATH exec sh -c '/antora/run/build-intro.sh'"

11
build.sh

@ -0,0 +1,11 @@
docker stop swarmlab-documentation
docker container rm swarmlab-documentation
docker pull hub.swarmlab.io:5480/antora
antora --fetch site.yml
antora site.yml
ifconfig
http-server build/site -c-1
docker run -ti --name swarmlab-documentation -v $PWD/docs:/antora hub.swarmlab.io:5480/antora /bin/sh -c "DOCSEARCH_ENABLED=true DOCSEARCH_ENGINE=lunr DOCSEARCH_INDEX_VERSION=latest NODE_PATH=/usr/local/lib/node_modules:\$NODE_PATH exec sh -c 'build.sh'"

21
code/my_app.rb

@ -0,0 +1,21 @@
# This file represents "software".
# This file helps show that documentation files can be in the same repository as software.
rescue => ex
begin
context = %(asciidoctor: FAILED: #{attrs['docfile'] || '<stdin>'}: Failed to load AsciiDoc document)
if ex.respond_to? :exception
# The original message must be explicitely preserved when wrapping a Ruby exception
wrapped_ex = ex.exception %(#{context} - #{ex.message})
# JRuby automatically sets backtrace, but not MRI
wrapped_ex.set_backtrace ex.backtrace
else
# Likely a Java exception class
wrapped_ex = ex.class.new context, ex
wrapped_ex.stack_trace = ex.stack_trace
end
rescue
wrapped_ex = ex
end
raise wrapped_ex
end

4
docs/run/build-intro.sh

@ -0,0 +1,4 @@
antora --fetch /antora/site-intro.yml
antora /antora/site-intro.yml
ifconfig
http-server build/site -c-1

21
docs/site-intro.yml

@ -0,0 +1,21 @@
site:
title: Swarmlab sec-intro
url: http://docs.swarmlab.io/SwarmLab-HowTos/swarmlab/docs
start_page: swarmlab::index.adoc
content:
sources:
- url: https://git.swarmlab.io:3000/docs/Documentation.git
branches: master
start_path: docs
ui:
bundle:
url: https://git.swarmlab.io:3000/docs/docs/raw/branch/master/ui-bundle.zip
snapshot: true
supplemental_files: ./supplemental-ui
asciidoc:
attributes:
:plantuml-server-url: http://www.plantuml.com/plantuml
extensions:
- '@djencks/asciidoctor-mathjax'
- asciidoctor-plantuml

12
docs/site.yml

@ -1,5 +1,5 @@
site: site:
title: General Documentation title: Swarmlab sec-intro
url: http://docs.swarmlab.io/SwarmLab-HowTos/swarmlab/docs url: http://docs.swarmlab.io/SwarmLab-HowTos/swarmlab/docs
start_page: swarmlab::index.adoc start_page: swarmlab::index.adoc
content: content:
@ -9,5 +9,13 @@ content:
start_path: docs start_path: docs
ui: ui:
bundle: bundle:
url: https://git.swarmlab.io:3000/docs/Documentation/raw/branch/master/ui-bundle.zip url: https://git.swarmlab.io:3000/docs/docs/raw/branch/master/ui-bundle.zip
snapshot: true snapshot: true
supplemental_files: ./supplemental-ui
asciidoc:
attributes:
:plantuml-server-url: http://www.plantuml.com/plantuml
extensions:
- '@djencks/asciidoctor-mathjax'
- asciidoctor-plantuml

Loading…
Cancel
Save