function mgtmdocbook::_preTag, type, newline=newline, tag=tag
compile_opt strictarr
case type of
'': return, ''
'bold': return, '<bold>'
'bullet_list': return, '<ul>'
'code': return, '<code>'
'comments': return, '<span class="comments">'
'emphasis': return, '<emphasis>'
'image': begin
src = tag->getAttribute('source')
location = tag->getAttribute('location')
extpos = strpos(src, '.', /reverse_search) + 1L
ext = strmid(src, extpos)
return, '<inlinemediaobject><imageobject>' $
+ '<imagedata scale="75" fileref="' + location + src + '" format="' + ext + '"/>' $
+ '</imageobject></inlinemediaobject>'
end
'embed': begin
src = tag->getAttribute('source')
location = tag->getAttribute('location')
extpos = strpos(src, '.', /reverse_search) + 1L
ext = strmid(src, extpos)
return, '<inlinemediaobject><imageobject>' $
+ '<imagedata scale="75" fileref="' + location + src + '" format="' + ext + '"/>' $
+ '</imageobject></inlinemediaobject>'
end
'link': begin
href = tag->getAttribute('reference')
return, '<a href="' + href + '">'
end
'listing': return, '<programlisting>'
'list_item': return, '<listitem>'
'newline': begin
newline = 1
return, ''
end
'numbered_list': return, '<orderedlist>'
'paragraph': return, '<para>'
'preformatted': return, '<para>'
else : return, ''
endcase
end
function mgtmdocbook::_postTag, type, newline=newline, tag=tag
compile_opt strictarr
case type of
'': return, ''
'bold': return, '</bold>'
'bullet_list': return, '</ul>'
'code': return, '</code>'
'comments': return, '</span>'
'emphasis': return, '</emphasis>'
'image': return, ''
'embed': return, ''
'link': return, '</a>'
'listing': return, '</programlisting>'
'list_item': return, '</listitem>'
'newline': return, ''
'numbered_list': return, '</orderedlist>'
'paragraph': begin
newline = 1
return, '</para>'
end
'preformatted': begin
newline = 1
return, '</para>'
end
else: return, ''
endcase
end
pro mgtmdocbook__define
compile_opt strictarr
define = { mgtmdocbook, inherits mgtmlanguage }
end