flipper-menu-generator
flipper-menu-generator copied to clipboard
Auto generation of menu images in Wiki
I would like to automatically add menu tree images to every wiki page where the menu structure is described.
For example this page NFC.md has such entry:
<!--- Menu structure -->
Menu tree markdown code...
<!--- Menu structure end -->
CI bot may work somewhere around this way:
-
Look for
<!--- Menu structure -->entries in every.mdfile -
Generate PNG and name it with
[filename].md + [H1 header] above the entry + [tree] + [.png]For example, if we have a text file named
NFC.mdand get code like this inside:# Reader mode <!--- Menu structure --> Menu tree markdown code... <!--- Menu structure end -->we will get filename:
nfc-reader-mode-tree.png -
Put file in
wiki_staticfolder using this logic:- Replace text file path
/wiki/applications/NFC.md-->/wiki_static/applications/NFC/ - Put image in this folder.
- Create folder if not exists.
- Replace text file path
-
Insert image above the each
<!--- Menu structure -->entry in markdown format with absolute path: