git.s-ol.nu hw/hw.s-ol.nu / 77622f2
update mmm plugins & client code s-ol a month ago
10 changed file(s) with 138 addition(s) and 90 deletion(s). Raw diff Collapse all Expand all
+0
-16
$mmm/plugins/gltf/converts: text$lua -> table.lua less more
0 local dom = require('mmm.dom')
1 return {
2 {
3 inp = 'URL -> model/gltf-binary',
4 out = 'mmm/dom',
5 cost = 1,
6 transform = function(self, href)
7 return dom['model-viewer']({
8 src = href,
9 ['auto-rotate'] = true,
10 ['camera-controls'] = true,
11 ['camera-orbit'] = "548.2deg 117deg 282.4m"
12 })
13 end
14 }
15 }
+0
-16
$mmm/plugins/gltf/converts: text$moonscript -> table.moon less more
0 dom = require 'mmm.dom'
1
2 {
3 {
4 inp: 'URL -> model/gltf-binary'
5 out: 'mmm/dom'
6 cost: 1
7 transform: (href) =>
8 dom['model-viewer'] {
9 src: href
10 'auto-rotate': true
11 'camera-controls': true
12 'camera-orbit': "548.2deg 117deg 282.4m"
13 }
14 }
15 }
+0
-2
$mmm/plugins/gltf/scripts: text$html+frag.html less more
0 <script type="module" src="https://unpkg.com/@google/model-viewer/dist/model-viewer.min.js"></script>
1 <script nomodule src="https://unpkg.com/@google/model-viewer/dist/model-viewer-legacy.js"></script>
0 local header, aside, footer, nav, div, svg, script, g, path, ul, li, h1, span, b, a, img
0 local header, aside, footer, div, svg, title, script, g, path, h1, span, b, a, img
11 do
22 local _obj_0 = require('mmm.dom')
3 header, aside, footer, nav, div, svg, script, g, path, ul, li, h1, span, b, a, img = _obj_0.header, _obj_0.aside, _obj_0.footer, _obj_0.nav, _obj_0.div, _obj_0.svg, _obj_0.script, _obj_0.g, _obj_0.path, _obj_0.ul, _obj_0.li, _obj_0.h1, _obj_0.span, _obj_0.b, _obj_0.a, _obj_0.img
3 header, aside, footer, div, svg, title, script, g, path, h1, span, b, a, img = _obj_0.header, _obj_0.aside, _obj_0.footer, _obj_0.div, _obj_0.svg, _obj_0.title, _obj_0.script, _obj_0.g, _obj_0.path, _obj_0.h1, _obj_0.span, _obj_0.b, _obj_0.a, _obj_0.img
44 end
55 local navigate_to
66 navigate_to = (require('mmm.mmmfs.util'))(require('mmm.dom')).navigate_to
3333 xmlns = 'http://www.w3.org/2000/svg',
3434 baseProfile = 'full',
3535 version = '1.1',
36 title('Home'),
3637 g({
3738 transform = 'translate(0.5, 0.52)',
3839 g({
5556 })
5657 })
5758 local gen_header
58 gen_header = function(self)
59 gen_header = function()
5960 return header({
6061 div({
6162 h1({
62 navigate_to('', logo),
63 navigate_to('', logo, {
64 title = 'Home'
65 }),
6366 span({
6467 span('hw', {
6568 class = 'bold'
102105 })
103106 local get_header_tags
104107 get_header_tags = function(self)
105 local title = (self:get('title: text/plain')) or self:gett('name: alpha')
108 local title_text = (self:get('title: text/plain')) or self:gett('name: alpha')
106109 local l
107110 l = function(str)
108111 str = str:gsub('[%s\n]+$', '')
112115 e = function(str)
113116 return string.format('%q', l(str))
114117 end
115 local meta = "\n <meta charset=\"UTF-8\">\n <title>" .. tostring(l(title)) .. "</title>\n "
118 local meta = "\n <meta charset=\"UTF-8\">\n <title>" .. tostring(l(title_text)) .. "</title>\n "
116119 do
117120 local page_meta = self:get('_meta: mmm/dom')
118121 if page_meta then
119122 meta = meta .. page_meta
120123 else
121 meta = meta .. "\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n\n <meta property=\"og:title\" content=" .. tostring(e(title)) .. " />\n <meta property=\"og:type\" content=\"website\" />\n <meta property=\"og:url\" content=\"https://hw.s-ol.nu" .. tostring(self.path) .. "/\" />\n <meta property=\"og:site_name\" content=\"mmm\" />"
124 meta = meta .. "\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n\n <meta property=\"og:title\" content=" .. tostring(e(title_text)) .. " />\n <meta property=\"og:type\" content=\"website\" />\n <meta property=\"og:url\" content=\"https://hw.s-ol.nu" .. tostring(self.path) .. "/\" />\n <meta property=\"og:site_name\" content=\"mmm\" />"
122125 do
123126 local desc = self:get('description: text/plain')
124127 if desc then
125 meta = meta .. "\n <meta property=\"og:description\" content=" .. tostring(e(desc)) .. " />"
128 meta = meta .. "\n <meta property=\"og:description\" content=" .. tostring(e(desc)) .. " />\n <meta name=\"description\" content=" .. tostring(e(desc)) .. " />"
126129 end
127130 end
131 do
132 local desc = self:get('keywords: text/plain')
133 if desc then
134 meta = meta .. "\n <meta name=\"keywords\" content=" .. tostring(e(desc)) .. " />"
135 end
136 end
128137 end
129138 end
130139 return meta
131140 end
132 local get_scripts
133 get_scripts = function(self)
134 local scripts = ''
141 local get_plugin_snippets
142 get_plugin_snippets = function(self, type)
143 local buf = ''
135144 for plugin in get_plugins(self) do
136145 do
137 local snippet = plugin:get('scripts: text/html+frag')
146 local snippet = plugin:get(type)
138147 if snippet then
139 scripts = scripts .. snippet
148 buf = buf .. snippet
140149 end
141150 end
142151 end
143 return scripts
152 return buf
144153 end
145154 local render
146155 render = function(content, fileder, opts)
157166 ]]
158167 end
159168 local buf = [[<!DOCTYPE html>
160 <html>
169 <html lang="en">
161170 <head>]]
162171 buf = buf .. (function()
163172 if STATIC then
164173 return STATIC.style
165174 else
166 return "<link rel=\"stylesheet\" type=\"text/css\" href=\"/static/style/:text/css\" />"
175 return [[<link rel="stylesheet" type="text/css" href="/static/style/:text/css" />]]
167176 end
168177 end)()
169 buf = buf .. "\n " .. tostring(opts.meta) .. "\n " .. tostring(get_scripts(fileder)) .. "\n </head>\n <body>\n " .. tostring(gen_header(fileder)) .. "\n\n " .. tostring(content) .. "\n\n " .. tostring(footer)
178 buf = buf .. "\n " .. tostring(get_plugin_snippets(fileder, 'styles: text/html+frag')) .. "\n " .. tostring(opts.meta) .. "\n </head>\n <body>\n " .. tostring(gen_header()) .. "\n\n " .. tostring(content) .. "\n\n " .. tostring(footer) .. "\n " .. tostring(get_plugin_snippets(fileder, 'scripts: text/html+frag'))
170179 buf = buf .. (function()
171180 if STATIC then
172181 return ''
200209 noview = true
201210 })
202211 end
212 },
213 {
214 inp = 'mmm/dom%+interactive',
215 out = 'text/html',
216 cost = 3,
217 transform = function(self, html, fileder, facet)
218 return render(html, fileder, {
219 noview = true,
220 scripts = "\n <script type=\"text/javascript\" src=\"//cdnjs.cloudflare.com/ajax/libs/svg.js/2.6.6/svg.min.js\"></script>\n <script type=\"text/javascript\" src=\"/static/fengari-web/:text/javascript\"></script>\n <script type=\"text/lua\" src=\"/static/mmm/:text/lua\"></script>\n <script type=\"text/lua\">\n require 'mmm'\n on_load = on_load or {}\n table.insert(on_load, function()\n local path = " .. tostring(string.format('%q', fileder.path)) .. "\n local facet = " .. tostring(string.format('%q', facet.name)) .. "\n local browser = require 'mmm.mmmfs.browser'\n local fileder = require 'mmm.mmmfs.fileder'\n local web = require 'mmm.mmmfs.stores.web'\n\n local store = web.WebStore({ verbose = true })\n local root = fileder.Fileder(store, store:get_index(nil, -1))\n\n local err_and_trace = function (msg) return debug.traceback(msg, 2) end\n local ok, browser = xpcall(browser.Browser, err_and_trace, root, path, facet, true)\n if not ok then error(browser) end\n end)\n </script>"
221 })
222 end
203223 }
204224 }
0 import header, aside, footer, nav, div, svg, script, g, path, ul, li, h1, span, b, a, img from require 'mmm.dom'
0 import header, aside, footer, div, svg, title, script, g, path, h1, span, b, a, img from require 'mmm.dom'
11 import navigate_to from (require 'mmm.mmmfs.util') require 'mmm.dom'
22 import get_plugins from require 'mmm.mmmfs.meta'
33
2323 baseProfile: 'full'
2424 version: '1.1'
2525
26 title 'Home'
27
2628 g {
2729 transform: 'translate(0.5, 0.52)'
2830 g {
3739 }
3840 }
3941
40 gen_header = =>
42 gen_header = ->
4143 header {
4244 div {
4345 h1 {
44 navigate_to '', logo
46 navigate_to '', logo, title: 'Home'
4547 span {
4648 span 'hw', class: 'bold'
4749 '&#8203;'
8183 }
8284
8385 get_header_tags = =>
84 title = (@get 'title: text/plain') or @gett 'name: alpha'
86 title_text = (@get 'title: text/plain') or @gett 'name: alpha'
8587
8688 l = (str) ->
8789 str = str\gsub '[%s\n]+$', ''
9092
9193 meta = "
9294 <meta charset=\"UTF-8\">
93 <title>#{l title}</title>
95 <title>#{l title_text}</title>
9496 "
9597
9698 if page_meta = @get '_meta: mmm/dom'
99101 meta ..= "
100102 <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">
101103
102 <meta property=\"og:title\" content=#{e title} />
104 <meta property=\"og:title\" content=#{e title_text} />
103105 <meta property=\"og:type\" content=\"website\" />
104106 <meta property=\"og:url\" content=\"https://hw.s-ol.nu#{@path}/\" />
105107 <meta property=\"og:site_name\" content=\"mmm\" />"
106108
107109 if desc = @get 'description: text/plain'
108110 meta ..= "
109 <meta property=\"og:description\" content=#{e desc} />"
111 <meta property=\"og:description\" content=#{e desc} />
112 <meta name=\"description\" content=#{e desc} />"
113
114 if desc = @get 'keywords: text/plain'
115 meta ..= "
116 <meta name=\"keywords\" content=#{e desc} />"
110117
111118 meta
112119
113 get_scripts = =>
114 scripts = ''
120 get_plugin_snippets = (type) =>
121 buf = ''
115122 for plugin in get_plugins @
116 if snippet = plugin\get 'scripts: text/html+frag'
117 scripts ..= snippet
118
119 scripts
123 if snippet = plugin\get type
124 buf ..= snippet
125
126 buf
120127
121128 render = (content, fileder, opts={}) ->
122129 opts.meta or= get_header_tags fileder
133140
134141 buf = [[
135142 <!DOCTYPE html>
136 <html>
143 <html lang="en">
137144 <head>]]
138 buf ..= if STATIC then STATIC.style else "<link rel=\"stylesheet\" type=\"text/css\" href=\"/static/style/:text/css\" />"
145 buf ..= if STATIC then STATIC.style else [[<link rel="stylesheet" type="text/css" href="/static/style/:text/css" />]]
139146 buf ..= "
147 #{get_plugin_snippets fileder, 'styles: text/html+frag'}
140148 #{opts.meta}
141 #{get_scripts fileder}
142149 </head>
143150 <body>
144 #{gen_header fileder}
151 #{gen_header!}
145152
146153 #{content}
147154
148 #{footer}"
155 #{footer}
156 #{get_plugin_snippets fileder, 'scripts: text/html+frag'}"
149157 buf ..= if STATIC then '' else [[
150158 <script type="text/javascript" src="/static/highlight-pack/:text/javascript"></script>
151159 <script type="text/javascript">hljs.initHighlighting()</script>]]
173181 cost: 3
174182 transform: (html, fileder) => render html, fileder, noview: true
175183 }
176 }
184 {
185 inp: 'mmm/dom%+interactive',
186 out: 'text/html',
187 cost: 3
188 transform: (html, fileder, facet) =>
189 render html, fileder, noview: true, scripts: "
190 <script type=\"text/javascript\" src=\"//cdnjs.cloudflare.com/ajax/libs/svg.js/2.6.6/svg.min.js\"></script>
191 <script type=\"text/javascript\" src=\"/static/fengari-web/:text/javascript\"></script>
192 <script type=\"text/lua\" src=\"/static/mmm/:text/lua\"></script>
193 <script type=\"text/lua\">
194 require 'mmm'
195 on_load = on_load or {}
196 table.insert(on_load, function()
197 local path = #{string.format '%q', fileder.path}
198 local facet = #{string.format '%q', facet.name}
199 local browser = require 'mmm.mmmfs.browser'
200 local fileder = require 'mmm.mmmfs.fileder'
201 local web = require 'mmm.mmmfs.stores.web'
202
203 local store = web.WebStore({ verbose = true })
204 local root = fileder.Fileder(store, store:get_index(nil, -1))
205
206 local err_and_trace = function (msg) return debug.traceback(msg, 2) end
207 local ok, browser = xpcall(browser.Browser, err_and_trace, root, path, facet, true)
208 if not ok then error(browser) end
209 end)
210 </script>"
211 }
212 }
0 /**
1 * marked - a markdown parser
2 * Copyright (c) 2011-2018, Christopher Jeffrey. (MIT Licensed)
3 * https://github.com/markedjs/marked
4 */
5 !function(e){"use strict";var x={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}|~{3,})([^`~\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:g,table:g,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};function a(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||k.defaults,this.rules=x.normal,this.options.pedantic?this.rules=x.pedantic:this.options.gfm&&(this.rules=x.gfm)}x._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,x._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,x.def=i(x.def).replace("label",x._label).replace("title",x._title).getRegex(),x.bullet=/(?:[*+-]|\d{1,9}\.)/,x.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,x.item=i(x.item,"gm").replace(/bull/g,x.bullet).getRegex(),x.list=i(x.list).replace(/bull/g,x.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+x.def.source+")").getRegex(),x._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",x._comment=/<!--(?!-?>)[\s\S]*?-->/,x.html=i(x.html,"i").replace("comment",x._comment).replace("tag",x._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),x.paragraph=i(x._paragraph).replace("hr",x.hr).replace("heading"," {0,3}#{1,6} +").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}|~{3,})[^`\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",x._tag).getRegex(),x.blockquote=i(x.blockquote).replace("paragraph",x.paragraph).getRegex(),x.normal=f({},x),x.gfm=f({},x.normal,{nptable:/^ *([^|\n ].*\|.*)\n *([-:]+ *\|[-| :]*)(?:\n((?:.*[^>\n ].*(?:\n|$))*)\n*|$)/,table:/^ *\|(.+)\n *\|?( *[-:]+[-| :]*)(?:\n((?: *[^>\n ].*(?:\n|$))*)\n*|$)/}),x.pedantic=f({},x.normal,{html:i("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",x._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:g,paragraph:i(x.normal._paragraph).replace("hr",x.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",x.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()}),a.rules=x,a.lex=function(e,t){return new a(t).lex(e)},a.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},a.prototype.token=function(e,t){var n,r,s,i,l,o,a,h,p,u,c,g,f,d,m,k;for(e=e.replace(/^ +$/gm,"");e;)if((s=this.rules.newline.exec(e))&&(e=e.substring(s[0].length),1<s[0].length&&this.tokens.push({type:"space"})),s=this.rules.code.exec(e)){var b=this.tokens[this.tokens.length-1];e=e.substring(s[0].length),b&&"paragraph"===b.type?b.text+="\n"+s[0].trimRight():(s=s[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",codeBlockStyle:"indented",text:this.options.pedantic?s:w(s,"\n")}))}else if(s=this.rules.fences.exec(e))e=e.substring(s[0].length),this.tokens.push({type:"code",lang:s[2]?s[2].trim():s[2],text:s[3]||""});else if(s=this.rules.heading.exec(e))e=e.substring(s[0].length),this.tokens.push({type:"heading",depth:s[1].length,text:s[2]});else if((s=this.rules.nptable.exec(e))&&(o={type:"table",header:y(s[1].replace(/^ *| *\| *$/g,"")),align:s[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:s[3]?s[3].replace(/\n$/,"").split("\n"):[]}).header.length===o.align.length){for(e=e.substring(s[0].length),c=0;c<o.align.length;c++)/^ *-+: *$/.test(o.align[c])?o.align[c]="right":/^ *:-+: *$/.test(o.align[c])?o.align[c]="center":/^ *:-+ *$/.test(o.align[c])?o.align[c]="left":o.align[c]=null;for(c=0;c<o.cells.length;c++)o.cells[c]=y(o.cells[c],o.header.length);this.tokens.push(o)}else if(s=this.rules.hr.exec(e))e=e.substring(s[0].length),this.tokens.push({type:"hr"});else if(s=this.rules.blockquote.exec(e))e=e.substring(s[0].length),this.tokens.push({type:"blockquote_start"}),s=s[0].replace(/^ *> ?/gm,""),this.token(s,t),this.tokens.push({type:"blockquote_end"});else if(s=this.rules.list.exec(e)){for(e=e.substring(s[0].length),a={type:"list_start",ordered:d=1<(i=s[2]).length,start:d?+i:"",loose:!1},this.tokens.push(a),n=!(h=[]),f=(s=s[0].match(this.rules.item)).length,c=0;c<f;c++)u=(o=s[c]).length,~(o=o.replace(/^ *([*+-]|\d+\.) */,"")).indexOf("\n ")&&(u-=o.length,o=this.options.pedantic?o.replace(/^ {1,4}/gm,""):o.replace(new RegExp("^ {1,"+u+"}","gm"),"")),c!==f-1&&(l=x.bullet.exec(s[c+1])[0],(1<i.length?1===l.length:1<l.length||this.options.smartLists&&l!==i)&&(e=s.slice(c+1).join("\n")+e,c=f-1)),r=n||/\n\n(?!\s*$)/.test(o),c!==f-1&&(n="\n"===o.charAt(o.length-1),r||(r=n)),r&&(a.loose=!0),k=void 0,(m=/^\[[ xX]\] /.test(o))&&(k=" "!==o[1],o=o.replace(/^\[[ xX]\] +/,"")),p={type:"list_item_start",task:m,checked:k,loose:r},h.push(p),this.tokens.push(p),this.token(o,!1),this.tokens.push({type:"list_item_end"});if(a.loose)for(f=h.length,c=0;c<f;c++)h[c].loose=!0;this.tokens.push({type:"list_end"})}else if(s=this.rules.html.exec(e))e=e.substring(s[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===s[1]||"script"===s[1]||"style"===s[1]),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(s[0]):_(s[0]):s[0]});else if(t&&(s=this.rules.def.exec(e)))e=e.substring(s[0].length),s[3]&&(s[3]=s[3].substring(1,s[3].length-1)),g=s[1].toLowerCase().replace(/\s+/g," "),this.tokens.links[g]||(this.tokens.links[g]={href:s[2],title:s[3]});else if((s=this.rules.table.exec(e))&&(o={type:"table",header:y(s[1].replace(/^ *| *\| *$/g,"")),align:s[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:s[3]?s[3].replace(/\n$/,"").split("\n"):[]}).header.length===o.align.length){for(e=e.substring(s[0].length),c=0;c<o.align.length;c++)/^ *-+: *$/.test(o.align[c])?o.align[c]="right":/^ *:-+: *$/.test(o.align[c])?o.align[c]="center":/^ *:-+ *$/.test(o.align[c])?o.align[c]="left":o.align[c]=null;for(c=0;c<o.cells.length;c++)o.cells[c]=y(o.cells[c].replace(/^ *\| *| *\| *$/g,""),o.header.length);this.tokens.push(o)}else if(s=this.rules.lheading.exec(e))e=e.substring(s[0].length),this.tokens.push({type:"heading",depth:"="===s[2].charAt(0)?1:2,text:s[1]});else if(t&&(s=this.rules.paragraph.exec(e)))e=e.substring(s[0].length),this.tokens.push({type:"paragraph",text:"\n"===s[1].charAt(s[1].length-1)?s[1].slice(0,-1):s[1]});else if(s=this.rules.text.exec(e))e=e.substring(s[0].length),this.tokens.push({type:"text",text:s[0]});else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0));return this.tokens};var n={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:g,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,strong:/^__([^\s_])__(?!_)|^\*\*([^\s*])\*\*(?!\*)|^__([^\s][\s\S]*?[^\s])__(?!_)|^\*\*([^\s][\s\S]*?[^\s])\*\*(?!\*)/,em:/^_([^\s_])_(?!_)|^\*([^\s*<\[])\*(?!\*)|^_([^\s<][\s\S]*?[^\s_])_(?!_|[^\spunctuation])|^_([^\s_<][\s\S]*?[^\s])_(?!_|[^\spunctuation])|^\*([^\s<"][\s\S]*?[^\s\*])\*(?!\*|[^\spunctuation])|^\*([^\s*"<\[][\s\S]*?[^\s])\*(?!\*)/,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:g,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/};function p(e,t){if(this.options=t||k.defaults,this.links=e,this.rules=n.normal,this.renderer=this.options.renderer||new r,this.renderer.options=this.options,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.pedantic?this.rules=n.pedantic:this.options.gfm&&(this.options.breaks?this.rules=n.breaks:this.rules=n.gfm)}function r(e){this.options=e||k.defaults}function s(){}function h(e){this.tokens=[],this.token=null,this.options=e||k.defaults,this.options.renderer=this.options.renderer||new r,this.renderer=this.options.renderer,this.renderer.options=this.options,this.slugger=new t}function t(){this.seen={}}function _(e,t){if(t){if(_.escapeTest.test(e))return e.replace(_.escapeReplace,function(e){return _.replacements[e]})}else if(_.escapeTestNoEncode.test(e))return e.replace(_.escapeReplaceNoEncode,function(e){return _.replacements[e]});return e}function c(e){return e.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function i(n,e){return n=n.source||n,e=e||"",{replace:function(e,t){return t=(t=t.source||t).replace(/(^|[^\[])\^/g,"$1"),n=n.replace(e,t),this},getRegex:function(){return new RegExp(n,e)}}}function l(e,t,n){if(e){try{var r=decodeURIComponent(c(n)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return null}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return null}t&&!u.test(n)&&(n=function(e,t){o[" "+e]||(/^[^:]+:\/*[^/]*$/.test(e)?o[" "+e]=e+"/":o[" "+e]=w(e,"/",!0));return e=o[" "+e],"//"===t.slice(0,2)?e.replace(/:[\s\S]*/,":")+t:"/"===t.charAt(0)?e.replace(/(:\/*[^/]*)[\s\S]*/,"$1")+t:e+t}(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){return null}return n}n._punctuation="!\"#$%&'()*+,\\-./:;<=>?@\\[^_{|}~",n.em=i(n.em).replace(/punctuation/g,n._punctuation).getRegex(),n._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,n._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,n._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,n.autolink=i(n.autolink).replace("scheme",n._scheme).replace("email",n._email).getRegex(),n._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,n.tag=i(n.tag).replace("comment",x._comment).replace("attribute",n._attribute).getRegex(),n._label=/(?:\[[^\[\]]*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,n._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,n._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,n.link=i(n.link).replace("label",n._label).replace("href",n._href).replace("title",n._title).getRegex(),n.reflink=i(n.reflink).replace("label",n._label).getRegex(),n.normal=f({},n),n.pedantic=f({},n.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/,link:i(/^!?\[(label)\]\((.*?)\)/).replace("label",n._label).getRegex(),reflink:i(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",n._label).getRegex()}),n.gfm=f({},n.normal,{escape:i(n.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?= {2,}\n|[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),n.gfm.url=i(n.gfm.url,"i").replace("email",n.gfm._extended_email).getRegex(),n.breaks=f({},n.gfm,{br:i(n.br).replace("{2,}","*").getRegex(),text:i(n.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()}),p.rules=n,p.output=function(e,t,n){return new p(t,n).output(e)},p.prototype.output=function(e){for(var t,n,r,s,i,l,o="";e;)if(i=this.rules.escape.exec(e))e=e.substring(i[0].length),o+=_(i[1]);else if(i=this.rules.tag.exec(e))!this.inLink&&/^<a /i.test(i[0])?this.inLink=!0:this.inLink&&/^<\/a>/i.test(i[0])&&(this.inLink=!1),!this.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(i[0])?this.inRawBlock=!0:this.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(i[0])&&(this.inRawBlock=!1),e=e.substring(i[0].length),o+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):_(i[0]):i[0];else if(i=this.rules.link.exec(e)){var a=d(i[2],"()");if(-1<a){var h=4+i[1].length+a;i[2]=i[2].substring(0,a),i[0]=i[0].substring(0,h).trim(),i[3]=""}e=e.substring(i[0].length),this.inLink=!0,r=i[2],s=this.options.pedantic?(t=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r))?(r=t[1],t[3]):"":i[3]?i[3].slice(1,-1):"",r=r.trim().replace(/^<([\s\S]*)>$/,"$1"),o+=this.outputLink(i,{href:p.escapes(r),title:p.escapes(s)}),this.inLink=!1}else if((i=this.rules.reflink.exec(e))||(i=this.rules.nolink.exec(e))){if(e=e.substring(i[0].length),t=(i[2]||i[1]).replace(/\s+/g," "),!(t=this.links[t.toLowerCase()])||!t.href){o+=i[0].charAt(0),e=i[0].substring(1)+e;continue}this.inLink=!0,o+=this.outputLink(i,t),this.inLink=!1}else if(i=this.rules.strong.exec(e))e=e.substring(i[0].length),o+=this.renderer.strong(this.output(i[4]||i[3]||i[2]||i[1]));else if(i=this.rules.em.exec(e))e=e.substring(i[0].length),o+=this.renderer.em(this.output(i[6]||i[5]||i[4]||i[3]||i[2]||i[1]));else if(i=this.rules.code.exec(e))e=e.substring(i[0].length),o+=this.renderer.codespan(_(i[2].trim(),!0));else if(i=this.rules.br.exec(e))e=e.substring(i[0].length),o+=this.renderer.br();else if(i=this.rules.del.exec(e))e=e.substring(i[0].length),o+=this.renderer.del(this.output(i[1]));else if(i=this.rules.autolink.exec(e))e=e.substring(i[0].length),r="@"===i[2]?"mailto:"+(n=_(this.mangle(i[1]))):n=_(i[1]),o+=this.renderer.link(r,null,n);else if(this.inLink||!(i=this.rules.url.exec(e))){if(i=this.rules.text.exec(e))e=e.substring(i[0].length),this.inRawBlock?o+=this.renderer.text(this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):_(i[0]):i[0]):o+=this.renderer.text(_(this.smartypants(i[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else{if("@"===i[2])r="mailto:"+(n=_(i[0]));else{for(;l=i[0],i[0]=this.rules._backpedal.exec(i[0])[0],l!==i[0];);n=_(i[0]),r="www."===i[1]?"http://"+n:n}e=e.substring(i[0].length),o+=this.renderer.link(r,null,n)}return o},p.escapes=function(e){return e?e.replace(p.rules._escapes,"$1"):e},p.prototype.outputLink=function(e,t){var n=t.href,r=t.title?_(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,_(e[1]))},p.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},p.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,s=0;s<r;s++)t=e.charCodeAt(s),.5<Math.random()&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},r.prototype.code=function(e,t,n){var r=(t||"").match(/\S*/)[0];if(this.options.highlight){var s=this.options.highlight(e,r);null!=s&&s!==e&&(n=!0,e=s)}return r?'<pre><code class="'+this.options.langPrefix+_(r,!0)+'">'+(n?e:_(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:_(e,!0))+"</code></pre>"},r.prototype.blockquote=function(e){return"<blockquote>\n"+e+"</blockquote>\n"},r.prototype.html=function(e){return e},r.prototype.heading=function(e,t,n,r){return this.options.headerIds?"<h"+t+' id="'+this.options.headerPrefix+r.slug(n)+'">'+e+"</h"+t+">\n":"<h"+t+">"+e+"</h"+t+">\n"},r.prototype.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"},r.prototype.list=function(e,t,n){var r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"},r.prototype.listitem=function(e){return"<li>"+e+"</li>\n"},r.prototype.checkbox=function(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},r.prototype.paragraph=function(e){return"<p>"+e+"</p>\n"},r.prototype.table=function(e,t){return t&&(t="<tbody>"+t+"</tbody>"),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"},r.prototype.tablerow=function(e){return"<tr>\n"+e+"</tr>\n"},r.prototype.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' align="'+t.align+'">':"<"+n+">")+e+"</"+n+">\n"},r.prototype.strong=function(e){return"<strong>"+e+"</strong>"},r.prototype.em=function(e){return"<em>"+e+"</em>"},r.prototype.codespan=function(e){return"<code>"+e+"</code>"},r.prototype.br=function(){return this.options.xhtml?"<br/>":"<br>"},r.prototype.del=function(e){return"<del>"+e+"</del>"},r.prototype.link=function(e,t,n){if(null===(e=l(this.options.sanitize,this.options.baseUrl,e)))return n;var r='<a href="'+_(e)+'"';return t&&(r+=' title="'+t+'"'),r+=">"+n+"</a>"},r.prototype.image=function(e,t,n){if(null===(e=l(this.options.sanitize,this.options.baseUrl,e)))return n;var r='<img src="'+e+'" alt="'+n+'"';return t&&(r+=' title="'+t+'"'),r+=this.options.xhtml?"/>":">"},r.prototype.text=function(e){return e},s.prototype.strong=s.prototype.em=s.prototype.codespan=s.prototype.del=s.prototype.text=function(e){return e},s.prototype.link=s.prototype.image=function(e,t,n){return""+n},s.prototype.br=function(){return""},h.parse=function(e,t){return new h(t).parse(e)},h.prototype.parse=function(e){this.inline=new p(e.links,this.options),this.inlineText=new p(e.links,f({},this.options,{renderer:new s})),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t},h.prototype.next=function(){return this.token=this.tokens.pop(),this.token},h.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},h.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},h.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,c(this.inlineText.output(this.token.text)),this.slugger);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,s="",i="";for(n="",e=0;e<this.token.header.length;e++)n+=this.renderer.tablecell(this.inline.output(this.token.header[e]),{header:!0,align:this.token.align[e]});for(s+=this.renderer.tablerow(n),e=0;e<this.token.cells.length;e++){for(t=this.token.cells[e],n="",r=0;r<t.length;r++)n+=this.renderer.tablecell(this.inline.output(t[r]),{header:!1,align:this.token.align[r]});i+=this.renderer.tablerow(n)}return this.renderer.table(s,i);case"blockquote_start":for(i="";"blockquote_end"!==this.next().type;)i+=this.tok();return this.renderer.blockquote(i);case"list_start":i="";for(var l=this.token.ordered,o=this.token.start;"list_end"!==this.next().type;)i+=this.tok();return this.renderer.list(i,l,o);case"list_item_start":i="";var a=this.token.loose,h=this.token.checked,p=this.token.task;for(this.token.task&&(i+=this.renderer.checkbox(h));"list_item_end"!==this.next().type;)i+=a||"text"!==this.token.type?this.tok():this.parseText();return this.renderer.listitem(i,p,h);case"html":return this.renderer.html(this.token.text);case"paragraph":return this.renderer.paragraph(this.inline.output(this.token.text));case"text":return this.renderer.paragraph(this.parseText());default:var u='Token with "'+this.token.type+'" type was not found.';if(!this.options.silent)throw new Error(u);console.log(u)}},t.prototype.slug=function(e){var t=e.toLowerCase().trim().replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(t))for(var n=t;this.seen[n]++,t=n+"-"+this.seen[n],this.seen.hasOwnProperty(t););return this.seen[t]=0,t},_.escapeTest=/[&<>"']/,_.escapeReplace=/[&<>"']/g,_.replacements={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},_.escapeTestNoEncode=/[<>"']|&(?!#?\w+;)/,_.escapeReplaceNoEncode=/[<>"']|&(?!#?\w+;)/g;var o={},u=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function g(){}function f(e){for(var t,n,r=1;r<arguments.length;r++)for(n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}function y(e,t){var n=e.replace(/\|/g,function(e,t,n){for(var r=!1,s=t;0<=--s&&"\\"===n[s];)r=!r;return r?"|":" |"}).split(/ \|/),r=0;if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,"|");return n}function w(e,t,n){if(0===e.length)return"";for(var r=0;r<e.length;){var s=e.charAt(e.length-r-1);if(s!==t||n){if(s===t||!n)break;r++}else r++}return e.substr(0,e.length-r)}function d(e,t){if(-1===e.indexOf(t[1]))return-1;for(var n=0,r=0;r<e.length;r++)if("\\"===e[r])r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&--n<0)return r;return-1}function m(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function k(e,n,r){if(null==e)throw new Error("marked(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");if(r||"function"==typeof n){r||(r=n,n=null),m(n=f({},k.defaults,n||{}));var s,i,l=n.highlight,t=0;try{s=a.lex(e,n)}catch(e){return r(e)}i=s.length;var o=function(t){if(t)return n.highlight=l,r(t);var e;try{e=h.parse(s,n)}catch(e){t=e}return n.highlight=l,t?r(t):r(null,e)};if(!l||l.length<3)return o();if(delete n.highlight,!i)return o();for(;t<s.length;t++)!function(n){"code"!==n.type?--i||o():l(n.text,n.lang,function(e,t){return e?o(e):null==t||t===n.text?--i||o():(n.text=t,n.escaped=!0,void(--i||o()))})}(s[t])}else try{return n&&(n=f({},k.defaults,n)),m(n),h.parse(a.lex(e,n),n)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",(n||k.defaults).silent)return"<p>An error occurred:</p><pre>"+_(e.message+"",!0)+"</pre>";throw e}}g.exec=g,k.options=k.setOptions=function(e){return f(k.defaults,e),k},k.getDefaults=function(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:new r,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,xhtml:!1}},k.defaults=k.getDefaults(),k.Parser=h,k.parser=h.parse,k.Renderer=r,k.TextRenderer=s,k.Lexer=a,k.lexer=a.lex,k.InlineLexer=p,k.inlineLexer=p.output,k.Slugger=t,k.parse=k,"undefined"!=typeof module&&"object"==typeof exports?module.exports=k:"function"==typeof define&&define.amd?define(function(){return k}):e.marked=k}(this||("undefined"!=typeof window?window:global));
+0
-1
$mmm/plugins/markdown/scripts: text$html+frag.html less more
0 <script type="text/javascript" src="//unpkg.com/marked@0.7.0/marked.min.js"></script>
0 local tourl
1 tourl = (require('mmm.mmmfs.util'))({ }).tourl
2 return function(self)
3 return "\n <script type=\"text/javascript\" src=\"" .. tostring(self:gett('marked: URL -> text/javascript')) .. "\"></script>"
4 end
0 import tourl from (require 'mmm.mmmfs.util') {}
1
2 =>
3 "
4 <script type=\"text/javascript\" src=\"#{@gett 'marked: URL -> text/javascript'}\"></script>"
29152915 assert(fileder.root, \"'\" .. tostring(fileder) .. \"' has no root!\")\
29162916 return coroutine.wrap(function()\
29172917 for ancestor in yield_ancestors(fileder.root, max_path) do\
2918 if guard_self and ancestor.path == max_path then\
2918 local _continue_0 = false\
2919 repeat\
2920 if guard_self and ancestor.path == max_path then\
2921 break\
2922 end\
2923 if ancestor == fileder then\
2924 _continue_0 = true\
2925 break\
2926 end\
2927 do\
2928 local result = ancestor:walk(path)\
2929 if result then\
2930 coroutine.yield(result)\
2931 end\
2932 end\
2933 _continue_0 = true\
2934 until true\
2935 if not _continue_0 then\
29192936 break\
2920 end\
2921 do\
2922 local result = ancestor:walk(path)\
2923 if result then\
2924 coroutine.yield(result)\
2925 end\
29262937 end\
29272938 end\
29282939 do\
29742985 end\
29752986 end\
29762987 local tourl\
2977 tourl = function(path, _view)\
2988 tourl = function(path, facet)\
29782989 path = path .. '/'\
29792990 if STATIC and STATIC.root then\
29802991 path = STATIC.root .. path\
29812992 end\
2982 if _view then\
2983 path = path .. _view\
2993 if facet then\
2994 path = path .. facet\
29842995 end\
29852996 return path\
29862997 end\
30253036 return a(name, opts)\
30263037 end\
30273038 local link_to\
3028 link_to = function(fileder, name, origin, attr, _view)\
3039 link_to = function(fileder, name, origin, attr, facet)\
30293040 fileder = find_fileder(fileder, origin)\
30303041 name = name or fileder:get('title: mmm/dom')\
30313042 name = name or fileder:gett('name: alpha')\
30383049 }))\
30393050 else\
30403051 return a(name, merge(attr, {\
3041 href = tourl(fileder.path, _view),\
3052 href = tourl(fileder.path, facet),\
30423053 onclick = (function()\
30433054 if MODE == 'CLIENT' then\
30443055 return function(self, e)\
30663077 })\
30673078 end\
30683079 local embed\
3069 embed = function(fileder, name, origin, opts)\
3070 if name == nil then\
3071 name = ''\
3080 embed = function(fileder, facet, origin, opts)\
3081 if facet == nil then\
3082 facet = ''\
30723083 end\
30733084 if opts == nil then\
30743085 opts = { }\
30803091 end\
30813092 opts.wrap = opts.wrap or 'well'\
30823093 fileder = find_fileder(fileder, origin)\
3083 local ok, node = pcall(fileder.gett, fileder, name, 'mmm/dom')\
3094 local ok, node = pcall(fileder.gett, fileder, facet, 'mmm/dom')\
30843095 if not ok then\
3085 warn(\"couldn't embed \" .. tostring(fileder) .. \" \" .. tostring(name) .. \": \" .. tostring(node))\
3096 warn(\"couldn't embed \" .. tostring(fileder) .. \" \" .. tostring(facet) .. \": \" .. tostring(node))\
30863097 return span({\
30873098 class = 'embed',\
30883099 style = {\
30893100 background = 'var(--gray-fail)',\
30903101 padding = '1em'\
30913102 },\
3092 \"couldn't embed \" .. tostring(fileder) .. \" \" .. tostring(name),\
3103 \"couldn't embed \" .. tostring(fileder) .. \" \" .. tostring(facet),\
30933104 (pre(node))\
30943105 })\
30953106 end\
31193130 if opts.nolink then\
31203131 return node\
31213132 else\
3122 return link_to(fileder, node, nil, opts.attr)\
3133 return link_to(fileder, node, nil, opts.attr, facet)\
31233134 end\
31243135 elseif 'sidenote' == _exp_0 then\
31253136 local key = tostring(refs:get())\