Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tag plugin documentation for Wavedrom. #101

Merged
merged 6 commits into from
Jun 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions _config.next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ menu:
Label: /label.html || fa fa-hat-wizard
Link Grid: /link-grid.html || fa fa-grip-vertical
Mermaid: /mermaid.html || fa fa-project-diagram
WaveDrom: /wavedrom.html || fa fa-diagram-predecessor
Note: /note.html || fa fa-adjust
PDF: /pdf.html || fa fa-file-pdf
Tabs: /tabs.html || fa fa-columns
Expand Down Expand Up @@ -222,6 +223,9 @@ tabs:
mermaid:
enable: true

wavedrom:
enable: true


# ============================================================= #
# ==================== External Libraries ===================== #
Expand Down
1 change: 1 addition & 0 deletions source/docs/tag-plugins/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Tag Plugin is a way to make special style contents supported by Hexo. For exampl
* [Label](/docs/tag-plugins/label.html)
* [Link Grid](/docs/tag-plugins/link-grid.html)
* [Mermaid](/docs/tag-plugins/mermaid.html)
* [WaveDrom](/doc/tag-plugins/wavedrom.html)
* [Note](/docs/tag-plugins/note.html)
* [PDF](/docs/tag-plugins/pdf.html)
* [Tabs](/docs/tag-plugins/tabs.html)
Expand Down
36 changes: 12 additions & 24 deletions source/docs/tag-plugins/mermaid.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,18 @@ C -->|Two| E[Result 2]
{% endmermaid %}
```

or

~~~markdown
```mermaid
graph TD
A[Hard] -->|Text| B(Round)
B --> C{Decision}
C -->|One| D[Result 1]
C -->|Two| E[Result 2]
```
~~~

{% mermaid graph TD %}
A[Hard] -->|Text| B(Round)
B --> C{Decision}
Expand Down Expand Up @@ -176,27 +188,3 @@ Crash --> [*]
"Cats" : 85
"Rats" : 15
{% endmermaid %}

```jinja
{% mermaid journey %}
title My working day
section Go to work
Make tea: 5: Me
Go upstairs: 3: Me
Do work: 1: Me, Cat
section Go home
Go downstairs: 5: Me
Sit down: 3: Me
{% endmermaid %}
```

{% mermaid journey %}
title My working day
section Go to work
Make tea: 5: Me
Go upstairs: 3: Me
Do work: 1: Me, Cat
section Go home
Go downstairs: 5: Me
Sit down: 3: Me
{% endmermaid %}
111 changes: 111 additions & 0 deletions source/docs/tag-plugins/wavedrom.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
---
title: WaveDrom
description: NexT User Docs – NexT Supported Tags – WaveDrom
---

### Settings

```yml NexT config file
# WaveDrom tag
wavedrom:
enable: true
```

### Usage

```jinja
{% wavedrom %}
{% endwavedrom %}
```

### Examples

```jinja
{% wavedrom %}
{ signal : [
{ name: "clk", wave: "p......" },
{ name: "bus", wave: "x.34.5x", data: "head body tail" },
{ name: "wire", wave: "0.1..0." },
]}
{% endwavedrom %}
```

{% wavedrom %}
{ signal : [
{ name: "clk", wave: "p......" },
{ name: "bus", wave: "x.34.5x", data: "head body tail" },
{ name: "wire", wave: "0.1..0." },
]}
{% endwavedrom %}

```jinja
{% wavedrom %}
{ signal: [
{ name: 'A', wave: '01........0....', node: '.a........j' },
{ name: 'B', wave: '0.1.......0.1..', node: '..b.......i' },
{ name: 'C', wave: '0..1....0...1..', node: '...c....h..' },
{ name: 'D', wave: '0...1..0.....1.', node: '....d..g...' },
{ name: 'E', wave: '0....10.......1', node: '.....ef....' }
],
edge: [
'a~b t1', 'c-~a t2', 'c-~>d time 3', 'd~-e',
'e~>f', 'f->g', 'g-~>h', 'h~>i some text', 'h~->j'
],
config:{skin:'lowkey'}
}
{% endwavedrom %}
```

{% wavedrom %}
{ signal: [
{ name: 'A', wave: '01........0....', node: '.a........j' },
{ name: 'B', wave: '0.1.......0.1..', node: '..b.......i' },
{ name: 'C', wave: '0..1....0...1..', node: '...c....h..' },
{ name: 'D', wave: '0...1..0.....1.', node: '....d..g...' },
{ name: 'E', wave: '0....10.......1', node: '.....ef....' }
],
edge: [
'a~b t1', 'c-~a t2', 'c-~>d time 3', 'd~-e',
'e~>f', 'f->g', 'g-~>h', 'h~>i some text', 'h~->j'
],
config:{skin:'lowkey'}
}
{% endwavedrom %}

```jinja
{% wavedrom %}
{reg:[
{bits: 7, name: 0x07, attr: [
'VLxU,VLE zero-extended',
'VLxU,VLE zero-extended, fault-only-first',
'VLxU sign-extended',
'VLxU sign-extended, fault-only-first',
]},
{bits: 5, name: 'vd', attr: 'destination of load', type: 2},
{bits: 3, name: 'width'},
{bits: 5, name: 'rs1', attr: 'base address', type: 4},
{bits: 5, name: 'lumop', attr: [0, 16, 0, 16]},
{bits: 1, name: 'vm'},
{bits: 3, name: 'mop', attr: [0, 0, 4, 4]},
{bits: 3, name: 'nf'},
]}
{% endwavedrom %}
```

{% wavedrom %}
{reg:[
{bits: 7, name: 0x07, attr: [
'VLxU,VLE zero-extended',
'VLxU,VLE zero-extended, fault-only-first',
'VLxU sign-extended',
'VLxU sign-extended, fault-only-first',
]},
{bits: 5, name: 'vd', attr: 'destination of load', type: 2},
{bits: 3, name: 'width'},
{bits: 5, name: 'rs1', attr: 'base address', type: 4},
{bits: 5, name: 'lumop', attr: [0, 16, 0, 16]},
{bits: 1, name: 'vm'},
{bits: 3, name: 'mop', attr: [0, 0, 4, 4]},
{bits: 3, name: 'nf'},
]}
{% endwavedrom %}