public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: "dave....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <dave.jarvis-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: GitHub now supports MermaidJS
Date: Thu, 13 Jan 2022 21:51:28 -0800 (PST)	[thread overview]
Message-ID: <6a978c09-0b8d-4199-862a-0a0b78955a41n@googlegroups.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 3455 bytes --]

 

Hi all,

Some food for thought on simple code block namespaces.

Re: https://github.com/github/markup/issues/533

I’m the main author of KeenWrite (see screenshots 
<https://github.com/DaveJarvis/keenwrite/blob/master/docs/screenshots.md>), 
a type of desktop Markdown editor that supports diagrams. It’s encouraging 
to see that Mermaid diagrams are being supported in GitHub. There are a few 
drawbacks on the syntax and implications of using MermaidJS.

First, only browser-based SVG renderers can correctly parse Mermaid 
diagrams. I’ve tested Apache Batik, svgSalamander, resvg, rsvg-convert, 
svglib, CairoSVG, ConTeXt, and QtSVG. See issue 2485 
<https://github.com/mermaid-js/mermaid/issues/2485>. This implies that 
typesetting Mermaid documents is not currently possible. In effect, by 
including Mermaid diagrams, many documents will be restricted to web-based 
output, excluding the possibility of producing PDF documents based on 
GitHub markdown documents (for the foreseeable future).

Second, there are numerous text-to-diagram facilities available beyond 
Mermaid. The server at https://kroki.io/ supports Mermaid, PlantUML, 
Graphviz, byte fields, and many more. While including MermaidJS is a great 
step forward, supporting Kroki diagrams would allow a much greater variety. 
(Most diagrams produced in MermaidJS can also be crafted in Graphviz, 
albeit with less terse syntax.)

Third, see the CommonMark discussion thread 
<https://talk.commonmark.org/t/mermaid-generation-of-diagrams-and-flowcharts-from-text-in-a-similar-manner-as-markdown/1882> 
referring to a syntax for diagrams. It’s unfortunate that a standard 
“namespace” concept was not proposed.

Fourth, KeenWrite integrates Kroki. To do so, it uses a variation on the 
syntax:

``` diagram-mermaid
```

``` diagram-graphviz
```

``` diagram-plantuml
```

The diagram- prefix tells KeenWrite that the content is a diagram. The 
prefix is necessary to allow using *any* diagram supported by a Kroki 
server without having to hard-code the supported diagram type within 
KeenWrite. Otherwise, there is no simple way to allow a user to mark up a 
code block with their own text style that may coincide with an existing 
diagram type name.

Fifth, if ever someone wants to invent a programming language named Mermaid 
(see MeLa 
<https://pdfs.semanticscholar.org/7d75/49b737fd1d85bdaee016681e8915fea81ad9.pdf>), 
then it precludes the possibility of using the following *de facto* syntax 
highlighting:

``` mermaid
```

My feature request is to add support for Kroki and the diagram- prefix 
syntax. That is:

``` diagram-mermaid
```

And deprecate the following syntax:

``` mermaid
```

And, later, introduce the language- prefix for defining code blocks that 
highlight syntax. That is, further deprecate:

``` java
```

With the following:

``` language-java
```

That would provide a “namespace” of sorts to avoid naming conflicts in the 
future.

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/6a978c09-0b8d-4199-862a-0a0b78955a41n%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 4226 bytes --]

             reply	other threads:[~2022-01-14  5:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-14  5:51 dave....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org [this message]
     [not found] ` <6a978c09-0b8d-4199-862a-0a0b78955a41n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-01-14 15:33   ` Albert Krewinkel
     [not found]     ` <87tue6uxxy.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
2022-01-14 16:59       ` dave....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6a978c09-0b8d-4199-862a-0a0b78955a41n@googlegroups.com \
    --to=dave.jarvis-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).