31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
...
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
|
id = 'toc';
desc = 'provides a table of contents for HTML renderer plus generic fallback';
version = ss.version {0,1; 'devel'};
contributors = {{name='lexi hale', handle='velartrill', mail='lexi@hale.su', homepage='https://hale.su'}};
default = true; -- on unless inhibited
hook = {
doc_init = function(job)
print('initing doc:toc',job.doc)
job.state.toc_custom_position = false
end;
render_html_init = function(job, render)
render.stylesets.toc = css_toc
render.stylesets.tocFixed = css_toc_fixed
end;
................................................................................
attrs = {href = '#' .. l.id};
nodes = {sr.htmlSpan(l.label, l.block, sec)};
}
table.insert(n.nodes, {tag = 'li', attrs = {}, nodes={nn}})
end
table.insert(ent.nodes, n)
end
print(ss.dump(ent))
end
end
return lst
end;
[true] = function() end; -- fallback // convert to different node types
};
};
}
|
|
31
32
33
34
35
36
37
38
39
40
41
42
43
44
...
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
|
id = 'toc';
desc = 'provides a table of contents for HTML renderer plus generic fallback';
version = ss.version {0,1; 'devel'};
contributors = {{name='lexi hale', handle='velartrill', mail='lexi@hale.su', homepage='https://hale.su'}};
default = true; -- on unless inhibited
hook = {
doc_init = function(job)
job.state.toc_custom_position = false
end;
render_html_init = function(job, render)
render.stylesets.toc = css_toc
render.stylesets.tocFixed = css_toc_fixed
end;
................................................................................
attrs = {href = '#' .. l.id};
nodes = {sr.htmlSpan(l.label, l.block, sec)};
}
table.insert(n.nodes, {tag = 'li', attrs = {}, nodes={nn}})
end
table.insert(ent.nodes, n)
end
end
end
return lst
end;
[true] = function() end; -- fallback // convert to different node types
};
};
}
|