1 Star 0 Fork 0

hamflx/vscode-markdown-nomnoml

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

markdown-nomnoml README

This extension adds nomnoml uml diagram support to Visual Studio Code's built-in Markdown preview. Nomnoml provides a way for drawing UML diagrams based on a simple syntax. You can get a quick overview and play with nomnoml on the nomnoml.com website.

This extension was made possible by the following projects:

Features

With the extension you can add nomnoml code blocks to your markdown documents. These code blocks are rendered to uml diagrams in VS Code's built-in markdown preview.

The nomnoml code block

```nomnoml
[<frame>Decorator pattern|
  [<abstract>Component||+ operation()]
  [Client] depends --> [Component]
  [Decorator|- next: Component]
  [Decorator] decorates -- [ConcreteComponent]
  [Component] <:- [Decorator]
  [Component] <:- [ConcreteComponent]
]
```

is rendered as

decorator

Default look on light VS Code theme

light

Default look on dark VS Code theme

dark

Extension Settings

Via the following extension settings, you can customize the default nomnoml style.

  • markdown-nomnoml.style.defaultBackgroundColor: set the default background color
    • Example values: #fff or transparent
  • markdown-nomnoml.style.defaultStrokeAndTextColor: set the default stroke and text color
    • Example values: #000 or red
  • markdown-nomnoml.style.defaultShapeColor: set the default shape and inner shape color
    • Note: Shape and Inner shape color are separated by a colon. Providing only one color code will set shape and inner shape to the same color.
    • Example values: blue (shapes and inner shapes set to blue), #fff; #f00 (shapes set to white and inner shapes to red)

Custom look using extension settings

Setting the following user settings,

"markdown-nomnoml.style.defaultBackgroundColor": "transparent",
"markdown-nomnoml.style.defaultStrokeAndTextColor": "#B0BEC5",
"markdown-nomnoml.style.defaultShapeColor": "#455A64; #37474F"

will give you the following custom look

custom

Nomnoml Syntax

nomnoml syntax documentation copied from nomnoml README

Association Types

-    association
->   association
<->  association
-->  dependency
<--> dependency
-:>  generalization
<:-  generalization
--:> implementation
<:-- implementation
+-   composition
+->  composition
o-   aggregation
o->  aggregation
--   note
-/-  hidden

Classifier Types

[name]
[<abstract> name]
[<instance> name]
[<reference> name]
[<note> name]
[<package> name]
[<frame> name]
[<database> name]
[<start> name]
[<end> name]
[<state> name]
[<choice> name]
[<input> name]
[<sender> name]
[<receiver> name]
[<transceiver> name]
[<actor> name]
[<usecase> name]
[<label> name]
[<hidden> name]

Directives

#arrowSize: 1
#bendSize: 0.3
#direction: down | right
#gutter: 5
#edgeMargin: 0
#edges: hard | rounded
#fill: #eee8d5; #fdf6e3
#fillArrows: false
#font: Calibri
#fontSize: 12
#leading: 1.25
#lineWidth: 3
#padding: 8
#spacing: 40
#stroke: #33322E
#title: filename
#zoom: 1

Custom Classifier Styles

A directive that starts with "." define a classifier style.

#.box: fill=#88ff88
#.blob: fill=pink visual=ellipse
[<box> GreenBox]
[<blob> HideousBlob]

Available visuals are

visual=actor
visual=class
visual=database
visual=ellipse
visual=end
visual=frame
visual=hidden
visual=input
visual=none
visual=note
visual=package
visual=receiver
visual=rhomb
visual=roundrect
visual=sender
visual=start
visual=transceiver

Known Issues

Unsupported Custom Classifier Styles

The nomnoml svg renderer used by the extension doesn't support all of the custom classifier styles.
Unsupported modifiers are

center
bold
underline
italic
dashed
empty

This list might be inconclusive.

Release Notes

0.0.2

Two defects related to markdown preview fixed.

0.0.1

Initial release of markdown-nomnoml adding nomnoml uml diagram support to VS Code's built-in markdown preview. Supporting custom default background, stroke, shape, and text colors.

MIT License Copyright (c) 2018 Alexander Moosbrugger Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

暂无描述 展开 收起
README
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/hamflx/vscode-markdown-nomnoml.git
git@gitee.com:hamflx/vscode-markdown-nomnoml.git
hamflx
vscode-markdown-nomnoml
vscode-markdown-nomnoml
master

搜索帮助