File tree Expand file tree Collapse file tree 3 files changed +31
-30
lines changed Expand file tree Collapse file tree 3 files changed +31
-30
lines changed Original file line number Diff line number Diff line change 2424 - name : build book
2525 run : |
2626 cd guide
27- mdbook build
27+ cmake -P build-books.cmake
2828 ls book
2929 - name : setup pages
3030 uses : actions/configure-pages@v4
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ # Function to configure the book file and add a custom target to build it.
2+ function (BuildBook LANGUAGE AUTHORS)
3+ # Set the variables for substitution.
4+ set (AUTHORS "${AUTHORS} " )
5+ set (LANGUAGE "${LANGUAGE} " )
6+ set (ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR} " )
7+ set (TARGET_DIR "${ROOT_DIR} /src/${LANGUAGE} " )
8+
9+ # Create a custom target that calls mdbook with the generated config.
10+ if (EXISTS "${TARGET_DIR} /SUMMARY.md" )
11+ # Configure the template file with the substitutions.
12+ configure_file (
13+ ${ROOT_DIR} /book-template.config
14+ ${TARGET_DIR} /book.toml
15+ @ONLY
16+ )
17+
18+ message (STATUS "Building book for language: ${LANGUAGE} " )
19+ execute_process (
20+ COMMAND mdbook build -d ${ROOT_DIR} /book/${LANGUAGE}
21+ WORKING_DIRECTORY ${TARGET_DIR}
22+ )
23+ else ()
24+ message (WARNING "Skipping '${LANGUAGE} ' – SUMMARY.md not found at ${SUMMARY_FILE} " )
25+ endif ()
26+ endfunction ()
27+
28+ # Create configurations for both languages.
29+ BuildBook("en" "Karn Kaul" )
30+ BuildBook("zh-TW" "Mes" )
You can’t perform that action at this time.
0 commit comments