Project

General

Profile

Actions

csInfo #4044 | FMT-0013

open
RA

csInfo #FMT-0002: Kroki examples

D2

csInfo #4044 | FMT-0013: D2

Added by Redmine Admin 8 days ago. Updated 7 days ago.

Status:
New
Priority:
Normal
Assignee:
-
Start date:
Due date:
% Done:

0%

Estimated time:

Description

D2 Parser+readerio.RuneReader+readerPosd2ast.Position-lookahead[]rune#lookaheadPosd2ast.Position+peek()(r rune, eof bool)+rewind()void+commit()void#peekn(n int)(s string, eof bool)github.com/terrastruct/d2parser.git

The diagram above is shown by just simply put sample diagram code copied from kroki.io inside a macro.
The macro language is described in redmine-kroki plugin page.

This is the exact code:


{{kroki(d2, max_width=600)
​D2 Parser: {
  shape: class

  # Default visibility is + so no need to specify.
  +reader: io.RuneReader
  readerPos: d2ast.Position

  # Private field.
  -lookahead: "[]rune"

  # Protected field.
  # We have to escape the # to prevent the line from being parsed as a comment.
  \#lookaheadPos: d2ast.Position

  +peek(): (r rune, eof bool)
  rewind()
  commit()

  \#peekn(n int): (s string, eof bool)
}

"github.com/terrastruct/d2parser.git" -> D2 Parser
}}


Document references

No data to display

RA Updated by Redmine Admin 7 days ago Actions #1

  • Description updated (diff)

RA Updated by Redmine Admin 7 days ago Actions #2

  • Description updated (diff)
Actions

Also available in: PDF Atom