Changeset View
Changeset View
Standalone View
Standalone View
shared/lib/InterDocumentReferencesMacro/extension.rb
Context not available. | |||||
destination = target | destination = target | ||||
anchor = attrs[1] | anchor = attrs[1] | ||||
text = attrs[2] | text = attrs[2] | ||||
doc = parent.document | doc = parent.document | ||||
if doc.attributes['book'] == 'True' | if doc.attributes['book'] == 'True' | ||||
if doc.attributes['isonline'] == 1 | |||||
(create_anchor parent, text, type: :link, target: %(./##{anchor})).render | (create_anchor parent, text, type: :link, target: %(./##{anchor})).render | ||||
else | |||||
(create_anchor parent, text, type: :link, target: %(./index.html##{anchor})).render | |||||
end | |||||
else | else | ||||
if doc.attributes['isonline'] == 1 | |||||
(create_anchor parent, text, type: :link, target: %(../#{destination}/##{anchor})).render | (create_anchor parent, text, type: :link, target: %(../#{destination}/##{anchor})).render | ||||
else | |||||
(create_anchor parent, text, type: :link, target: %(../#{destination}/index.html##{anchor})).render | |||||
end | |||||
end | end | ||||
end | end | ||||
Context not available. |