Add jekyll-diagrams (#333)
* Add mermaid support via jekyll-diagrams * Add mermaid install to deploy workflow
This commit is contained in:
parent
6b0bf87846
commit
cd4b382799
|
|
@ -32,6 +32,7 @@ jobs:
|
||||||
gem install bundler
|
gem install bundler
|
||||||
bundle config path vendor/bundle
|
bundle config path vendor/bundle
|
||||||
bundle install --jobs 4 --retry 3
|
bundle install --jobs 4 --retry 3
|
||||||
|
npm install -g mermaid.cli
|
||||||
- name: Setup deploy options
|
- name: Setup deploy options
|
||||||
id: setup
|
id: setup
|
||||||
run: |
|
run: |
|
||||||
|
|
|
||||||
1
Gemfile
1
Gemfile
|
|
@ -1,6 +1,7 @@
|
||||||
source 'https://rubygems.org'
|
source 'https://rubygems.org'
|
||||||
group :jekyll_plugins do
|
group :jekyll_plugins do
|
||||||
gem 'jekyll'
|
gem 'jekyll'
|
||||||
|
gem 'jekyll-diagrams'
|
||||||
gem 'jekyll-email-protect'
|
gem 'jekyll-email-protect'
|
||||||
gem 'jekyll-feed'
|
gem 'jekyll-feed'
|
||||||
gem 'jekyll-github-metadata'
|
gem 'jekyll-github-metadata'
|
||||||
|
|
|
||||||
|
|
@ -137,6 +137,7 @@ keep_files:
|
||||||
# Plug-ins
|
# Plug-ins
|
||||||
plugins:
|
plugins:
|
||||||
- jekyll/scholar
|
- jekyll/scholar
|
||||||
|
- jekyll-diagrams
|
||||||
- jekyll-email-protect
|
- jekyll-email-protect
|
||||||
- jekyll-feed
|
- jekyll-feed
|
||||||
- jekyll-github-metadata
|
- jekyll-github-metadata
|
||||||
|
|
@ -178,6 +179,14 @@ scholar:
|
||||||
|
|
||||||
query: "@*"
|
query: "@*"
|
||||||
|
|
||||||
|
# -----------------------------------------------------------------------------
|
||||||
|
# Jekyll Diagrams
|
||||||
|
# -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
jekyll-diagrams:
|
||||||
|
# configuration, see https://github.com/zhustec/jekyll-diagrams.
|
||||||
|
# feel free to comment out this section if not using jekyll diagrams.
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
# Optional Features
|
# Optional Features
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,43 @@
|
||||||
|
---
|
||||||
|
layout: post
|
||||||
|
title: a post with diagrams
|
||||||
|
date: 2021-07-04 17:39:00
|
||||||
|
description: an example of a blog post with diagrams
|
||||||
|
---
|
||||||
|
|
||||||
|
This theme supports generating various diagrams from a text description using [jekyll-diagrams](https://github.com/zhustec/jekyll-diagrams){:target="\_blank"} plugin.
|
||||||
|
Below, we generate a few examples of such diagrams using languages such as [mermaid](https://mermaid-js.github.io/mermaid/){:target="\_blank"}, [plantuml](https://plantuml.com/){:target="\_blank"}, [vega-lite](https://vega.github.io/vega-lite/){:target="\_blank"}, etc.
|
||||||
|
|
||||||
|
**Note:** different diagram-generation packages require external dependencies to be installed on your machine.
|
||||||
|
Also, be mindful of that because of diagram generation the fist time you build your Jekyll website after adding new diagrams will be SLOW.
|
||||||
|
For any other details, please refer to [jekyll-diagrams](https://github.com/zhustec/jekyll-diagrams){:target="\_blank"} README.
|
||||||
|
|
||||||
|
|
||||||
|
## Mermaid
|
||||||
|
|
||||||
|
Install mermaid using `node.js` package manager `npm` by running the following command:
|
||||||
|
```bash
|
||||||
|
npm install -g mermaid.cli
|
||||||
|
```
|
||||||
|
|
||||||
|
The diagram below was generated by the following code:
|
||||||
|
|
||||||
|
{% raw %}
|
||||||
|
```
|
||||||
|
{% mermaid %}
|
||||||
|
sequenceDiagram
|
||||||
|
participant John
|
||||||
|
participant Alice
|
||||||
|
Alice->>John: Hello John, how are you?
|
||||||
|
John-->>Alice: Great!
|
||||||
|
{% endmermaid %}
|
||||||
|
```
|
||||||
|
{% endraw %}
|
||||||
|
|
||||||
|
{% mermaid %}
|
||||||
|
sequenceDiagram
|
||||||
|
participant John
|
||||||
|
participant Alice
|
||||||
|
Alice->>John: Hello John, how are you?
|
||||||
|
John-->>Alice: Great!
|
||||||
|
{% endmermaid %}
|
||||||
Loading…
Reference in New Issue