flipper-menu-generator icon indicating copy to clipboard operation
flipper-menu-generator copied to clipboard

Auto generation of menu images in Wiki

Open zhovner opened this issue 5 years ago • 0 comments

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:

  1. Look for <!--- Menu structure --> entries in every .md file

  2. 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.md and 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

  3. Put file inwiki_static folder 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.
  4. Insert image above the each <!--- Menu structure --> entry in markdown format with absolute path: ![](https://github.com/Flipper-Zero/flipperzero-firmware-community/raw/master/wiki_static/applications/NFC/nfc-reader-mode-tree.png)

zhovner avatar Sep 14 '20 19:09 zhovner