Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build_docs: add Asciidoctor documentation build support #93

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions build_docs/macosdocs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,11 @@ done
# here to an earlier part of the script:

if [ -n "$1" ]; then
echo "Library path set to $1. Changing to that directory."
cd "$1"
workingdir="$1"
echo "Library path set to ${workingdir}. Changing to that directory."
cd "${workingdir}"
else
workingdir=$(pwd)
workingdir="$(pwd)"
echo "Using current working directory ${workingdir}."
fi

Expand Down Expand Up @@ -174,7 +175,7 @@ fi
# Generally, boostorg/release-tools treats all libraries the same, meaning it installs one set of packages and executes b2.
# Therefore all libraries ought to build under 'main' and shouldn't need anything customized.

all_types="main antora cppalv1"
all_types="main antora cppalv1 asciidoctor"
# cppalv1_types="json beast url http_proto socks_proto zlib"
cppalv1_types="not_currently_used skipping_this"

Expand All @@ -195,13 +196,18 @@ if [ -z "$typeoption" ]; then
typeoption="cppalv1"
else
typeoption="main"

if find "${workingdir:?}" -type f \( -iname "*.adoc" -o -iname "*.asciidoc" \) -print 2>/dev/null | grep -q .; then
echo "Asciidoctor documentation detected. Setting build type to asciidoctor."
typeoption="asciidoctor"
fi
fi
fi

echo "Build type is ${typeoption}."

if [[ ! " $all_types " =~ .*\ $typeoption\ .* ]]; then
echo "Allowed types are currently 'main', 'antora' and 'cppalv1'. Not $typeoption. Please choose a different option. Exiting."
echo "Allowed types are currently 'main', 'antora', 'cppalv1' and 'asciidoctor'. Not $typeoption. Please choose a different option. Exiting."
exit 1
fi

Expand Down Expand Up @@ -575,6 +581,9 @@ elif [ "$typeoption" = "antora" ]; then
elif [ "$typeoption" = "cppalv1" ]; then
echo "using doxygen ; using boostbook ; using saxonhe ;" > tools/build/src/user-config.jam
./b2 "$librarypath/doc${boostrelease}" cxxstd=11
elif [ "$typeoption" = "asciidoctor" ]; then
# For asciidoctor builds, run b2 with the asciidoctor source highlighter option
./b2 "$librarypath/doc${boostrelease}" asciidoctor-attribute=source-highlighter=highlight.js
fi

if [ "$typeoption" = "antora" ]; then
Expand Down
Loading