BoMarkdown READMEBoMarkdown is an extension that generetates a SVG representaion of a Bill of material (like a tree) from a textual description. It is inspired by other text to graph tools like plantuml or mermaid.js
FeaturesBOM Previewlaunch it with the command palette (crtl + shift + p) or with a right click in a markdown file (*.md) BOM syntaxIntroductionEach line of the bom is an item. Items can be linked either by a hiearchy link or a transversal(s) link(s). HeirachyTo create a BOM you must use the following notation:
In order to be detected in the editor you should use code block delimiter either the regular fenced code block of markdown or a comment with a special keyword. with the fenced code block your code will be rendered in the markdown document, with the commment the code will not be displayed. Right now the bomarkdown syntax is not supported in markdown as a workaround the bomarkdown code generates a svg and the svg can be integrated in the markdown document see export or insertSVG for more information Example of a redenred code with its svg graph
Example of a not redenred code with its svg graph
Type the itemsan item can be typed by using a type block
A snippet can be used to help item block definition The legend is automatically generated depending on a global parameter it can be forced using a parameter definition
you can use markdown emphasis to highlight word in the label
to list all the availables types reffer to BOM Commands to add new type reffer to the addicon command Define the status of the itemyou can define the satus of an item by adding a status block
A snippet can be used to help status block definition Status rendition is customizable in the settings Define several bom in a same graphThe bom can be distributed in several column and several root can be stacked in the same columm. You also can increase the space with the previous column.
Aliases and implement linkIn addition to the hierachical link you can create transverse link to do so you should use a link block (a:) the link block is in 2 parts (s:[alias])(l:i:[aliases of linked element separated by ,]) the link is drawn from the item to the ones in the (l:) block. you can have several (l:) block on an item to draw several link types
A snippet can be used to help link block definition A snippet can be used to help alias block definition links types and definition are customizable in the settings BubblesOn top of the type icon you can add a bubble to define a special characteristic of the item the Bubbles are define in a block (b:[bubble1],[bubble2],...[bubblen]) the order in the list define the drawing order with the last being drawn on the top.
A snippet can be used to help bubble block definition Bullbes definitions are customizable in the settings EffectivityEffectivity can be defined before links with an effectivity block (e:)
special char replacement are define in the settings BOM Exportlaunch it with the command palette or with a right click in a markdown file (*.md) The export commands generates a svg file You must have your textfile saved on your computer. the program tries to detect code block delimited by start and end point. Start and en point can de defined in the settings On the starting block you can define an image path
The path use forward "/" and the name is without extension If no block or path is detected the program will create a svg file with the same path as the current editor file. Ex launching the command on "c:\myfolder\myfile.txt" will create or update the myfile.png in the myfolder folder. Insert SVG in markdownlaunch it with the command palette or with a right click in a markdown file (*.md) Like the export the command will generate or update a svg file from the current code block It will also insert an image markdown element below the code block and refresh the markdown preview enhanced window. BOM Commands {#bom-commands}launch it with the command palette or with a right click in a markdown file (*.md) This commands displays all the types (even those added by the user) links and bubbles. Names can be copy pasted in your markdown AddiconThe add icon command is only in the command palette. The command will ask a folder to the user and import all the image file of the folder in the Usericons.json file. During the import it will convert the image files (png or jpg) in base64 format in order to be abble to embed icons in the svg. The name of the icon is the filename in lowercase and with no extension. You can update the icon by performing a new import of the folder with modified image files. The addicon command is based on the filename :if the filename exists in the json only b64 encoding is updated At the end of the import an json file is created and added to the IconJson setting You can also edit the UserIcons.json to remove unwanted types and a folder with the default icons is packaged with the exentsion. After an icon update you can launch the bomarkdown.updatesnippets command to update the item type in the snippet Edit UserIcons.jsonThis command is only in the command palette. It opens the selected json icon file for edition you can add a label to a icon for the legend :
When you are done don't forget to save the file reqsNo dependencies. Works well with Markdown Preview enhanced Extension theme and colorThe extension comme with textmate gramar rule to colorise the text of bommarkdow. You can add the followings code without comment in you usersetting.json (workbench.action.openSettingsJson). The name of the theme support joker char so by default the bomarkdown theme is applied if the theme name incule Light or Dark in its name.
Extension SnippetsIf settings are modified or type added snippets can be updated with the command : bomarkdown.updatesnippets In order for the snippet to show automatically the default usersetting is modified with :
Codeblock snippetcode block snippet can be triggered with ''' for standard markdown code block or <! for the commented codeblock Note : those snippet are not automatic and the use of the crt+ space shortcut is recommended Item snippetitem snippet is triggered by (i:
Alias snippetAlias snippet is triggered by (a:
Bubble snippetBubble snippet is triggered by (b:
Effectivity snippetEffectivity snippet is triggered by (e:
Newbom snippetnewbom snippet is triggered by +new
Link snippetlink snippet is triggered by (l:
Status snippetStatus snippet is triggered by (s:
Extension SettingsSimple settings {#simplesetting}bomarkdown.h : Default Item height bomarkdown.gap : space between element on a line bomarkdown.panh : Horizontal pan distance between items bomarkdown.panv : Vertical pan distance between items bomarkdown.legendscale : scale of the legend bomarkdown.renderlegend : Specifies if a legend block is computed and added a the bottom of the svg Complex settings:bomarkdown.iconjsonThis settings list the path off all the icon json of the database. You can add or remove a path here. In order for the addicon update feature to work you should name the json file <icon folder name>_Icons.json and store it next to your icon folder. bomarkdown.LinksdefinitionThis setting is used to define the links of the bom. Its a dictionnary of objects defined by 5 properties
Beware to escape the " in the marker svg definition The dasharray definition can be found here bomarkdown.revisionIt's a simple object with 2 properties with html color that defines the background and the font color of the revision block
bomarkdown.codeblockdelimiterit defines the possible begining and ending identifier of a code block. the identifiers can't contain space, the begin and end propeties contains a string with the identifiers seperated by a string
bomarkdown.bubblesit's and object witch each key is a bubble, the value is a svg element with an id equal to the bubble key
The bubble is positioned in regards of the top left corner of the type icon bomarkdown.satusit's and object witch each key is a status, the value is a svg element with an id equal to the status key
bomarkdown.MandatoryDefsObject containing svg element mandatory for the rendition
bomarkdown.UTF8replacementObjet used to replace a string by an utf8 symbol in the effectivity. For instance #00 is redenred as ∞ or -> as → Known IssuesNone yet Release Notes0.0.1Initial release of BoMarkdown 0.1.0first stable release in the markeplace Bug fix Support for bubbles and status in the legend (setting datamodel modification) Change in the parsing text after the last block is ignored and considered as comment 0.1.1
0.2.0
|