Skip to content

Commit 3fab9df

Browse files
authored
Add b2-based doc building (PR #96)
1 parent 393b731 commit 3fab9df

File tree

4 files changed

+63
-2
lines changed

4 files changed

+63
-2
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ jobs:
9797
bash ./build_docs.sh
9898
9999
# Antora returns zero even if it fails, so we check if the site directory exists.
100-
if [ ! -d "build/site" ]
100+
if [ ! -d "html" ]
101101
then
102102
echo "Antora build failed"
103103
exit 1
@@ -107,4 +107,4 @@ jobs:
107107
uses: actions/upload-artifact@v4
108108
with:
109109
name: antora-docs-${{ matrix.name }}
110-
path: doc/build/site
110+
path: doc/html

doc/Jamfile.v2

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import generate ;
2+
import path ;
3+
import property-set ;
4+
import virtual-target ;
5+
6+
path-constant HERE : . ;
7+
8+
make html/index.html : build_docs.sh : @run-script ;
9+
generate files-to-install : html/index.html : <generating-rule>@delayed-glob ;
10+
install install
11+
: files-to-install
12+
: <location>html
13+
<install-source-root>html/dynamic_bitset
14+
;
15+
explicit html/index.html files-to-install ;
16+
17+
# this runs the antora script
18+
actions run-script
19+
{
20+
bash $(>)
21+
}
22+
23+
# this globs after its sources are created
24+
rule delayed-glob ( project name : property-set : sources * )
25+
{
26+
for local src in $(sources)
27+
{
28+
# the next line causes the source to be generated immediately
29+
# and not later (which it normally would)
30+
UPDATE_NOW [ $(src).actualize ] ;
31+
}
32+
33+
# we need to construct the path to the globbed directory;
34+
# this path would be <current-project>/antora
35+
local root = [ path.root html [ $(project).location ] ] ;
36+
local files ;
37+
38+
# actual globbing happens here
39+
for local file in [ path.glob-tree $(root) : * ]
40+
{
41+
# we have to skip directories, because our match expression accepts anything
42+
if [ CHECK_IF_FILE $(file) ]
43+
{
44+
# we construct a list of targets to copy
45+
files += [ virtual-target.from-file $(file:D=) : $(file:D) : $(project) ] ;
46+
}
47+
}
48+
49+
# we prepend empty usage requirements to the result
50+
return [ property-set.empty ] $(files) ;
51+
}
52+
53+
###############################################################################
54+
alias boostdoc ;
55+
explicit boostdoc ;
56+
alias boostrelease : install ;
57+
explicit boostrelease ;

doc/build_docs.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,5 @@ echo "Building docs in custom dir..."
2525
PATH="$(pwd)/node_modules/.bin:${PATH}"
2626
export PATH
2727
npx antora --clean --fetch "$PLAYBOOK" --stacktrace --log-level all
28+
cp -f html/index.html html/dynamic_bitset.html # redirects from pre-Antora docs location
2829
echo "Done"

doc/local-playbook.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ content:
2525
start_path: doc
2626
edit_url: 'https://github.com/boostorg/dynamic_bitset/edit/{refname}/{path}'
2727

28+
output:
29+
dir: html
30+
2831
ui:
2932
bundle:
3033
url: https://github.com/boostorg/website-v2-docs/releases/download/ui-master/ui-bundle.zip

0 commit comments

Comments
 (0)