Update man page lua filter to use text module.
This commit is contained in:
parent
38ab2eeb9e
commit
17f6621b21
2 changed files with 10 additions and 4 deletions
|
@ -344,11 +344,14 @@ inside headers), removes footnotes, and replaces links
|
|||
with regular text.
|
||||
|
||||
``` lua
|
||||
-- we use preloaded text to get a UTF-8 aware 'upper' function
|
||||
local text = require('text')
|
||||
|
||||
function Header(el)
|
||||
if el.level == 1 then
|
||||
return pandoc.walk_block(el, {
|
||||
Str = function(el)
|
||||
return pandoc.Str(el.text:upper())
|
||||
return pandoc.Str(text.upper(el.text))
|
||||
end })
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,19 +1,22 @@
|
|||
-- filters to create the pandoc man page from MANUAL.txt
|
||||
-- we use preloaded text to get a UTF-8 aware 'upper' function
|
||||
local text = require('text')
|
||||
|
||||
-- capitalize headers
|
||||
-- capitalize level 1 headers
|
||||
function Header(el)
|
||||
if el.level == 1 then
|
||||
return pandoc.walk_block(el, {
|
||||
Str = function(el)
|
||||
return pandoc.Str(el.text:upper())
|
||||
return pandoc.Str(text.upper(el.text))
|
||||
end })
|
||||
end
|
||||
end
|
||||
|
||||
-- replace links with link text
|
||||
function Link(el)
|
||||
return el.content
|
||||
end
|
||||
|
||||
-- remove notes
|
||||
function Note(el)
|
||||
return {}
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue