git.s-ol.nu mmm / 3c79e69
fix embed in static rendered markdown s-ol 2 years ago
2 changed file(s) with 5 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
99 path .. '/'
1010
1111 (elements) ->
12 import a, div, pre from elements
12 import a, div, span, pre from elements
1313
1414 find_fileder = (fileder, origin) ->
1515 if 'string' == type fileder
5252 ok, node = pcall fileder.gett, fileder, name, 'mmm/dom'
5353
5454 if not ok
55 return div "couldn't embed #{fileder} #{name}",
55 return span "couldn't embed #{fileder} #{name}",
5656 (pre node),
57 class: 'embed'
5758 style: {
5859 background: 'var(--gray-fail)',
5960 padding: '1em',
6364 klass ..= ' desc' if opts.desc
6465 klass ..= ' inline' if opts.inline
6566
66 node = div {
67 node = span {
6768 class: klass
6869 node
6970 if opts.desc
2626 }
2727
2828 .embed {
29 display: block;
2930 width: inherit;
3031 height: inherit;
3132 max-width: inherit;