aboutsummaryrefslogtreecommitdiffstats
path: root/root
diff options
context:
space:
mode:
Diffstat (limited to 'root')
-rw-r--r--root/articles/mmmfs/text$moonscript -> fn -> mmm$dom.moon9
-rw-r--r--root/meta/mmm.dom/text$moonscript -> mmm$dom.moon17
2 files changed, 5 insertions, 21 deletions
diff --git a/root/articles/mmmfs/text$moonscript -> fn -> mmm$dom.moon b/root/articles/mmmfs/text$moonscript -> fn -> mmm$dom.moon
index 0d59c42..5619747 100644
--- a/root/articles/mmmfs/text$moonscript -> fn -> mmm$dom.moon
+++ b/root/articles/mmmfs/text$moonscript -> fn -> mmm$dom.moon
@@ -5,14 +5,7 @@
=>
html = require 'mmm.dom'
import article, h1, h2, h3, p, div, a, sup, ol, li, span, code, pre, br from html
-
- moon = if MODE == 'SERVER'
- (str) -> code (str\match '^ *(..-) *$'), class: 'hljs'
- else
- (str) ->
- result = window.hljs\highlight 'moonscript', (str\match '^ *(..-) *$'), true
- with code class: 'hljs'
- .innerHTML = result.value
+ import moon from (require 'mmm.highlighting').languages
article with _this = {}
append = (a) -> table.insert _this, a
diff --git a/root/meta/mmm.dom/text$moonscript -> mmm$dom.moon b/root/meta/mmm.dom/text$moonscript -> mmm$dom.moon
index fe1dfd4..1479c00 100644
--- a/root/meta/mmm.dom/text$moonscript -> mmm$dom.moon
+++ b/root/meta/mmm.dom/text$moonscript -> mmm$dom.moon
@@ -1,24 +1,15 @@
import article, h1, h2, p, a, span, div, pre, code from require 'mmm.dom'
+import lua, moonscript from (require 'mmm.highlighting').languages
mmmdom = -> code 'mmm.dom'
source = do
- build = (lang) -> if MODE == 'SERVER'
- (str) -> code (str\match '^ *(..-) *$'), class: "hljs lang-#{lang}"
- else
- (str) ->
- result = window.hljs\highlight lang, (str\match '^ *(..-) *$'), true
- with code class: 'hljs'
- .innerHTML = result.value
-
- mklua, mkmoon = (build 'lua'), build 'moonscript'
-
- (moon, lua, demo=true) ->
- the_code = pre (mkmoon moon), (mklua lua), class: 'dual-code'
+ (moon_src, lua_src, demo=true) ->
+ the_code = pre (moonscript moon_src), (lua lua_src), class: 'dual-code'
return the_code unless demo
- example = assert load lua
+ example = assert load lua_src
div the_code, div example!, class: 'example'
article {