mirror of
https://github.com/journeyman-cc/smeagol.git
synced 2026-04-12 18:05:06 +00:00
Major restructuring of extension processors, not yet complete
This commit is contained in:
parent
e00beaf790
commit
54b82931b2
8 changed files with 185 additions and 11 deletions
|
|
@ -33,7 +33,7 @@
|
|||
:default-locale "en-GB" ;; default language used for messages
|
||||
:formatters {"vega" smeagol.formatting/process-vega
|
||||
"vis" smeagol.formatting/process-vega
|
||||
"mermaid" smeagol.formatting/process-mermaid
|
||||
"mermaid" smeagol.extensions.mermaid/process-mermaid
|
||||
"backticks" smeagol.formatting/process-backticks}
|
||||
:log-level :info ;; the minimum logging level; one of
|
||||
;; :trace :debug :info :warn :error :fatal
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ Data files can be uploaded in the same way as images, by using the **upload a fi
|
|||
|
||||
Graphs can now be embedded in a page using the [Mermaid](https://mermaid-js.github.io/mermaid/#/) graph description language. The graph description should start with a line comprising three back-ticks and then the word `mermaid`, and end with a line comprising just three backticks.
|
||||
|
||||
Here's an example culled from the Mermaid documentation.
|
||||
Here's an example culled from the Mermaid documentation. Edit this page to see the specification.
|
||||
|
||||
### GANTT Chart
|
||||
|
||||
|
|
@ -58,6 +58,14 @@ gantt
|
|||
Add to mermaid :1d
|
||||
```
|
||||
|
||||
Mermaid graph specifications can also be loaded from URLs. Here's another example; again, edit this page to see how the trick is done.
|
||||
|
||||
### Class Diagram
|
||||
|
||||
```mermaid
|
||||
data/classes.mermaid
|
||||
```
|
||||
|
||||
## Writing your own custom formatters
|
||||
|
||||
A custom formatter is simply a Clojure function which takes a string and an integer as arguments and produces a string as output. The string is the text the user has typed into their markdown; the integer is simply a number you can use to keep track of which addition to the page this is, in order, for example, to fix up some JavaScript to render it.
|
||||
|
|
|
|||
14
resources/public/data/classes.mermaid
Normal file
14
resources/public/data/classes.mermaid
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
classDiagram
|
||||
Class01 <|-- AveryLongClass : Cool
|
||||
Class03 *-- Class04
|
||||
Class05 o-- Class06
|
||||
Class07 .. Class08
|
||||
Class09 --> C2 : Where am i?
|
||||
Class09 --* C3
|
||||
Class09 --|> Class07
|
||||
Class07 : equals()
|
||||
Class07 : Object[] elementData
|
||||
Class01 : size()
|
||||
Class01 : int chimp
|
||||
Class01 : int gorilla
|
||||
Class08 <--> C2: Cool label
|
||||
|
|
@ -9,7 +9,7 @@
|
|||
<!-- else -->
|
||||
<!-- TODO: currently `lein npm install` fails to build packages on all platforms, and
|
||||
fails SILENTLY. Consequently setting js-from to local is not advised. Investigting. -->
|
||||
<!-- script "vendor/mermaid/dist/mermaid.js" %}
|
||||
<!-- script "vendor/mermaid/dist/mermaid.js" %} -->
|
||||
<!-- endifequal -->
|
||||
{% endblock %}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue