Skip to content

Commit

Permalink
more docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff committed Feb 19, 2022
1 parent 54f431c commit 0fe716e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
18 changes: 12 additions & 6 deletions docs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,24 +46,30 @@ if(NOT DOXYBOOK2)
endif()

add_custom_command(
OUTPUT markdown
COMMAND ${DOXYBOOK2} --input ${CMAKE_CURRENT_BINARY_DIR}/doxyxml --output ${CMAKE_CURRENT_BINARY_DIR}/markdown --config config.json
OUTPUT gen
COMMAND ${DOXYBOOK2} --input ${CMAKE_CURRENT_BINARY_DIR}/doxyxml --output ${CMAKE_CURRENT_BINARY_DIR}/gen --config config.json
DEPENDS
${doxybook_localbin}
${CMAKE_CURRENT_BINARY_DIR}/markdown/index.md
${CMAKE_CURRENT_BINARY_DIR}/gen/index.md
${CMAKE_CURRENT_BINARY_DIR}/config.json
${CMAKE_CURRENT_BINARY_DIR}/doxyxml/index.xml)

add_custom_target(clean_html COMMAND ${CMAKE_COMMAND} -E rm -rf html)

add_custom_command(
OUTPUT markdown
COMMAND find ${CMAKE_CURRENT_BINARY_DIR}/gen/ -type f -name '*.md' -exec ${CMAKE_CURRENT_SOURCE_DIR}/fix-markdown.sh {} "\;" && ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_BINARY_DIR}/gen ${CMAKE_CURRENT_BINARY_DIR}/markdown
DEPENDS gen
)

add_custom_command(
OUTPUT html
COMMAND ${MKDOCS} build
DEPENDS
clean_html
${CMAKE_CURRENT_BINARY_DIR}/markdown)

add_custom_target(doc DEPENDS html)
add_custom_target(doc DEPENDS markdown)

configure_file(Doxyfile.in Doxyfile @ONLY)
configure_file(index.md.in index.md @ONLY)
Expand All @@ -73,6 +79,6 @@ configure_file(mkdocs.yml mkdocs.yml COPYONLY)

# we seperate this step out so we force clean_markdown to run before markdown target
add_custom_command(
OUTPUT markdown/index.md
COMMAND ${CMAKE_COMMAND} -E copy index.md markdown/index.md
OUTPUT gen/index.md
COMMAND ${CMAKE_COMMAND} -E copy index.md gen/index.md
DEPENDS clean_markdown)
4 changes: 2 additions & 2 deletions docs/config.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"baseUrl": "",
"indexInFolders": false,
"linkSuffix": "/",
"linkSuffix": ".md",
"mainPageInRoot": false,
"mainPageName": "index",
"linkLowercase": true,
"linkLowercase": false,
"foldersToGenerate": ["files", "classes", "namespaces"]
}
6 changes: 6 additions & 0 deletions docs/fix-markdown.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
# apply markdown file content quarks


# rewrite br tags
sed -i 's|<br>|<br/>|g' $@

0 comments on commit 0fe716e

Please sign in to comment.