Skip to content

Supports Textual UML Diagrams in the markdown editor instead of picture reference #4229

Closed

Description

@baikangwang

The Textual UML Diagrams draws simple SVG UML chart diagram from textual representation of the diagram. take the flow chart for example,
In the markdown editor such as issue comments and wiki pages typed the below textual code,

st=>start: Start
e=>end: End
op1=>operation: My Operation
sub1=>subroutine: My Subroutine
cond=>condition: Yes or No?
io=>inputoutput: catch something...

st->op1->cond
cond(yes)->io->e
cond(no)->sub1(right)->op1

then they would be rendered as a simple SVG flow chart diagram when the page showed up

flow chart diagram

It's cooool feature! I could post UML diagrams to project wiki without any image reference if gogs was able to support it. Currently I had to setup an external images website to provide image links for gogs wiki.

The feature can be introduced as plugins into gogs, see below reference for details,

sequence: Turns text into UML sequence diagrams
flowchart: Draws simple SVG flow chart diagrams from textual representation of the diagram
mermaid: A simple markdown-like script language for generating charts from text via javascript

I am using Typora as off-line markdown editor which already supports this feature, and now I was expecting to post its output completely to gogs wiki if gogs supported as well.

Thanks a lot for team! Thanks for your good job!

Activity

  1. changed the title [-][Feature Request] - Supports Textual UML Diagrams in the markdown editor instead of picture reference[/-] [+]Supports Textual UML Diagrams in the markdown editor instead of picture reference[/+] on Mar 3, 2017
  2. added
    🎯 feature
    priority: maybe
    on Mar 3, 2017
  3. terzinnorbert commented on Oct 17, 2018

    @terzinnorbert

    I had a quick solution for that. Add the following lines to templates/inject/head.tmpl:

    <script src="https://unpkg.com/[email protected]/dist/mermaid.min.js"></script>
    <script>
        $(document).ready(function() {
            mermaid.init({noteMargin: 10}, ".language-mermaid");
        });
    </script>
    

    and restart the service

  4. jianblog commented on May 22, 2019

    @jianblog

    Gogs version 0.11.86.0130

    after add above scripts into templates/inject/head.tmpl, and restart gogs web.

    then edit an markdown file or issue:

    st=>start: Start
    op=>operation: Your Operation
    cond=>condition: Yes or No?
    e=>end
    
    st->op->cond
    cond(yes)->e
    cond(no)->op
    

    but nothing happens when preview or save. If these steps right?

  5. free1139 commented on Oct 22, 2021

    @free1139
    Contributor

    @unknwon
    Could you take a look is the #6630 right when you have time?
    I test it base on v0.12.3 cause the main code can't run in my old repository.

  6. linked a pull request that will close this issuemarkdown: support rendering Mermaid diagrams #6776on Mar 5, 2022
  7. removed
    priority: maybe
    on Mar 5, 2022
  8. moved this to In Progress in Gogs Roadmapon Mar 5, 2022
  9. Repository owner moved this from In Progress to Done in Gogs Roadmapon Mar 5, 2022
  10. locked as resolved and limited conversation to collaborators on Jun 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    🎯 feature

    Type

    No type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions