Skip to content
This repository was archived by the owner on Sep 10, 2022. It is now read-only.

Commit 0b60ab0

Browse files
committed
_includes/java_visualizer.html: Parameterize all options
1 parent 5c06c81 commit 0b60ab0

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

_includes/java_visualizer.html

+10-3
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,24 @@
2222
}
2323
}
2424
{%- endcapture -%}
25-
{% include java_visualizer.html code=HelloWorld caption="Hello, world!"
26-
label="Visualize Code" curInstr="0" args='["arg1", ...]' stdin="stdin" %}
25+
{% include java_visualizer.html mode="display" code=HelloWorld
26+
caption="Hello, world!" label="Visualize Code" class="btn" curInstr="0"
27+
args='["arg1", ...]' stdin="stdin" showStringsAsObjects=""
28+
showAllFields="" disableNesting="" verticalLists="" %}
2729
{% endcomment %}
2830

31+
{% assign mode = include.mode | default: 'display' %}
2932
{% assign code = include.code | default: '' %}
3033
{% assign caption = include.caption | default: '' %}
3134
{% assign label = include.label | default: 'Visualize Code' %}
3235
{% assign class = include.class | default: 'btn' %}
3336
{% assign curInstr = include.curInstr | default: 0 %}
3437
{% assign args = include.args | default: '[]' %}
3538
{% assign stdin = include.stdin | default: '' %}
39+
{% assign showStringsAsObjects = include.showStringsAsObjects | default: '' %}
40+
{% assign showAllFields = include.showAllFields | default: '' %}
41+
{% assign disableNesting = include.disableNesting | default: '' %}
42+
{% assign verticalLists = include.verticalLists | default: '' %}
3643

3744
{% capture codeBlock %}
3845
```java
@@ -46,7 +53,7 @@
4653
{{ codeBlock }}
4754
<figcaption>
4855
{{ caption }}
49-
<a class="{{ class }}" target="_blank" href="https://cscircles.cemc.uwaterloo.ca/java_visualize/#code={{ code | url_encode }}&mode=edit&showStringsAsObjects=&disableNesting=&args={{ args | url_encode }}&stdin={{ stdin | url_encode }}&curInstr={{ curInstr }}">
56+
<a class="{{ class }}" target="_blank" href="https://cscircles.cemc.uwaterloo.ca/java_visualize/#code={{ code | url_encode }}&mode={{ mode }}&showStringsAsObjects={{ showSringsAsObjects }}&showAllFields={{ showAllFields }}&disableNesting={{ disableNesting }}&verticalLists={{ verticalLists }}&args={{ args | url_encode }}&stdin={{ stdin | url_encode }}&curInstr={{ curInstr }}">
5057
{{ label }}
5158
</a>
5259
</figcaption>

0 commit comments

Comments
 (0)