爱意满满的作品展示区。
lyric
20.11D

Code-Knack 支持流程图、时序图、甘特图了

  •  
  •   lyric ·
    lyricat · Mar 20, 2019 · 3240 views
    This topic created in 2611 days ago, the information mentioned may be changed or developed.

    前文提要: https://www.v2ex.com/t/532704#reply10

    图表用的是 Mermaid.js

    GitHub: https://github.com/lyricat/code-knack

    DEMO: https://lyricat.github.io/code-knack/demo/#

    效果如下:

    Screenshot 2019-03-20 at 1.03.59 PM.png Screenshot 2019-03-20 at 1.04.17 PM.png Screenshot 2019-03-20 at 1.04.50 PM.png

    语法很简单,

    <pre>
      <code class="language-mermaid,autorun">
    graph TD
      A[Christmas] -->|Get money| B(Go shopping)
      B --> C{Let me think}
      C -->|One1| D[Laptop]
      C -->|Two| E[iPhone]
      C -->|Two| E[iPhone]
      C -->|Two| E[iPhone]
      C -->|Three| F[fa:fa-car Car]
      </code>
    </pre>
    
    5 replies    2019-03-20 17:08:56 +08:00
    sundae91
        1
    sundae91  
       Mar 20, 2019
    plantUML 功能和这个有重叠吗?
    lyric
        2
    lyric  
    OP
       Mar 20, 2019
    @sundae91 有。不过我提供了一个 live editor.
    sundae91
        3
    sundae91  
       Mar 20, 2019
    @lyric live editor 是指在线编写?
    plantuml 是一套 DSL,网页实现、vs 插件、idea 插件实现都有
    lyric
        4
    lyric  
    OP
       Mar 20, 2019
    @sundae91 使用场景不同。

    Code-knack 是个开箱即用的插件,可以挂在随便一个网页里面。比如说 GitBook 或者博客。
    lyric
        5
    lyric  
    OP
       Mar 20, 2019
    比如说 Code-Knack 可以集成 plantuml,这样就可以在 Code-Knack 里渲染 plantuml 输出的图
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   936 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 21:17 · PVG 05:17 · LAX 14:17 · JFK 17:17
    ♥ Do have faith in what you're doing.