Skip to content

Commit d5167a7

Browse files
committed
doc: MrDocs reference
1 parent 6055c39 commit d5167a7

26 files changed

Lines changed: 634 additions & 506 deletions

CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ cmake_minimum_required(VERSION 3.12...3.16)
77

88
project(boost_msm VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
99

10+
option(BOOST_MSM_BUILD_MRDOCS "Build the target for MrDocs" OFF)
1011
option(BOOST_MSM_TEST_NLOHMANN_JSON "Test serialization with nlohmann/json" OFF)
1112

1213
add_library(boost_msm INTERFACE)
@@ -52,3 +53,8 @@ if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt")
5253
enable_testing()
5354
add_subdirectory(test)
5455
endif()
56+
57+
if(BOOST_MSM_BUILD_MRDOCS)
58+
add_library(boost_msm_mrdocs ${CMAKE_CURRENT_SOURCE_DIR}/doc/mrdocs.cpp)
59+
target_link_libraries(boost_msm_mrdocs boost_msm)
60+
endif()

doc/Makefile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,16 @@
22
SOURCE:=$(shell find modules)
33

44
build/lib/doc/robots.txt: $(SOURCE)
5-
npx antora --fetch local-playbook.yml
5+
npx antora --fetch local-playbook.yml --stacktrace
66

77
.PHONY: build
88
build : build/lib/doc/robots.txt
9+
10+
.PHONY: setup
11+
setup:
12+
npm install
13+
wget -q https://github.com/cppalliance/mrdocs/releases/download/v0.8.0/MrDocs-0.8.0-Linux.tar.xz -O mrdocs.tar.xz
14+
sudo tar -xJf mrdocs.tar.xz -C /usr/local --strip-components=1 MrDocs-0.8.0-Linux
15+
rm mrdocs.tar.xz
16+
git init && git commit --allow-empty -m init
17+

doc/README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22

33
Run the following commands once for the initial setup:
44

5-
- Make sure nodejs (>= 16.0.0) & npm are installed: `sudo apt install nodejs npm`
5+
- Make sure nodejs (LTS version >= 16.0.0) & npm are installed: `sudo apt install nodejs npm`
66
- Make sure you are in the doc folder: `cd doc`
7-
- Install the required packages: `npm install`
8-
- Set up a pseudo-repository: `git init && git commit --allow-empty -m init`
7+
- Run the Make target for the setup: `make setup`
98

10-
Antora requires the doc sources to be located within a git repository, but it cannot recognize git submodules. By setting up a pseudo-repository in the doc folder, the local documentation build works when MSM is used as a standalone repo as well as when MSM is opened from a submodule path within the Boost super-project.
9+
The setup creates a pseudo-repository in the doc folder:
10+
Antora requires the doc sources to be located within a git repository, but it cannot recognize git submodules. By setting up a pseudo-repository, the local documentation build works when MSM is used as a standalone repo as well as when MSM is opened from a submodule path within the Boost super-project.
1111

12-
After the initial setup is done, build the the documentation by running `npx antora --fetch local-playbook.yml` from the doc folder. Or use the Makefile, `make build`.
12+
After the initial setup is done, build the the documentation with `make build`.
13+
14+
If you are not interested in viewing the generated API reference, you can speed up the documenation build with the ENV `ANTORA_SKIP_CPP_REFERENCE=1`.

doc/antora.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,6 @@ asciidoc:
99
page-pagination: ''
1010
# Show an additional TOC on the right sidebar
1111
page-toc: ''
12+
ext:
13+
cpp-reference:
14+
config: doc/mrdocs.yml

doc/local-playbook.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ antora:
5353
using-namespaces:
5454
- 'boost::'
5555
- require: '@cppalliance/antora-downloads-extension'
56-
# - require: '@cppalliance/antora-cpp-reference-extension'
57-
# dependencies:
58-
# - name: 'boost'
59-
# repo: 'https://github.com/boostorg/boost.git'
60-
# tag: 'develop'
61-
# variable: 'BOOST_SRC_DIR'
62-
# system-env: 'BOOST_SRC_DIR'
56+
- require: '@cppalliance/antora-cpp-reference-extension'
57+
# dependencies:
58+
# - name: 'boost'
59+
# repo: 'https://github.com/boostorg/boost.git'
60+
# tag: 'develop'
61+
# variable: 'BOOST_SRC_DIR'
62+
# system-env: 'BOOST_SRC_DIR'
6363

6464
asciidoc:
6565
attributes:
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
11
= Reference
2+
3+
The following pages describe the API provided by MSM's components.
4+
5+
== External references to MSM
6+
7+
An interesting mapping UML <-> MSM from Takatoshi Kondo can be found at http://redboltz.wikidot.com/boost-msm-guide[Redboltz].

doc/modules/ROOT/pages/reference/euml-operators-and-basic-helpers.adoc

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
= eUML operators and basic helpers
44

5+
To use these functions, you need to include:
6+
7+
[source,cpp]
8+
----
9+
#include <msm/front/euml/euml.hpp>
10+
----
11+
12+
513
.eUML operators and basic helpers
614
[cols="1,2,1",options="header"]
715
|===
@@ -188,10 +196,3 @@
188196
|Returns (as reference) the state state_name referenced in the current state machine or the one given as argument.
189197
|`SubState_`
190198
|===
191-
192-
To use these functions, you need to include:
193-
194-
[source,cpp]
195-
----
196-
#include <msm/front/euml/euml.hpp>
197-
----

doc/modules/ROOT/pages/reference/external-references-to-msm.adoc

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)