Skip to content

Commit d5ad78e

Browse files
committed
Support for using mrdocs to generate docs from code
1 parent 53a5bba commit d5ad78e

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,4 @@ compile_commands.json
3131

3232
/docs/html
3333
/docs/latex
34+
/docs/adoc/

Makefile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,16 @@ $(_build_path)/CMakeCache.txt: | $(_build_path) .gitmodules
5757
-rm compile_commands.json
5858
ln -s $(_build_path)/compile_commands.json
5959

60+
$(_build_path)/compile_commands.json : $(_build_path)/CMakeCache.txt
61+
62+
compile_commands.json: $(_build_path)/compile_commands.json
63+
-rm compile_commands.json
64+
ln -s $(_build_path)/compile_commands.json
65+
6066
TARGET:=all
67+
compile: compile_commands.json
6168
compile: $(_build_path)/CMakeCache.txt ## Compile the project
69+
compile: ## Compile the project
6270
cmake --build $(_build_path) --config $(CONFIG) --target all -- -k 0
6371

6472
compile-headers: $(_build_path)/CMakeCache.txt ## Compile the headers
@@ -178,6 +186,12 @@ view-coverage: ## View the coverage report
178186
docs: ## Build the docs with Doxygen
179187
doxygen docs/Doxyfile
180188

189+
.PHONY: mrdocs
190+
mrdocs: ## Build the docs with Doxygen
191+
-rm -rf docs/adoc
192+
cd docs && NO_COLOR=1 mrdocs mrdocs.yml 2>&1 | sed 's/\x1b\[[0-9;]*m//g'
193+
find docs/adoc -name '*.adoc' | xargs asciidoctor
194+
181195
# Help target
182196
.PHONY: help
183197
help: ## Show this help.

docs/mrdocs.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# $schema: https://mrdocs.com/docs/mrdocs/develop/_attachments/mrdocs.schema.json
2+
# yaml-language-server: $schema=https://mrdocs.com/docs/mrdocs/develop/_attachments/mrdocs.schema.json
3+
14
---
25
source-root: ..
36
input:
@@ -6,6 +9,8 @@ exclude:
69
- ../include/beman/optional/detail
710
exclude-patterns:
811
- ../include/beman/optional/detail/**
12+
- ../tests/**
13+
- ../examples/**
914
includes:
1015
- ../include
1116
file-patterns:
@@ -16,3 +21,4 @@ implementation-defined:
1621
- 'beman::optional::detail'
1722
multipage: true
1823
generator: adoc
24+
output: adoc

0 commit comments

Comments
 (0)