You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# What I run
tsuml2 --outFile ./docs/uml.svg --outMermaidDsl ./docs/mermaid.dsl --glob './src/**/*.ts' --glob './examples/**/*.ts' --memberAssociations && ./scripts/add_mermaid_to_readme.sh
#!/bin/bash# This script injects the content of 'mermaid.dsl' into the README.md under the 'Diagram' section.
MERMAID_FILE="./docs/mermaid.dsl"
README_FILE="./README.md"
TEMP_FILE="./docs/temp_readme.md"
GREEN="\033[1;32m"
RESET="\033[0m"
cp $README_FILE$TEMP_FILEif! grep -q '## Architecture'$TEMP_FILE;thenecho"\n\n## Architecture">>$TEMP_FILEfi
sed -i '''/## Architecture/,$d'$TEMP_FILEecho -e '\n\n## Architecture'>>$TEMP_FILEecho -e '\n\nThis is an auto-generated diagram per the [add_mermaid_to_readme.sh](./scripts/add_mermaid_to_readme.sh) script. The section must be the last section in this file. Any subsequent sections will be destroyed!'>>$TEMP_FILEecho -e '\n\n```mermaid'>>$TEMP_FILE
cat $MERMAID_FILE>>$TEMP_FILEecho -e '\n```\n'>>$TEMP_FILE
cp $TEMP_FILE$README_FILEecho -e "${GREEN}Update complete: README.md has been updated with the contents of $MERMAID_FILE.${RESET}"
rm $TEMP_FILE
rm $MERMAID_FILE
@ckrauterlovescoffee I think it would be easier with the public parseProjectgetMermaidDSL functions
You can read the markdown file and replace a specified placeholder with the generated mermaid dsl
It would be neat to be able to specify an output for a markdown file that gets filled with the mermaid diagram.
The text was updated successfully, but these errors were encountered: