all repos — min @ f25ec82913e7d2b8fad27f588df4b7633886b338

A small but practical concatenative programming language.

Implemented highlighting (escape not working).
h3rald h3rald@h3rald.com
Sun, 19 Nov 2023 12:09:22 +0100
commit

f25ec82913e7d2b8fad27f588df4b7633886b338

parent

d9d57cfc585b888eb1a68b61859624e4aca8c563

2 files changed, 6 insertions(+), 8 deletions(-)

jump to
M site/contents/home.mdsite/contents/home.md

@@ -43,15 +43,13 @@ <section class="pure-u-1 pure-u-md-1-2">

<h2>Examples</h2> <p>The following example shows how to find recursively all files in the current folder that were modified in the last hour:</p> <pre> - <code> -. ls-r + <code>. ls-r (mtime now 3600 - >) filter</code> </pre> <p>The following example shows how to calculate the factorial of 5 using the <code>linrec</code> combinator:</p> <pre> - <code> -5 + <code>5 (dup 0 ==) (1 +) (dup 1 -) (*) linrec</code> </pre>
M site/rules.minsite/rules.min

@@ -31,7 +31,7 @@ {} :attributes

attributes class %class @attributes "span" xelement :sp sp attributes %attributes @sp - value xtext :text + value xtext puts :text sp (text) => %children @sp sp to-xml @result )

@@ -78,7 +78,7 @@ (

symbol highlight-min-codeblocks (str :html ==> str :result) ( - html "<pre>(?:\n|\r\n|\s)*<code>((?:.|\n)*?)<\/code>(?:\n|\r\n|\s)*<\/pre>" + html "<pre>\s*<code>((?:.|\n)*?)<\/code>\s*<\/pre>" (1 get min-block-highlight) replace-apply @result ) ) ::

@@ -87,7 +87,7 @@ (

symbol highlight-min-codes (str :html ==> str :result) ( - html "<code>((?:.|\n)*?)<\/code>" + html "<code>(.*?)<\/code>" (1 get min-inline-highlight) replace-apply @result ) ) ::

@@ -103,7 +103,7 @@ (settings /title %site)

(settings /version %version) ( :temp contents temp markdown - highlight-min-codes highlight-min-codeblocks @contents temp + highlight-min-codeblocks highlight-min-codes @contents temp ) (contents %contents) (:temp tpl temp mustache @page temp)