Skip to content

Commit 0ea641b

Browse files
committed
ci: demo variants via command line
1 parent 340b978 commit 0ea641b

File tree

2 files changed

+22
-6
lines changed

2 files changed

+22
-6
lines changed

.github/compare_templates.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
#!/bin/bash
22

3+
#
4+
# Licensed under the Apache License v2.0 with LLVM Exceptions.
5+
# See https://llvm.org/LICENSE.txt for license information.
6+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7+
#
8+
# Copyright (c) 2024 Alan de Freitas ([email protected])
9+
#
10+
# Official repository: https://github.com/cppalliance/mrdocs
11+
#
12+
313
# Define variables for the directories
414
ASCIIDOC_DIR="share/mrdocs/addons/generator/asciidoc"
515
HTML_DIR="share/mrdocs/addons/generator/html"

.github/workflows/ci.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -423,14 +423,20 @@ jobs:
423423
# "html"
424424
"xml"
425425
)
426+
426427
for variant in single multi; do
427-
for format in "${generators[@]}"; do
428+
for generator in "${generators[@]}"; do
428429
[[ $variant = multi ]] && multipage="true" || multipage="false"
429-
sed -i "s/^\(\s*multipage:\s*\).*\$/\1$multipage/" $(pwd)/boost/libs/url/doc/mrdocs.yml
430-
sed -i "s/^\(\s*generate:\s*\).*\$/\1$format/" $(pwd)/boost/libs/url/doc/mrdocs.yml
431-
cat $(pwd)/boost/libs/url/doc/mrdocs.yml
432-
mkdir -p "demos/boost-url/$variant/$format"
433-
mrdocs --config="$(pwd)/boost/libs/url/doc/mrdocs.yml" "$(pwd)/boost/libs/url/" --output="$(pwd)/demos/boost-url/$variant/$format"
430+
# Override with cmd line option
431+
mrdocs \
432+
--config="$(pwd)/boost/libs/url/doc/mrdocs.yml" \
433+
"../CMakeLists.txt" \
434+
--output="$(pwd)/demos/boost-url/$variant/$generator" \
435+
--multipage=$multipage \
436+
--generate="$$generator"
437+
438+
# Print number of files (recursive) in the output directory
439+
echo "Number of files in demos/boost-url/$variant/$format: $(find demos/boost-url/$variant/$format -type f | wc -l)"
434440
done
435441
asciidoctor -d book -R "$(pwd)/demos/boost-url/$variant/adoc" -D "$(pwd)/demos/boost-url/$variant/adoc-asciidoc" "$(pwd)/demos/boost-url/$variant/adoc/**/*.adoc"
436442
done

0 commit comments

Comments
 (0)