nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e08183b
)
src/doc_down: save headlines from InlineDecorator
author
Alexandre Terrasa
<alexandre@moz-code.org>
Fri, 1 Jun 2018 16:04:32 +0000
(12:04 -0400)
committer
Alexandre Terrasa
<alexandre@moz-code.org>
Sun, 10 Jun 2018 17:25:06 +0000
(13:25 -0400)
So it can be used to generate Markdown summaries
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
src/doc/doc_down.nit
patch
|
blob
|
history
diff --git
a/src/doc/doc_down.nit
b/src/doc/doc_down.nit
index
7bb330b
..
f02b1fd
100644
(file)
--- a/
src/doc/doc_down.nit
+++ b/
src/doc/doc_down.nit
@@
-204,6
+204,14
@@
private class InlineDecorator
end
redef fun add_headline(v, block) do
+ # save headline
+ var line = block.block.first_line
+ if line == null then return
+ var txt = line.value
+ var id = strip_id(txt)
+ var lvl = block.depth
+ headlines[id] = new HeadLine(id, txt, lvl)
+
v.emit_in block
end