From: Michalis K. <mic...@gm...> - 2016-09-15 03:09:21
|
2016-09-15 4:13 GMT+02:00 silvioprog <sil...@gm...>: > > Done: https://github.com/michaliskambi/pasdoc/pull/2 . > > Thank you very much! > Thank you for contributing -- perfect, applied! I added a simple documentation to http://pasdoc.sipsolutions.net/IncludeCodeTag . Adding the sLineBreak (and later removing the last sLineBreak) is not necessary, so I removed it in a later commit. That is because you are "outside" the FormatPascalCode contents, so you're only adding a newline to the generated HTML, LaTeX, XML or such. In case of HTML, it will be simply ignored. Two files specified for the @includeCode will give this HTML output: -------- <pre class="longcode"><span class="pascal_keyword">begin</span> Writeln(<span class="pascal_string">'aaa'</span>); <span class="pascal_keyword">end</span>. </pre> <p></p> <pre class="longcode"><span class="pascal_keyword">begin</span> Writeln(<span class="pascal_string">'aaa'</span>); <span class="pascal_keyword">end</span>. </pre> -------- Your sLineBreak was only adding a newline inside the <p></p>, so it does not affect the actual look of the document:) To reliably add a newline in PasDoc_Gen, you should use a virtual function like LineBreak that makes correct output depending on generator ('<br>' in HTML and so on). Although in this case, the default paragraph separator works Ok. If needed, you could introduce a virtual function like HorizontalSeparator to TDocGenerator, and override it in HTML to return '<hr>', and then use it in HandleIncludeCodeTag to visually separate the examples by a horizontal line. I'm note sure what looks best here, I leave this decision up to you:) Regards, Michalis |