You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>HastyScribe also supports <a href="#Fields">fields</a> to easily include things like the current date or time, but also custom values specified as command-line parameters.</p>
212
214
215
+
<h4 id="Substitution.Macros">Substitution Macros<a href="#document-top" title="Go to top"></a></h4>
216
+
217
+
<p>If you find yourself writing chunks of text that follows the same format except for some content, you can define simple text substitution <a href="#Macros">macros</a> for even higher content reuse.</p>
218
+
213
219
<h4 id="Image..and.font..Embedding">Image (and font) Embedding<a href="#document-top" title="Go to top"></a></h4>
214
220
215
221
<p>HastyScribe only produces single HTML files. With <em>no dependencies</em>:</p>
<p>The easiest way to get HastyScribe is by downloading one of the prebuilt binaries from the <a href="https://github.com/h3rald/hastyscribe/releases/download/v">Github Release Page</a>:</p>
248
254
249
255
<ul>
250
-
<li><a href="https://github.com/h3rald/hastyscribe/releases/download/v/hastyscribe_v_macosx_x64.zip">HastyScribe for Mac OS X (x64)</a> – Compiled on OS X El Capitan (LLVM CLANG 7.0)</li>
251
-
<li><a href="https://github.com/h3rald/hastyscribe/releases/download/v/hastyscribe_v_windows_x64.zip">HastyScribe for Windows (x64)</a> – Cross-compiled on OS X El Capitan (MinGW-w64 GCC 4.8.2)</li>
252
-
<li><a href="https://github.com/h3rald/hastyscribe/releases/download/v/hastyscribe_v_windows_x86.zip">HastyScribe for Windows (x86)</a> – Cross-compiled on OS X El Capitan (MinGW-w64 GCC 4.8.2)</li>
253
-
<li><a href="https://github.com/h3rald/hastyscribe/releases/download/v/hastyscribe_v_linux_x64.zip">HastyScribe for Linux (x64)</a> – Cross-compiled on OS X El Capitan (GNU GCC 4.8.1)</li>
254
-
<li><a href="https://github.com/h3rald/hastyscribe/releases/download/v/hastyscribe_v_linux_x86.zip">HastyScribe for Linux (x86)</a> – Cross-compiled on OS X El Capitan (GNU GCC 4.8.1)</li>
255
-
<li><a href="https://github.com/h3rald/hastyscribe/releases/download/v/hastyscribe_v_linux_arm.zip">HastyScribe for Linux (ARM)</a> – Cross-compiled on OS X El Capitan (GNU GCC 4.8.2)</li>
256
+
<li><a href="https://github.com/h3rald/hastyscribe/releases/download/v1.3.0/hastyscribe_v1.3.0_macos_x64.zip">HastyScribe for Mac OS X (x64)</a> – Compiled on Mac OS X Sierra (LLVM CLANG 8.0.0)</li>
257
+
<li><a href="https://github.com/h3rald/hastyscribe/releases/download/v1.3.0/hastyscribe_v1.3.0_windows_x64.zip">HastyScribe for Windows (x64)</a> – Cross-compiled on Mac OS X Sierra (MinGW-w64 GCC 4.8.2)</li>
258
+
<li><a href="https://github.com/h3rald/hastyscribe/releases/download/v1.3.0/hastyscribe_v1.3.0_windows_x86.zip">HastyScribe for Windows (x86)</a> – Cross-compiled on Mac OS X Sierra (MinGW-w64 GCC 4.8.2)</li>
259
+
<li><a href="https://github.com/h3rald/hastyscribe/releases/download/v1.3.0/hastyscribe_v1.3.0_linux_x64.zip">HastyScribe for Linux (x64)</a> – Cross-compiled on Mac OS X Sierra (GNU GCC 4.8.1)</li>
260
+
<li><a href="https://github.com/h3rald/hastyscribe/releases/download/v1.3.0/hastyscribe_v1.3.0_linux_x86.zip">HastyScribe for Linux (x86)</a> – Cross-compiled on Mac OS X Sierra (GNU GCC 4.8.1)</li>
261
+
<li><a href="https://github.com/h3rald/hastyscribe/releases/download/v1.3.0/hastyscribe_v1.3.0_linux_arm.zip">HastyScribe for Linux (ARM)</a> – Cross-compiled on Mac OS X Sierra (GNU GCC 4.8.2)</li>
256
262
</ul>
257
263
258
264
@@ -396,59 +402,59 @@ <h3 id="Fields">Fields<a href="#document-top" title="Go to top"></a></h3>
396
402
<tbody>
397
403
<tr>
398
404
<td><code>{{$timestamp}}</code> </td>
399
-
<td> 1466790332</td>
405
+
<td> 1476008117</td>
400
406
</tr>
401
407
<tr>
402
408
<td><code>{{$date}}</code> </td>
403
-
<td> 2016-06-24</td>
409
+
<td> 2016-10-09</td>
404
410
</tr>
405
411
<tr>
406
412
<td><code>{{$full-date}}</code> </td>
407
-
<td> Friday, June 24, 2016</td>
413
+
<td> Sunday, October 9, 2016</td>
408
414
</tr>
409
415
<tr>
410
416
<td><code>{{$long-date}}</code> </td>
411
-
<td> June 24, 2016</td>
417
+
<td> October 9, 2016</td>
412
418
</tr>
413
419
<tr>
414
420
<td><code>{{$medium-date}}</code> </td>
415
-
<td> Jun 24, 2016</td>
421
+
<td> Oct 9, 2016</td>
416
422
</tr>
417
423
<tr>
418
424
<td><code>{{$short-date}}</code> </td>
419
-
<td> 6/24/16</td>
425
+
<td> 10/9/16</td>
420
426
</tr>
421
427
<tr>
422
428
<td><code>{{$short-time}}</code> </td>
423
-
<td> 19:45 PM</td>
429
+
<td> 12:15 PM</td>
424
430
</tr>
425
431
<tr>
426
432
<td><code>{{$short-time-24}}</code> </td>
427
-
<td> 19:45</td>
433
+
<td> 12:15</td>
428
434
</tr>
429
435
<tr>
430
436
<td><code>{{$time}}</code> </td>
431
-
<td> 19:45:32 PM</td>
437
+
<td> 12:15:17 PM</td>
432
438
</tr>
433
439
<tr>
434
440
<td><code>{{$time-24}}</code> </td>
435
-
<td> 19:45:32</td>
441
+
<td> 12:15:17</td>
436
442
</tr>
437
443
<tr>
438
444
<td><code>{{$day}}</code> </td>
439
-
<td> 24</td>
445
+
<td> 09</td>
440
446
</tr>
441
447
<tr>
442
448
<td><code>{{$short-day}}</code> </td>
443
-
<td> 24</td>
449
+
<td> 9</td>
444
450
</tr>
445
451
<tr>
446
452
<td><code>{{$month}}</code> </td>
447
-
<td> 06</td>
453
+
<td> 10</td>
448
454
</tr>
449
455
<tr>
450
456
<td><code>{{$short-month}}</code> </td>
451
-
<td> 6</td>
457
+
<td> 10</td>
452
458
</tr>
453
459
<tr>
454
460
<td><code>{{$year}}</code> </td>
@@ -460,19 +466,19 @@ <h3 id="Fields">Fields<a href="#document-top" title="Go to top"></a></h3>
460
466
</tr>
461
467
<tr>
462
468
<td><code>{{$weekday}}</code> </td>
463
-
<td> Friday</td>
469
+
<td> Sunday</td>
464
470
</tr>
465
471
<tr>
466
472
<td><code>{{$weekday-abbr}}</code> </td>
467
-
<td> 24</td>
473
+
<td> 09</td>
468
474
</tr>
469
475
<tr>
470
476
<td><code>{{$month-name}}</code> </td>
471
-
<td> June</td>
477
+
<td> October</td>
472
478
</tr>
473
479
<tr>
474
480
<td><code>{{$month-name-abbr}}</code> </td>
475
-
<td> Jun</td>
481
+
<td> Oct</td>
476
482
</tr>
477
483
<tr>
478
484
<td><code>{{$timezone}}</code> </td>
@@ -492,6 +498,25 @@ <h3 id="Fields">Fields<a href="#document-top" title="Go to top"></a></h3>
492
498
493
499
<p>In this case it will be possible to access the <span class="kwd">product</span> and <span class="kwd">product</span> fields within <span class="file">my-document.md</span> using <code>{{$product}}</code> and <code>{{$version}}</code>.</p>
494
500
501
+
<h3 id="Macros">Macros<a href="#document-top" title="Go to top"></a></h3>
502
+
503
+
<p>If snippets are not enough, and you want to reuse chunks of <em>similar</em> content, you can define substitution macros using the following syntax:</p>
504
+
505
+
<p><code>{#greet -> Hello, $1! Are you $2?#}</code></p>
506
+
507
+
<p>This defines a macro called <span class="kwd">greet</span> that takes two parameters which will be substituted instead of <span class="kwd">$1</span> and <span class="kwd">$2</span>. To use the macro, use the following syntax:</p>
508
+
509
+
<p><code>{#greet||Fabio||ready#}</code></p>
510
+
511
+
<div class="note"><p>Note</p>
512
+
513
+
<ul>
514
+
<li>Like snippets, macros can be multiline.</li>
515
+
<li>Spaces and newline character are preseved ad the start and end of parameters.</li>
516
+
<li>You can use snippets and fields within macros (but you cannot nest macros inside other macros).</li>
517
+
</ul>
518
+
</div>
519
+
495
520
<h3 id="Inline.Formatting">Inline Formatting<a href="#document-top" title="Go to top"></a></h3>
496
521
497
522
<p>The following table lists all the most common ways to format inline text:</p>
@@ -1341,7 +1366,7 @@ <h2 id="Credits">Credits<a href="#document-top" title="Go to top"></a></h2>
Copy file name to clipboardexpand all lines: doc/HastyScribe_UserGuide.md
+30-6
Original file line number
Diff line number
Diff line change
@@ -47,6 +47,11 @@ Although not part of neither {{md}} nor Discount, {{hs}} allows you to create te
47
47
48
48
{{hs}} also supports [fields](#Fields) to easily include things like the current date or time, but also custom values specified as command-line parameters.
49
49
50
+
51
+
#### Substitution Macros
52
+
53
+
If you find yourself writing chunks of text that follows the same format except for some content, you can define simple text substitution [macros](#Macros) for even higher content reuse.
54
+
50
55
#### Image (and font) Embedding
51
56
52
57
{{hs}} only produces single HTML files. With _no dependencies_:
@@ -79,14 +84,16 @@ All HTML documents created by {{hs}} are responsive and can be viewed perfectly
79
84
80
85
### Downloading Pre-built Binaries
81
86
87
+
{# release -> [HastyScribe for $1]({{release}}{{$version}}/hastyscribe_v{{$version}}_$2.zip) -- $3 #}
88
+
82
89
The easiest way to get {{hs}} is by downloading one of the prebuilt binaries from the [Github Release Page][release]:
83
90
84
-
*[HastyScribe for Mac OS X (x64)]({{release}}{{$version}}/hastyscribe_v{{$version}}_macosx_x64.zip) -- Compiled on OS X El Capitan (LLVM CLANG 7.0)
85
-
*[HastyScribe for Windows (x64)]({{release}}{{$version}}/hastyscribe_v{{$version}}_windows_x64.zip) -- Cross-compiled on OS X El Capitan (MinGW-w64 GCC 4.8.2)
86
-
*[HastyScribe for Windows (x86)]({{release}}{{$version}}/hastyscribe_v{{$version}}_windows_x86.zip) -- Cross-compiled on OS X El Capitan (MinGW-w64 GCC 4.8.2)
87
-
*[HastyScribe for Linux (x64)]({{release}}{{$version}}/hastyscribe_v{{$version}}_linux_x64.zip) -- Cross-compiled on OS X El Capitan (GNU GCC 4.8.1)
88
-
*[HastyScribe for Linux (x86)]({{release}}{{$version}}/hastyscribe_v{{$version}}_linux_x86.zip) -- Cross-compiled on OS X El Capitan (GNU GCC 4.8.1)
89
-
*[HastyScribe for Linux (ARM)]({{release}}{{$version}}/hastyscribe_v{{$version}}_linux_arm.zip) -- Cross-compiled on OS X El Capitan (GNU GCC 4.8.2)
91
+
*{#release||Mac OS X (x64)||macos_x64||Compiled on {{osx -> Mac OS X Sierra}} (LLVM CLANG 8.0.0)#}
@@ -243,6 +250,23 @@ Additionally, you can define your own custom fields via command-line parameters,
243
250
244
251
In this case it will be possible to access the [product](class:kwd) and [product](class:kwd) fields within [my-document.md](class:file) using <code>\{\{$product\}\}</code> and <code>\{\{$version\}\}</code>.
245
252
253
+
### Macros
254
+
255
+
If snippets are not enough, and you want to reuse chunks of _similar_ content, you can define substitution macros using the following syntax:
256
+
257
+
<code>\{#greet -> Hello, $1! Are you $2?#\}</code>
258
+
259
+
This defines a macro called [greet](class:kwd) that takes two parameters which will be substituted instead of [$1](class:kwd) and [$2](class:kwd). To use the macro, use the following syntax:
260
+
261
+
<code>\{#greet||Fabio||ready#\}</code>
262
+
263
+
> %note%
264
+
> Note
265
+
>
266
+
> * Like snippets, macros can be multiline.
267
+
> * Spaces and newline character are preseved ad the start and end of parameters.
268
+
> * You can use snippets and fields within macros (but you cannot nest macros inside other macros).
269
+
246
270
### Inline Formatting
247
271
248
272
The following table lists all the most common ways to format inline text:
0 commit comments