Skip to content

Commit 4cf42ee

Browse files
committed
ci: asciidoctor rendering mirrors adoc dir layout
1 parent aecc1e6 commit 4cf42ee

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

.github/workflows/ci.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -697,11 +697,25 @@ jobs:
697697
# mrdocs documenting mrdocs demo
698698
mrdocs --config="$(pwd)/docs/mrdocs.yml" "$(pwd)/CMakeLists.txt" --output="$(pwd)/demos/mrdocs/$variant/$generator" --multipage=$multipage --generator="$generator" --log-level=debug
699699
done
700+
700701
# Render the asciidoc files to html using asciidoctor
701702
if [[ ${{ runner.os }} == 'Linux' ]]; then
702703
for project in boost-url mrdocs; do
703-
mkdir -p "$(pwd)/demos/$project/$variant/adoc-asciidoc"
704-
asciidoctor -D "$(pwd)/demos/$project/$variant/adoc-asciidoc" "$(pwd)/demos/$project/$variant/adoc/*.adoc"
704+
root="$(pwd)/demos/$project/$variant"
705+
src="$root/adoc"
706+
dst="$root/adoc-asciidoc"
707+
708+
# Create the top-level output dir
709+
mkdir -p "$dst"
710+
711+
# Find every .adoc (recursively), mirror the directory structure, and render
712+
find "$src" -type f -name '*.adoc' -print0 |
713+
while IFS= read -r -d '' f; do
714+
rel="${f#"$src/"}" # path relative to $src
715+
outdir="$dst/$(dirname "$rel")" # mirror subdir inside $dst
716+
mkdir -p "$outdir"
717+
asciidoctor -D "$outdir" "$f"
718+
done
705719
done
706720
fi
707721
done

0 commit comments

Comments
 (0)