mirror of
https://github.com/foo-dogsquared/asciidoctor-foodogsquared-extensions.git
synced 2025-01-30 22:57:56 +00:00
Update the default text for manpages link
This commit is contained in:
parent
924fd9eac5
commit
928cd80561
@ -9,8 +9,10 @@ class ManInlineMacro < Asciidoctor::Extensions::InlineMacroProcessor
|
|||||||
|
|
||||||
def process(parent, target, attrs)
|
def process(parent, target, attrs)
|
||||||
doc = parent.document
|
doc = parent.document
|
||||||
text = manname = target
|
manname = target
|
||||||
suffix = (volnum = attrs['volnum']) ? %((#{volnum})) : ''
|
volnum = attrs['volnum']
|
||||||
|
|
||||||
|
text = %(#{manname}(#{volnum}))
|
||||||
|
|
||||||
if doc.basebackend? 'html'
|
if doc.basebackend? 'html'
|
||||||
domain = case attrs['service']
|
domain = case attrs['service']
|
||||||
@ -35,13 +37,14 @@ class ManInlineMacro < Asciidoctor::Extensions::InlineMacroProcessor
|
|||||||
doc.register :links, target
|
doc.register :links, target
|
||||||
node = create_anchor parent, text, type: :link, target: target
|
node = create_anchor parent, text, type: :link, target: target
|
||||||
else
|
else
|
||||||
node = create_inline parent, :quoted, manname
|
node = create_inline parent, :quoted, text
|
||||||
end
|
end
|
||||||
elsif doc.backend == 'manpage'
|
elsif doc.backend == 'manpage'
|
||||||
node = create_inline parent, :quoted, manname, type: :strong
|
node = create_inline parent, :quoted, text, type: :strong
|
||||||
else
|
else
|
||||||
node = create_inline parent, :quoted, manname
|
node = create_inline parent, :quoted, text
|
||||||
end
|
end
|
||||||
create_inline parent, :quoted, %(#{node.convert}#{suffix})
|
|
||||||
|
node
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user