diff options
| author | s-ol <s-ol@users.noreply.github.com> | 2018-11-06 10:02:34 +0000 |
|---|---|---|
| committer | s-ol <s-ol@users.noreply.github.com> | 2018-11-06 10:11:44 +0000 |
| commit | 51afa1123d12239a3f14a43928d29321d940199d (patch) | |
| tree | 708cda6d39372e3221636326a71e36657f0a1581 /root | |
| parent | add inspector (diff) | |
| download | mmm-51afa1123d12239a3f14a43928d29321d940199d.tar.gz mmm-51afa1123d12239a3f14a43928d29321d940199d.zip | |
style inspector code
Diffstat (limited to 'root')
| -rw-r--r-- | root/articles/mmmfs/text$moonscript -> fn -> mmm$dom.moon | 9 | ||||
| -rw-r--r-- | root/meta/mmm.dom/text$moonscript -> mmm$dom.moon | 17 |
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 { |
