Sticky machine and machine command controls are implemented in Jekyll now, too
This commit is contained in:
parent
32f7c6b162
commit
35eb925f62
5 changed files with 51 additions and 83 deletions
16
_includes/machine-command.html
Normal file
16
_includes/machine-command.html
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{% comment %}
|
||||
|
||||
As discussed in /_posts/2017-01-03-pdp-11-tutorials.md, when a page (usually part of a tutorial)
|
||||
wants to create a control that tests some feature of a machine, the page will define a machine command
|
||||
using a Liquid-style include that looks like:
|
||||
|
||||
{% include machine-command.html type='button' label='Try It!' machine='vt100' component='Keyboard' command='sendString' value='Hello World' %}
|
||||
|
||||
and which should generate something like:
|
||||
|
||||
<button type="button" onclick="commandMachine('vt100','Keyboard','sendString','Hello World')">Try It!</button>
|
||||
|
||||
Well, that's us. So let's do it!
|
||||
|
||||
{% endcomment %}
|
||||
{% if include.type == "button" %}<button type="button" onclick="commandMachine('{{ include.machine }}','{{ include.component }}','{{ include.command }}','{{ include.value }}')">{{ include.label }}</button>{% else %}<!-- Unrecognized machine control type: {{ include.type }} -->{% endif %}
|
||||
Loading…
Reference in a new issue