[Lazarus] fpdoc + XML description file + indentation whitespace

Michael Van Canneyt michael at freepascal.org
Thu Feb 9 09:12:56 CET 2012



On Wed, 8 Feb 2012, Mattias Gaertner wrote:

> On Wed, 8 Feb 2012 23:03:26 +0200
> Graeme Geldenhuys <graemeg.lists at gmail.com> wrote:
>
>> Hi Mattias,
>>
>> Here is the email I spoke of.. Note that the URL example I listed, is
>> still affected by the problem as well. The first line with "naAdd" is
>> correct. All the other "naXXX" line are indented incorrectly due to
>> the indentation inserted by FPDoc Editor (or by a human).
>
> Thanks.
> As already mentioned: The xml reader/writer needs to be improved to
> preserve spacing.
>
>
>> And as I mentioned, with RTF, IPF, TXT, MAN etc output the problem is
>> greatly enhanced, because the end result viewers of these formats do
>> not ignore whitespace.
>>
>> So bottom line... Indentation in XML is evil. ;-) XML is meant to be
>> processed by a computer program, not by a human, so indentation really
>> shouldn't be needed at all.
>
> No. XML is a markup language for texts. You are free to apply
> some style for readability, just like many programming languages
> (including pascal).
> According to the XML recommendation: "white space is typically not
> intended for inclusion in the delivered version of the document".
> Many xml viewers and editors use auto indentation to increase
> readability.
>
> XML is "eXtensible" and that's why fpdoc must define what
> space is treated strict and what not. Many xml formats have
> special elements for preformatted space e.g. "pre". The XML specs
> recommends the Attribute xml:space="preserve".
>
> Maybe Michael knows what space should be preserved and what is free
> to change.

Normally, only <code> and <pre> tags need to preserve space.

For the man and .txt formats, it's the writer that should fix whitespace issues.

Michael.




More information about the Lazarus mailing list