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:
Type the itemsan item can be typed by using a type block
The legend is automatically generated depending on a global parameter it can be forced using a parameter definition
to list all the availables types reffer to BOM Commands Define the status of the itemyou can define the satus of an item by adding a status block
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
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.
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. You can also edit the UserIcons.json to remove unwanted types and a folder with the default icons is packaged with the exentsion. Edit UserIcons.jsonThis command is only in the command palette. Open the UserIcons.json file in the editor. you can add a label to a icon for the legend :
When you are done don't forget to save the file RequirementsNo dependencies. Works well with Markdown Preview enhanced 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.Linksdefinition {#linkdef}This 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.revision {#revision}It's a simple object with 2 properties with html color that defines the background and the font color of the revision block
bomarkdown.codeblockdelimiter {#codeblockdelimiter}it 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.bubbles {#bubbles}it'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.satus {#status}it'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.UTF8replacement":Objet 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
|