This repository was archived by the owner on Oct 5, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathworkflowmatlab.html
More file actions
executable file
·76 lines (53 loc) · 2.41 KB
/
Copy pathworkflowmatlab.html
File metadata and controls
executable file
·76 lines (53 loc) · 2.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<script src="{{ site.baseurl }}/js/mermaid.min.js"></script>
<link rel="stylesheet" href="{{ site.baseurl }}/css/mermaid.forest.css">
<script>mermaid.initialize({startOnLoad:true});</script>
<!-- Get Content for This Post and Split at Pound Signs to Find Headers -->
{% for post in site.posts %}
{% if post.title == page.title and post.author == page.author and post.date == page.date %}
{% assign text = post.content | newline_to_br | split:"<h" %}
{% endif %}
{% endfor %}
{% assign subcount = text | size | minus:1 %}
<!-- Encapsulate in Capture to Handle the Whitespace and Allow Commenting -->
{% capture MermaidBlock %}
<!-- Initialize Header Counts -->
{% assign smallheadercount = 0 %}
<!-- Initialize Flowchart -->
graph TB
<!-- Loop over Potential Headers -->
{% for sub in (1..subcount) %}
<!-- Get Length of Potential Header String -->
{% assign headerlevel = text[sub] | truncate: 1 %}
<!-- If I am the First in Sequence Nowhere to Connect -->
{% if smallheadercount == 0 %}
{% assign currentheader = text[sub] | newline_to_br | split:"<br />" | first | split:">" %}
{% assign currentheader = currentheader[1] | split:"<" | first %}
{% assign currentsub = sub %}
{% assign smallheadercount = smallheadercount | plus:1 %}
node{{ sub }}({{ currentheader }})
click node{{ sub }} "{{ sub | prepend:'#' }}"
{% else %}
{% assign prevheader = currentheader %}
{% assign prevsub = currentsub %}
{% assign currentheader = text[sub] | newline_to_br | split:"<br />" | first | split:">" %}
{% assign currentheader = currentheader[1] | split:"<" | first %}
{% assign currentsub = sub %}
node{{ prevsub }}({{ prevheader }}) --> node{{ sub }}({{ currentheader }})
click node{{ sub }} "{{ sub | prepend:'#' }}"
{% endif %}
{% assign subcheck = 2 %}
{% endfor %}
<!-- Finalize Flowchart -->
<!-- Finalize Capture -->
{% endcapture %}
<!-- Make the Graph -->
<h1> Workflow Overview </h1>
<!-- Strip HTML and Seperate at Line Breaks -->
{% assign Blocks = MermaidBlock | strip_html | newline_to_br | split:"<br />" %}
{% assign BlocksLength = Blocks | size %}
<!-- Strip Each Line of Whitespace and Only Keep Lines Longer than 3 -->
<div class="mermaid" id="mermaidworkflow" style="margin-left:100px">
{% for line in (0..BlocksLength) %}{% assign BlockSize = Blocks[line] | size %}{% if BlockSize > 3 %}
{{ Blocks[line] | strip | strip_newlines }}
{% endif %}{% endfor %}
</div>