Skip to content

Commit

Permalink
Build website by converting adoc to md (#77)
Browse files Browse the repository at this point in the history
* generate reference material as md using `skupper man`
* convert adoc to md using  https://github.com/opendevise/downdoc and https://github.com/asciidoctor/asciidoctor-reducer
* remove antora references
  • Loading branch information
pwright authored Feb 2, 2024
1 parent 13d402f commit f31325d
Show file tree
Hide file tree
Showing 404 changed files with 17,150 additions and 23,252 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,9 @@ jobs:
version: [3.7, 3.x]
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{matrix.version}}
- uses: actions/setup-node@v3
with:
node-version: latest
- run: pip install pyyaml
- run: npm install @antora/cli @antora/site-generator
- run: echo "$PWD/node_modules/.bin" >> "$GITHUB_PATH"
- run: python plano test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*.pyc
__pycache__/
/output
sed??????
1 change: 0 additions & 1 deletion .plano.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ def test():
run("cat docs/install.sh | sh", shell=True)
run("cat docs/uninstall.sh | sh", shell=True)

generate_docs(output_dir=temp)
generate_examples(output_dir=temp)
generate_releases(output_dir=temp)
generate_scripts(output_dir=temp)
11 changes: 4 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,11 @@ changes.
The docs source is in a distinct repo, skupper-docs, and are written
in AsciiDoc.

The process of publishing these docs to the Skupper website uses
[Antora](https://docs.antora.org) to convert them to HTML.

1. Install [Antora](https://docs.antora.org).
2. Run `./plano generate-docs` to create HTML from the `master` branch
of `skupper-docs`.
1. Run `git subrepo pull subrepos/skupper-docs/` to retrieve the latest
version of AsciiDoc files from the `main` branch of `skupper-docs`.
2. Run `./convert-all.sh` to create Markdown files.
3. Run `./plano test` to run tests and populate the `docs` directory
of this repo with the HTML files from step 1.
of this repo with the HTML files generated from the Markdown files.

## Updating the site for new Skupper releases

Expand Down
27 changes: 0 additions & 27 deletions config/docs-playbook.yaml.in

This file was deleted.

32 changes: 32 additions & 0 deletions convert-adoc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Function to process a single file
process_file() {
local input_file="$1"
local base_name=$(basename "$input_file" .adoc)
local dir_name=$(dirname "$input_file")
local output_file="input/docs/${dir_name}/${base_name}.md"
input_dir=`dirname $input_file`

mkdir -p "output/$input_dir"


# Reduce file so that all includes are resolved and convert to asciidoc
# requires https://github.com/opendevise/downdoc and https://github.com/asciidoctor/asciidoctor-reducer
asciidoctor-reducer "subrepos/skupper-docs/$input_file" | python python/process.py | downdoc -o "$output_file" -

# Extract the title from the output HTML file
title=$(head -1 "$output_file" |sed -e 's/# //g')

# Insert the title at the beginning of the output file
sed -i "1s;^;---\ntitle: $title\n---\n;" "$output_file"
}

# Check if at least one input file is provided
if [ "$#" -eq 0 ]; then
echo "Usage: $0 <input-file-1> [input-file-2] ..."
exit 1
fi

# Process each file passed as an argument
for input_file in "$@"; do
process_file "$input_file"
done
7 changes: 7 additions & 0 deletions convert-all.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
./convert-adoc.sh cli/index.adoc cli/tokens.adoc cli/podman.adoc cli/native-security-options.adoc yaml/index.adoc operator/index.adoc console/index.adoc policy/index.adoc troubleshooting/index.adoc overview/connectivity.adoc overview/glossary.adoc overview/index.adoc overview/resources.adoc overview/routing.adoc overview/security.adoc

cp -r subrepos/skupper-docs/images/ input/docs/

# To process nested numbered lists
python python/nested-numbers.py input/docs/operator/

21 changes: 21 additions & 0 deletions create-reference.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
cd input/docs
rm -r kubernetes-reference
rm -r podman-reference
skupper --platform kubernetes man
mv docs.out kubernetes-reference
skupper --platform podman man
mv docs.out podman-reference
cd ../..

python ./python/process-man.py input/docs/kubernetes-reference
python ./python/process-man.py input/docs/podman-reference

mv input/docs/kubernetes-reference/skupper.md input/docs/kubernetes-reference/index.md
mv input/docs/podman-reference/skupper.md input/docs/podman-reference/index.md


rm input/docs/kubernetes-reference/*.1
rm input/docs/podman-reference/*.1


./plano render --force
157 changes: 0 additions & 157 deletions docs/docs/cli-podman/skupper_link_status.html

This file was deleted.

Loading

0 comments on commit f31325d

Please sign in to comment.