-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: rework statemachine docs generation
- Loading branch information
Showing
4 changed files
with
74 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
taskSMDoc="docs/statemachine/README-task-statemachine.md" | ||
taskSMJSON="docs/statemachine/task-statemachine.json" | ||
|
||
actionSMDoc="docs/statemachine/README-action-statemachine.md" | ||
actionSMJSON="docs/statemachine/action-statemachine.json" | ||
|
||
## generate Task statemachine mermaid graph and docs | ||
|
||
echo "generate task statemachine docs..." | ||
|
||
|
||
echo "# Flasher task state machine" > $taskSMDoc | ||
echo " " >> $taskSMDoc | ||
echo "The Task statemachine plans and executes Actions (sub-statemachines) to install firmware." >> $taskSMDoc | ||
echo " " >> $taskSMDoc | ||
echo "Note: The Task statemachine plans and and executes [Action sub-state machine(s)]($actionSMDoc) for each firmware being installed." >> $taskSMDoc | ||
echo " " >> $taskSMDoc | ||
|
||
echo '```mermaid' >> $taskSMDoc | ||
./flasher export-statemachine --task >> $taskSMDoc | ||
echo '```' >> $taskSMDoc | ||
|
||
|
||
## generate state transition docs | ||
|
||
./flasher export-statemachine --task --json > $taskSMJSON | ||
|
||
echo "## Task statemachine transitions" >> $taskSMDoc | ||
echo " " >> $taskSMDoc | ||
|
||
./docs/statemachine/generate_task_sm_docs.sh $taskSMJSON $taskSMDoc | ||
|
||
|
||
echo "generate task action sub-statemachine docs..." | ||
|
||
|
||
## generate action statemachine mermaid graph and docs | ||
|
||
|
||
echo "# Flasher task action sub-state machine(s)" > $actionSMDoc | ||
echo " " >> $actionSMDoc | ||
echo "The task Actions (sub-statemachines) are executed by the Task statemachine." >> $actionSMDoc | ||
echo " " >> $actionSMDoc | ||
echo "Note: Note each firmware to be installed is one action state machine." >> $actionSMDoc | ||
echo " " >> $actionSMDoc | ||
|
||
echo '```mermaid' >> $actionSMDoc | ||
./flasher export-statemachine --action >> $actionSMDoc | ||
echo '```' >> $actionSMDoc | ||
|
||
|
||
## generate state transition docs | ||
|
||
./flasher export-statemachine --action --json > $actionSMJSON | ||
|
||
echo "## Task Action (sub-statemachine) transitions" >> $actionSMDoc | ||
echo " " >> $actionSMDoc | ||
|
||
./docs/statemachine/generate_action_sm_docs.sh $actionSMJSON $actionSMDoc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters