aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/update_doc8
1 files changed, 7 insertions, 1 deletions
diff --git a/scripts/update_doc b/scripts/update_doc
index 8f9ee6c0..b2fcfbdf 100755
--- a/scripts/update_doc
+++ b/scripts/update_doc
@@ -105,7 +105,13 @@ for mdfile in p:lines() do
html = html:gsub('%%sidebar%%', sidebar_md:read('*all'))
sidebar_md:close()
local content_md = io.popen('../doc/Markdown.pl '..mdfile)
- html = html:gsub('%%content%%', content_md:read('*all'))
+ local md = content_md:read('*all'):gsub('%%', '%%%%')
+ md = md:gsub('(<h%d>)([^<]+)(</h%d>)',
+ function(s, text, e)
+ return string.format('%s<a name="%s"></a>%s%s', s,
+ text:gsub(' ', '_'):lower(), text, e)
+ end)
+ html = html:gsub('%%content%%', md)
content_md:close()
local f = io.open(htmlfile, 'w')