summaryrefslogtreecommitdiffstats
path: root/static/mmm/text$lua.lua
diff options
context:
space:
mode:
authors-ol <s+removethis@s-ol.nu>2022-09-02 23:18:45 +0000
committers-ol <s+removethis@s-ol.nu>2022-09-03 01:17:10 +0000
commit77622f2762fd087d5cb53a92f7c3bc0c93b00cd0 (patch)
tree0225269aa2fe28ed2e9d6b7eb74e39d8e7809dbe /static/mmm/text$lua.lua
parentlink to fkcaps for vendor info (diff)
downloadhw.s-ol.nu-77622f2762fd087d5cb53a92f7c3bc0c93b00cd0.tar.gz
hw.s-ol.nu-77622f2762fd087d5cb53a92f7c3bc0c93b00cd0.zip
update mmm plugins & client code
Diffstat (limited to 'static/mmm/text$lua.lua')
-rw-r--r--static/mmm/text$lua.lua49
1 files changed, 30 insertions, 19 deletions
diff --git a/static/mmm/text$lua.lua b/static/mmm/text$lua.lua
index 6192113..ef1829d 100644
--- a/static/mmm/text$lua.lua
+++ b/static/mmm/text$lua.lua
@@ -2916,14 +2916,25 @@ get_meta = function(fileder, path)\
assert(fileder.root, \"'\" .. tostring(fileder) .. \"' has no root!\")\
return coroutine.wrap(function()\
for ancestor in yield_ancestors(fileder.root, max_path) do\
- if guard_self and ancestor.path == max_path then\
- break\
- end\
- do\
- local result = ancestor:walk(path)\
- if result then\
- coroutine.yield(result)\
+ local _continue_0 = false\
+ repeat\
+ if guard_self and ancestor.path == max_path then\
+ break\
+ end\
+ if ancestor == fileder then\
+ _continue_0 = true\
+ break\
+ end\
+ do\
+ local result = ancestor:walk(path)\
+ if result then\
+ coroutine.yield(result)\
+ end\
end\
+ _continue_0 = true\
+ until true\
+ if not _continue_0 then\
+ break\
end\
end\
do\
@@ -2975,13 +2986,13 @@ merge = function(orig, extra)\
end\
end\
local tourl\
-tourl = function(path, _view)\
+tourl = function(path, facet)\
path = path .. '/'\
if STATIC and STATIC.root then\
path = STATIC.root .. path\
end\
- if _view then\
- path = path .. _view\
+ if facet then\
+ path = path .. facet\
end\
return path\
end\
@@ -3026,7 +3037,7 @@ return function(elements)\
return a(name, opts)\
end\
local link_to\
- link_to = function(fileder, name, origin, attr, _view)\
+ link_to = function(fileder, name, origin, attr, facet)\
fileder = find_fileder(fileder, origin)\
name = name or fileder:get('title: mmm/dom')\
name = name or fileder:gett('name: alpha')\
@@ -3039,7 +3050,7 @@ return function(elements)\
}))\
else\
return a(name, merge(attr, {\
- href = tourl(fileder.path, _view),\
+ href = tourl(fileder.path, facet),\
onclick = (function()\
if MODE == 'CLIENT' then\
return function(self, e)\
@@ -3067,9 +3078,9 @@ return function(elements)\
})\
end\
local embed\
- embed = function(fileder, name, origin, opts)\
- if name == nil then\
- name = ''\
+ embed = function(fileder, facet, origin, opts)\
+ if facet == nil then\
+ facet = ''\
end\
if opts == nil then\
opts = { }\
@@ -3081,16 +3092,16 @@ return function(elements)\
end\
opts.wrap = opts.wrap or 'well'\
fileder = find_fileder(fileder, origin)\
- local ok, node = pcall(fileder.gett, fileder, name, 'mmm/dom')\
+ local ok, node = pcall(fileder.gett, fileder, facet, 'mmm/dom')\
if not ok then\
- warn(\"couldn't embed \" .. tostring(fileder) .. \" \" .. tostring(name) .. \": \" .. tostring(node))\
+ warn(\"couldn't embed \" .. tostring(fileder) .. \" \" .. tostring(facet) .. \": \" .. tostring(node))\
return span({\
class = 'embed',\
style = {\
background = 'var(--gray-fail)',\
padding = '1em'\
},\
- \"couldn't embed \" .. tostring(fileder) .. \" \" .. tostring(name),\
+ \"couldn't embed \" .. tostring(fileder) .. \" \" .. tostring(facet),\
(pre(node))\
})\
end\
@@ -3120,7 +3131,7 @@ return function(elements)\
if opts.nolink then\
return node\
else\
- return link_to(fileder, node, nil, opts.attr)\
+ return link_to(fileder, node, nil, opts.attr, facet)\
end\
elseif 'sidenote' == _exp_0 then\
local key = tostring(refs:get())\