Skip to content

Commit

Permalink
new generated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Timm Knape committed Oct 4, 2019
1 parent 102ffbb commit 3b4f694
Show file tree
Hide file tree
Showing 5 changed files with 290 additions and 254 deletions.
32 changes: 16 additions & 16 deletions docs/add.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ <h1>Adding blocks in editor</h1>
<h1>Adding blocks in editor</h1>
</div>
<ul><li>
Define commands to add a header, code block or paragraph block after the current slide
define commands to add a header, code block or paragraph block after the current slide
</li><li>
When reading again <code><span class="var">hx</span></code> will merge continuous paragraphs into one block
when reading again <code><span class="var">hx</span></code> will merge continuous paragraphs into one block
</li></ul>
</div>
<div><div>
Expand All @@ -26,11 +26,11 @@ <h1>Adding blocks in editor</h1>
<span class="macro">@End(<span class="name">global elements</span>)</span>;<br/>
</code></div>
<ul><li>
The <code><span class="fn">add_block</span></code> function adds a new block after the current block
the <code><span class="fn">add_block</span></code> function adds a new block after the current block
</li><li>
It sets its value to a default text
it sets its value to a default text
</li><li>
And makes the new block the current block
and makes the new block the current block
</li></ul>
</div>
<div><div>
Expand All @@ -43,7 +43,7 @@ <h1>Adding blocks in editor</h1>
<span class="macro">@End(<span class="name">run loop</span>)</span><br/>
</code></div>
<ul><li>
Generates a new header block
generates a new header block
</li></ul>
</div>
<div><div>
Expand All @@ -56,7 +56,7 @@ <h1>Adding blocks in editor</h1>
<span class="macro">@End(<span class="name">run loop</span>)</span><br/>
</code></div>
<ul><li>
Generates a new code block
generates a new code block
</li></ul>
</div>
<div><div>
Expand All @@ -69,9 +69,9 @@ <h1>Adding blocks in editor</h1>
<span class="macro">@End(<span class="name">run loop</span>)</span><br/>
</code></div>
<ul><li>
Generates a new paragraph blocks
generates a new paragraph blocks
</li><li>
Multilpe paragraph blocks will be merged into one paragraph block on read
multiple paragraph blocks will be merged into one paragraph block on read
</li></ul>
</div>
<div><div>
Expand All @@ -95,7 +95,7 @@ <h1>Adding blocks in editor</h1>
</li><li>
so it can insert the new block before the iterator
</li><li>
As the insert can invalidate the iterators, it saves the distance
as the insert can invalidate the iterators, it saves the distance
</li><li>
and restores it afterwards
</li></ul>
Expand Down Expand Up @@ -138,7 +138,7 @@ <h2>Duplicating the current block</h2>
<h2>Duplicating the current block</h2>
</div>
<ul><li>
Duplicates the current block
duplicates the current block
</li><li>
and sets the current block to the new copy
</li></ul>
Expand All @@ -161,7 +161,7 @@ <h2>Duplicating the current block</h2>
<span class="macro">@End(<span class="name">run loop</span>)</span><br/>
</code></div>
<ul><li>
Duplicates the current block
duplicates the current block
</li><li>
if the file is valid
</li><li>
Expand All @@ -181,17 +181,17 @@ <h2>Duplicating the current block</h2>
<span class="macro">@end(<span class="name">duplicate</span>)</span><br/>
</code></div>
<ul><li>
The insert invalidates the iterator
the insert invalidates the iterator
</li><li>
so the offset is saved
</li><li>
A copy of the current block is inserted before the current block
a copy of the current block is inserted before the current block
</li><li>
That is the wrong way around but easier
that is the wrong way around but easier
</li><li>
and doesn't matter in the end
</li><li>
The new current block is set to the old current block
the new current block is set to the old current block
</li><li>
which is now the second of the two duplicates
</li></ul>
Expand Down
58 changes: 47 additions & 11 deletions docs/blocks.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ <h1>Separating input into blocks</h1>
<h1>Separating input into blocks</h1>
</div>
<ul><li>
The input is treated as a sequence of blocks.
the input is treated as a sequence of blocks.
</li><li>
Each block has a type, a value and optional notes.
each block has a type, a value and optional notes.
</li><li>
Blocks are separated by empty lines.
blocks are separated by empty lines.
</li></ul>
</div>
<div><div>
Expand All @@ -26,7 +26,7 @@ <h1>Separating input into blocks</h1>
<span class="macro">@End(<span class="name">input prereqs</span>)</span><br/>
</code></div>
<ul><li>
This file uses a local shortcut for the global fragment
this file uses a local shortcut for the global fragment
</li></ul>
</div>
<div><div>
Expand All @@ -39,9 +39,9 @@ <h1>Separating input into blocks</h1>
<span class="macro">@end(<span class="name">globals</span>)</span><br/>
</code></div>
<ul><li>
The <code><span class="type">Read_State</span></code> identifies the mode that the block parser is currently in.
the <code><span class="type">Read_State</span></code> identifies the mode that the block parser is currently in
</li><li>
The default <code><span class="var">new_element</span></code> signals that a new block is starting.
the default <code><span class="var">new_element</span></code> signals that a new block is starting
</li></ul>
</div>
<div><div>
Expand All @@ -61,9 +61,9 @@ <h1>Separating input into blocks</h1>
<span class="macro">@End(<span class="name">open input elements</span>)</span><br/>
</code></div>
<ul><li>
Each input element has a <code><span class="type">Read_State</span></code>.
each input element has a <code><span class="type">Read_State</span></code>.
</li><li>
The initial value is <code><span class="var">new_element</span></code>.
the initial value is <code><span class="var">new_element</span></code>.
</li></ul>
</div>
<div><div>
Expand All @@ -80,11 +80,11 @@ <h1>Separating input into blocks</h1>
<span class="macro">@End(<span class="name">process line</span>)</span><br/>
</code></div>
<ul><li>
The <code><span class="var">do</span></code>-loop is only a grouping construct.
the <code><span class="var">do</span></code>-loop is only a grouping construct
</li><li>
The loop will not iterate.
the loop will not iterate
</li><li>
But intermediate steps are allowed to <code><span class="keyword">break</span></code> out of the loop.
but intermediate steps are allowed to <code><span class="keyword">break</span></code> out of the loop
</li></ul>
</div>
<div><div>
Expand All @@ -96,13 +96,19 @@ <h1>Separating input into blocks</h1>
<span class="in1"></span>}<br/>
<span class="macro">@end(<span class="name">handle newlines</span>)</span><br/>
</code></div>
<ul><li>
if the line is empty, start a new element
</li></ul>
</div>
<div><div>
<code>
<span class="macro">@def(<span class="name">read states</span>)</span>,<br/>
<span class="in1"></span><span class="var">header</span><br/>
<span class="macro">@end(<span class="name">read states</span>)</span><br/>
</code></div>
<ul><li>
new state for parsing headers
</li></ul>
</div>
<div><div>
<code>
Expand All @@ -117,20 +123,31 @@ <h1>Separating input into blocks</h1>
<span class="in1"></span>}<br/>
<span class="macro">@end(<span class="name">states without newlines</span>)</span><br/>
</code></div>
<ul><li>
headers start if the previous line is empty
</li><li>
and the current line starts with <code><span class="keyword">#</span></code>
</li></ul>
</div>
<div><div>
<code>
<span class="macro">@def(<span class="name">unknown line</span>)</span><br/>
<span class="in1"></span><span class="type">std</span>::<span class="var">cerr</span> &lt;&lt; <span class="str">"!! "</span> &lt;&lt; <span class="var">line</span> &lt;&lt; <span class="str">'\n'</span>;<br/>
<span class="macro">@end(<span class="name">unknown line</span>)</span><br/>
</code></div>
<ul><li>
write error message for unrecognized line
</li></ul>
</div>
<div><div>
<code>
<span class="macro">@Add(<span class="name">includes</span>)</span><br/>
<span class="in1"></span><span class="keyword">#include</span> &lt;<span class="type">vector</span>&gt;<br/>
<span class="macro">@End(<span class="name">includes</span>)</span><br/>
</code></div>
<ul><li>
<code><span class="type">Block</span></code> has <code><span class="type">std</span>::<span class="type">vector</span></code> of strings
</li></ul>
</div>
<div><div>
<code>
Expand All @@ -143,13 +160,19 @@ <h1>Separating input into blocks</h1>
<span class="in1"></span>};<br/>
<span class="macro">@end(<span class="name">globals</span>)</span><br/>
</code></div>
<ul><li>
<code><span class="type">Block</span></code> contains values and notes
</li></ul>
</div>
<div><div>
<code>
<span class="macro">@Add(<span class="name">input elements</span>)</span><br/>
<span class="in1"></span><span class="type">std</span>::<span class="type">vector</span>&lt;<span class="type">Block</span>&gt; <span class="var">blocks</span>;<br/>
<span class="macro">@End(<span class="name">input elements</span>)</span>;<br/>
</code></div>
<ul><li>
<code><span class="type">Input</span></code> contains container of <code><span class="type">Block</span></code>s
</li></ul>
</div>
<div><div>
<code>
Expand All @@ -158,6 +181,9 @@ <h1>Separating input into blocks</h1>
<span class="in2"></span><span class="var">inputs</span>.<span class="fn">cur</span>().<span class="fn">input</span>().<span class="var">blocks</span>;<br/>
<span class="macro">@end(<span class="name">line vars</span>)</span><br/>
</code></div>
<ul><li>
get reference to <code><span class="type">Block</span></code>s
</li></ul>
</div>
<div><div>
<code>
Expand All @@ -174,6 +200,13 @@ <h1>Separating input into blocks</h1>
<span class="in1"></span>});<br/>
<span class="macro">@end(<span class="name">got header line</span>)</span><br/>
</code></div>
<ul><li>
count <code><span class="keyword">#</span></code>s
</li><li>
skip spaces
</li><li>
rest is header title
</li></ul>
</div>
<div><div>
<code>
Expand All @@ -182,6 +215,9 @@ <h1>Separating input into blocks</h1>
<span class="in1"></span><span class="var">after_code</span><br/>
<span class="macro">@end(<span class="name">read states</span>)</span><br/>
</code></div>
<ul><li>
new states for parsing code blocks
</li></ul>
</div>
<div><div>
<code>
Expand Down
Loading

0 comments on commit 3b4f694

Please sign in to comment.