aboutsummaryrefslogtreecommitdiff
path: root/scripts/update_doc
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2010-11-30 19:55:39 -0500
committermitchell <70453897+667e-11@users.noreply.github.com>2010-11-30 19:55:39 -0500
commitc7b543e79b41d9a983cc89e264acd0472d09dc92 (patch)
tree9b28b836f65b396ea160ba91048fb030018ccdcc /scripts/update_doc
parent6c1afd75fc048e65cef5bfdbe68c79a082bdad43 (diff)
downloadtextadept-c7b543e79b41d9a983cc89e264acd0472d09dc92.tar.gz
textadept-c7b543e79b41d9a983cc89e264acd0472d09dc92.zip
New manual.
Diffstat (limited to 'scripts/update_doc')
-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')