User-facing docs: --commands-md flag, doc/user/ tree, anonymised script.

- `essim --commands-md [file]` instantiates the Tui, calls
  `Tui::DumpCommandsMd(ostream&)` which iterates the live registry and
  emits Markdown grouped by interactive/other, then exits. Single
  source of truth: a new `CommandSpec` field surfaces automatically.
- CMake `doc` target now `DEPENDS essim` and chains:
    doxygen → gen_api_md.py → doc/api/
    essim --commands-md      → doc/user/commands.md
- `doc/user/` adds:
    - index.md (hand-written) — first session, interactive-screen
      conventions, save/restore/replay overview.
    - scripting.md (hand-written) — `set`/`$var` expansion semantics,
      `source` event-paced execution, script-save denylist, worked
      example pointing at test/system.essim.
    - commands.md (auto-generated, regenerated by the `doc` target).
- Top-level README refocused on quick start; pointers to the new
  doc tree (user/, api/, DESIGN.md) instead of an inline command table.
- doc/README.md and DESIGN.md document the two-pipeline doc workflow.
- `test/system.essim` and user docs anonymised: bkp → backplane,
  vdn1/2/3 → payload1/2/3, cb3p → payload4, bpb/cob/ssu →
  peripheral1/2/3; netlist file names + variable names + paths all
  replaced with generic equivalents.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-12 08:29:45 +02:00
parent 66460262af
commit 043fef0a31
16 changed files with 825 additions and 242 deletions

View File

@@ -78,17 +78,21 @@ if(DOXYGEN_FOUND AND Python3_Interpreter_FOUND)
@ONLY)
set(DOC_API_DIR "${CMAKE_SOURCE_DIR}/doc/api")
set(DOC_USER_DIR "${CMAKE_SOURCE_DIR}/doc/user")
add_custom_target(doc
DEPENDS essim
COMMAND ${CMAKE_COMMAND} -E rm -rf "${DOC_API_DIR}"
COMMAND ${CMAKE_COMMAND} -E make_directory "${DOC_API_DIR}/classes"
COMMAND ${CMAKE_COMMAND} -E make_directory "${DOC_API_DIR}/files"
COMMAND ${CMAKE_COMMAND} -E make_directory "${DOC_USER_DIR}"
COMMAND ${DOXYGEN_EXECUTABLE} "${DOXYGEN_OUTPUT_DIR}/Doxyfile"
COMMAND ${Python3_EXECUTABLE}
"${CMAKE_SOURCE_DIR}/doc/gen_api_md.py"
"${DOXYGEN_OUTPUT_DIR}/xml"
"${DOC_API_DIR}"
COMMAND $<TARGET_FILE:essim> --commands-md "${DOC_USER_DIR}/commands.md"
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
COMMENT "Generating API documentation (doxygen → gen_api_md.py → doc/api/)"
COMMENT "Generating documentation (doxygen → gen_api_md.py → doc/api/, essim --commands-md → doc/user/commands.md)"
VERBATIM)
elseif(NOT DOXYGEN_FOUND AND NOT Python3_Interpreter_FOUND)
message(STATUS "doc: Doxygen and Python 3 not found — `doc` target disabled.")