From 3fab9dfdf7219faff800daf4ec694890ca2e0718 Mon Sep 17 00:00:00 2001 From: joaquintides Date: Tue, 21 Oct 2025 18:52:05 +0200 Subject: [PATCH] Add b2-based doc building (PR #96) --- .github/workflows/ci.yml | 4 +-- doc/Jamfile.v2 | 57 ++++++++++++++++++++++++++++++++++++++++ doc/build_docs.sh | 1 + doc/local-playbook.yml | 3 +++ 4 files changed, 63 insertions(+), 2 deletions(-) create mode 100644 doc/Jamfile.v2 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4830fbd..4099306 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -97,7 +97,7 @@ jobs: bash ./build_docs.sh # Antora returns zero even if it fails, so we check if the site directory exists. - if [ ! -d "build/site" ] + if [ ! -d "html" ] then echo "Antora build failed" exit 1 @@ -107,4 +107,4 @@ jobs: uses: actions/upload-artifact@v4 with: name: antora-docs-${{ matrix.name }} - path: doc/build/site + path: doc/html diff --git a/doc/Jamfile.v2 b/doc/Jamfile.v2 new file mode 100644 index 0000000..a4a2253 --- /dev/null +++ b/doc/Jamfile.v2 @@ -0,0 +1,57 @@ +import generate ; +import path ; +import property-set ; +import virtual-target ; + +path-constant HERE : . ; + +make html/index.html : build_docs.sh : @run-script ; +generate files-to-install : html/index.html : @delayed-glob ; +install install + : files-to-install + : html + html/dynamic_bitset + ; +explicit html/index.html files-to-install ; + +# this runs the antora script +actions run-script +{ + bash $(>) +} + +# this globs after its sources are created +rule delayed-glob ( project name : property-set : sources * ) +{ + for local src in $(sources) + { + # the next line causes the source to be generated immediately + # and not later (which it normally would) + UPDATE_NOW [ $(src).actualize ] ; + } + + # we need to construct the path to the globbed directory; + # this path would be /antora + local root = [ path.root html [ $(project).location ] ] ; + local files ; + + # actual globbing happens here + for local file in [ path.glob-tree $(root) : * ] + { + # we have to skip directories, because our match expression accepts anything + if [ CHECK_IF_FILE $(file) ] + { + # we construct a list of targets to copy + files += [ virtual-target.from-file $(file:D=) : $(file:D) : $(project) ] ; + } + } + + # we prepend empty usage requirements to the result + return [ property-set.empty ] $(files) ; +} + +############################################################################### +alias boostdoc ; +explicit boostdoc ; +alias boostrelease : install ; +explicit boostrelease ; diff --git a/doc/build_docs.sh b/doc/build_docs.sh index 0f2c837..e1b6142 100755 --- a/doc/build_docs.sh +++ b/doc/build_docs.sh @@ -25,4 +25,5 @@ echo "Building docs in custom dir..." PATH="$(pwd)/node_modules/.bin:${PATH}" export PATH npx antora --clean --fetch "$PLAYBOOK" --stacktrace --log-level all +cp -f html/index.html html/dynamic_bitset.html # redirects from pre-Antora docs location echo "Done" diff --git a/doc/local-playbook.yml b/doc/local-playbook.yml index 694f335..2ee43b4 100644 --- a/doc/local-playbook.yml +++ b/doc/local-playbook.yml @@ -25,6 +25,9 @@ content: start_path: doc edit_url: 'https://github.com/boostorg/dynamic_bitset/edit/{refname}/{path}' +output: + dir: html + ui: bundle: url: https://github.com/boostorg/website-v2-docs/releases/download/ui-master/ui-bundle.zip