Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2012-01

Problems with fpdoc

15 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Unknown author

Hi,

I seem to have some problems using fpdoc in combination with html tags. When I enter some text (taken from the documentation) I get compilation errors:

Text used:

With Strings do
 For i:=Count-1
downto 0 do
 Delete(i);

Compilation errors:
[] Invalid description
(illegal XML element: "#text")
[] Invalid paragraph content
[] Invalid
description (illegal XML element: "#text")

If I drop the tags, I
still get compilation errors (just not the 2nd one) but to my surprise the pascal code is shown in the .chm file. However any text after this code section is ignored. So my question is, how am I supposed to use html tags inside the documentation? Is there a special switch needed?

I'm using: 2.7.1 [2011/12/27] for i386

On a side note, I would like
to include images in my documentation. How to do this? Is simply putting a tag enough and will these links be embedded in the chm file?

Regards, Darius

Reply by email

Unknown author
to Unknown author
Show quoted text 27 lines
Hi, I seem to have some problems using fpdoc in combination with html tags. When I enter some text (taken from the documentation) I get compilation errors: Text used: With Strings do For i:=Count-1 downto 0 do Delete(i); Compilation errors: [] Invalid description (illegal XML element: "#text") [] Invalid paragraph content [] Invalid description (illegal XML element: "#text") If I drop the tags, I still get compilation errors (just not the 2nd one) but to my surprise the pascal code is shown in the .chm file. However any text after this code section is ignored. So my question is, how am I supposed to use html tags inside the documentation? Is there a special switch needed?

Can you post the actual XML you used in a separate mail ?

Because the above is useless, I just see plain text.

Show quoted text 5 lines
I'm using: 2.7.1 [2011/12/27] for i386 On a side note, I would like to include images in my documentation. How to do this? Is simply putting a tag enough and will these links be embedded in the chm file?

Yes, an 'img' tag exists. This is documented. It does NOT use the HTML syntax, though.

Michael.

Reply by email

Unknown author
to Unknown author

Here's the xml file. See attached. The problem code is around line 235.

As for the img tag, thanks for that, i'll start using it.

Regards, Darius

[1] wrote
> Hi, I seem

to have some problems using fpdoc in combination with html tags. When I enter some text (taken from the documentation) I get compilation errors: Text used: With Strings do For i:=Count-1 downto 0 do Delete(i); Compilation errors: [] Invalid description (illegal XML element: "#text") [] Invalid paragraph content [] Invalid description (illegal XML element: "#text") If I drop the tags, I still get compilation errors (just not the 2nd one) but to my surprise the pascal code is shown in the .chm file. However any text after this code section is ignored. So my question is, how am I supposed to use html tags inside the documentation? Is there a special switch needed?

Can you post the

actual XML you used in a separate mail ?

Because the above is

useless, I just see plain text.

> I'm using: 2.7.1 [2011/12/27] for

i386 On a side note, I would like to include images in my documentation. How to do this? Is simply putting a tag enough and will these links be embedded in the chm file?

Yes, an 'img' tag exists. This is

documented. It does NOT use the HTML

syntax, though. Michael.

Reply by email

Unknown author
to Unknown author
Show quoted text 5 lines
Here's the xml file. See attached. The problem code is around line 235.
<p><code>With Strings do
   For i:=Count-1 downto 0 do
     Delete(i);
</code></p>

Is wrong. the <code> tag must be at the same level as a <p> tag, and cannot appear in a <p> tag.

It should be

<p> some text</p>
<code>
With Strings do

   For i:=Count-1 downto 0 do
     Delete(i);

</code>
<p> more text </p>

Michael.

Show quoted text 56 lines
As for the img tag, thanks for that, i'll start using it. Regards, Darius On 2 jan '12, wrote: > On Mon, 2 Jan 2012, [1]wrote: > >> Hi, I seem to have some problems using fpdoc in combination with html tags. When I enter some text (taken from the documentation) I get compilation errors: Text used: With Strings do For i:=Count-1 downto 0 do Delete(i); Compilation errors: [] Invalid description (illegal XML element: "#text") [] Invalid paragraph content [] Invalid description (illegal XML element: "#text") If I drop the tags, I still get compilation errors (just not the 2nd one) but to my surprise the pascal code is shown in the .chm file. However any text after this code section is ignored. So my question is, how am I supposed to use html tags inside the documentation? Is there a special switch needed? > > Can you post the actual XML you used in a separate mail ? > > Because the above is useless, I just see plain text. > >> I'm using: 2.7.1 [2011/12/27] for i386 On a side note, I would like to include images in my documentation. How to do this? Is simply putting a tag enough and will these links be embedded in the chm file? > > Yes, an 'img' tag exists. This is documented. It does NOT use the HTML > syntax, though. > > Michael. > _______________________________________________ > fpc-pascal maillist - [2] > http://lists.freepascal.org/mailman/listinfo/fpc-pascal [3] Links: ------ [1] [2] [3] http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email

Unknown author
to Unknown author

Thanks for the help. After also re-reading the documentation I now better understand how to use fpdoc. No more error messages anymore....

However, including an image in the documentation does not work unfortunately. After generating the chm file the image is not shown and an alternative text is displayed.

At line 244 of this file:
http://lazarus-ccr.svn.sourceforge.net/viewvc/lazarus-ccr/components/nvidia-widgets/doc/nvwidgets.xml?revision=2215&view=markup [8]

you can see the syntax. The image (nvwidgets.png) is located in the same directory as the .xml file is and from where the chm file is generated from.

All relevant files and scripts are in SVN.

Regards,
Darius

On Mon, 2
[5] wrote
> Here's the xml file.

See attached. The problem code is around line 235.

With Strings do
For i:=Count-1 downto 0 do Delete(i);
Is wrong. the tag must be at

the same level as a

tag, and cannot appear in a tag. It

should be

some text With Strings do For i:=Count-1 downto 0
do Delete(i);
Show quoted text 6 lines
more text Michael. > As for the img tag,

thanks for that, i'll start using it. Regards, Darius On 2 jan '12,

[2][1] wrote
> >>> Hi, I seem > to have

some problems using fpdoc in combination with html tags. When I enter some text (taken from the documentation) I get compilation errors: Text used: With Strings do For i:=Count-1 downto 0 do Delete(i); Compilation errors: [] Invalid description (illegal XML element: "#text") [] Invalid paragraph content [] Invalid description (illegal XML element: "#text") If I drop the tags, I still get compilation errors (just not the 2nd one) but to my surprise the pascal code is shown in the .chm file. However any text after this code section is ignored. So my question is, how am I supposed to use html tags inside the documentation? Is there a special switch needed?

> >> Can you post the > actual XML you used

in a separate mail ? Because the above is useless, I just see plain text. I'm using: 2.7.1 [2011/12/27] for i386 On a side note, I would like to include image

> >> chm file? Yes, an 'img' tag exists. This

is

> umented. It does NOT use the HTML syntax, though. Michael.

Reply by email

Unknown author
to Unknown author
Show quoted text 19 lines
Thanks for the help. After also re-reading the documentation I now better understand how to use fpdoc. No more error messages anymore.... However, including an image in the documentation does not work unfortunately. After generating the chm file the image is not shown and an alternative text is displayed. At line 244 of this file: http://lazarus-ccr.svn.sourceforge.net/viewvc/lazarus-ccr/components/nvidia-widgets/doc/nvwidgets.xml?revision=2215&view=markup [8] you can see the syntax. The image (nvwidgets.png) is located in the same directory as the .xml file is and from where the chm file is generated from. All relevant files and scripts are in SVN.

CHM ? This is for Marco.

Michael.

Reply by email

Marco van de Voort
to Unknown author

In our previous episode, said:

Show quoted text 6 lines
> the same directory as the .xml file is and from where the chm file is > generated from. > > All relevant files and scripts are in SVN. CHM ? This is for Marco.

I don't think it differs from html. Some questions that come to mind:

Upon reading, my first guess would be that either that specification how paths are transformed is murky (and it just "happens" to work with latex), or some transformation is missing in this specific case.

Do we have pictures in fpdoc docs somewhere? (and then I don't mean pictures generated by tex4ht, I mean own pictures). IIRC Lazarus lcl has some in the grids descriptions.

What does the path of the img mean (source or destination path?)

Reply by email

Darius Blaszyk
to Marco van de Voort
Marco van de Voort wrote 17 lines
In our previous episode, said: >> the same directory as the .xml file is and from where the chm file is >> generated from. >> >> All relevant files and scripts are in SVN. > > CHM ? This is for Marco. I don't think it differs from html. Some questions that come to mind: Upon reading, my first guess would be that either that specification how paths are transformed is murky (and it just "happens" to work with latex), or some transformation is missing in this specific case. Do we have pictures in fpdoc docs somewhere? (and then I don't mean pictures generated by tex4ht, I mean own pictures). IIRC Lazarus lcl has some in the grids descriptions.

never been used before afaict

find . | xargs grep img
./fcl/.svn/all-wcprops:fpimgcmn.xml
./fcl/.svn/all-wcprops:/svn/lazarus/!svn/ver/23716/trunk/docs/xml/fcl/fpimgcmn.xml ./fcl/.svn/all-wcprops:fpimgcanv.xml
./fcl/.svn/all-wcprops:/svn/lazarus/!svn/ver/23716/trunk/docs/xml/fcl/fpimgcanv.xml ./fcl/.svn/entries:fpimgcmn.xml
./fcl/.svn/entries:fpimgcanv.xml
./fcl/.svn/text-base/fpimage.xml.svn-base: <var>DefaultImageClass</var> - Image Class to create when no img is given for reading</short> ./fcl/.svn/text-base/fpwritebmp.xml.svn-base: <element name="TFPWriterBMP.Pack4bpp.img"> ./fcl/.svn/text-base/fpwritebmp.xml.svn-base: <element name="TFPWriterBMP.Pack1bpp.img"> ./fcl/fpimage.xml: <var>DefaultImageClass</var> - Image Class to create when no img is given for reading</short> ./fcl/fpwritebmp.xml: <element name="TFPWriterBMP.Pack4bpp.img"> ./fcl/fpwritebmp.xml: <element name="TFPWriterBMP.Pack1bpp.img"> ./lcl/.svn/all-wcprops:imglist.xml
./lcl/.svn/all-wcprops:/svn/lazarus/!svn/ver/33617/trunk/docs/xml/lcl/imglist.xml ./lcl/.svn/entries:imglist.xml
./lcl/.svn/text-base/popupnotifier.xml.svn-base:<element name="TNotifierForm.imgIcon"> ./lcl/interfaces/gtk/.svn/all-wcprops:gtkwsimglist.xml ./lcl/interfaces/gtk/.svn/all-wcprops:/svn/lazarus/!svn/ver/7699/trunk/docs/xml/lcl/interfaces/gtk/gtkwsimglist.xml ./lcl/interfaces/gtk/.svn/entries:gtkwsimglist.xml ./lcl/popupnotifier.xml:<element name="TNotifierForm.imgIcon">

What does the path of the img mean (source or destination path?)

No idea. However if I use: <img file="nvwidgets.png" caption="nvidia-widgets class chart"/> in the XML file, then the HTML docs generated expect the file to be in ./images/. I would at least expect fpdoc to create the folder and copy the file from the original location. Moving the file to ./images and then generating the chm file also didn't work. On windows the expected location of the image seems to be: (this is the message after I have moved the .png to ./images/)

Regards, Darius

Reply by email

Unknown author
to Marco van de Voort: In our previous episode, said: I don't think it differs from html. Some questions that…
Marco van de Voort wrote 13 lines
In our previous episode, said: >> the same directory as the .xml file is and from where the chm file is >> generated from. >> >> All relevant files and scripts are in SVN. > > CHM ? This is for Marco. I don't think it differs from html. Some questions that come to mind: Upon reading, my first guess would be that either that specification how paths are transformed is murky (and it just "happens" to work with latex), or some transformation is missing in this specific case.

Nono, when implementing I did the tests with latex and html, both worked fine.

What does the path of the img mean (source or destination path?)

Source, obviously.

Michael.

Reply by email

Marco van de Voort
to Unknown author

In our previous episode, said:

Show quoted text 6 lines
> Upon reading, my first guess would be that either that specification how > paths are transformed is murky (and it just "happens" to work with latex), > or some transformation is missing in this specific case. Nono, when implementing I did the tests with latex and html, both worked fine.

Where are those tests? :-)

Anyway, best is to use such test, generate chm and html, and then decompress the html (using chmls extract) and see if the internal html is sane.

Or Darius could post a minimal example (src+xml+cmdline to combine, batch or shell) to mantis and I'll have a look.

Reply by email

Darius Blaszyk
to Marco van de Voort
Marco van de Voort wrote 15 lines
In our previous episode, said: >> Upon reading, my first guess would be that either that specification how >> paths are transformed is murky (and it just "happens" to work with latex), >> or some transformation is missing in this specific case. > > Nono, when implementing I did the tests with latex and html, both worked > fine. Where are those tests? :-) Anyway, best is to use such test, generate chm and html, and then decompress the html (using chmls extract) and see if the internal html is sane. Or Darius could post a minimal example (src+xml+cmdline to combine, batch or shell) to mantis and I'll have a look.

I have just created a bug report: http://bugs.freepascal.org/view.php?id=21008

There's a minimal test file attached.

Regards, Darius

Reply by email

Graeme Geldenhuys
to Marco van de Voort: In our previous episode, said: I don't think it differs from html. Some questions that…
Marco van de Voort wrote 7 lines
I don't think it differs from html. Some questions that come to mind: Upon reading, my first guess would be that either that specification how paths are transformed is murky (and it just "happens" to work with latex), or some transformation is missing in this specific case. Do we have pictures in fpdoc docs somewhere?

I use pictures in tiOPF's documentation.

http://opensoft.homeip.net:8080/tiopf/core/tiformmediator/index.html http://opensoft.homeip.net:8080/tiopf/core/titokenlibrary/index.html

I only use fpdoc tags, never HTML tags in the help contents.

Regards,   - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://fpgui.sourceforge.net

Reply by email

Unknown author
to Graeme Geldenhuys
Graeme Geldenhuys wrote 15 lines
On 2 January 2012 16:23, Marco van de Voort wrote: > I don't think it differs from html. Some questions that come to mind: > > Upon reading, my first guess would be that either that specification how > paths are transformed is murky (and it just "happens" to work with latex), > or some transformation is missing in this specific case. > > Do we have pictures in fpdoc docs somewhere? I use pictures in tiOPF's documentation. http://opensoft.homeip.net:8080/tiopf/core/tiformmediator/index.html http://opensoft.homeip.net:8080/tiopf/core/titokenlibrary/index.html I only use fpdoc tags, never HTML tags in the help contents.

Thank you, Graeme.

Darius just has some wrong value in the IMG tag's file attribute. Correcting that, it works fine with HTML. There may be still a bug in CHM, Marco will have to investigate that.

Michael.

Reply by email

Marco van de Voort
to Unknown author

In our previous episode, said:

Show quoted text 10 lines
> http://opensoft.homeip.net:8080/tiopf/core/tiformmediator/index.html > http://opensoft.homeip.net:8080/tiopf/core/titokenlibrary/index.html > > I only use fpdoc tags, never HTML tags in the help contents. Thank you, Graeme. Darius just has some wrong value in the IMG tag's file attribute. Correcting that, it works fine with HTML. There may be still a bug in CHM, Marco will have to investigate that.

I think it is mostly the directory layout. You had images in images/ and Darius not, and Darius didn't know about images/

Logically, Darius should pass --image-dir "" or something like that and it might work.

Reply by email

Darius Blaszyk
to Graeme Geldenhuys: I use pictures in tiOPF's documentation. http://opensoft.homeip.net:8080/tiopf/core/tiform…
Graeme Geldenhuys wrote 15 lines
On 2 January 2012 16:23, Marco van de Voort wrote: > I don't think it differs from html. Some questions that come to mind: > > Upon reading, my first guess would be that either that specification how > paths are transformed is murky (and it just "happens" to work with latex), > or some transformation is missing in this specific case. > > Do we have pictures in fpdoc docs somewhere? I use pictures in tiOPF's documentation. http://opensoft.homeip.net:8080/tiopf/core/tiformmediator/index.html http://opensoft.homeip.net:8080/tiopf/core/titokenlibrary/index.html I only use fpdoc tags, never HTML tags in the help contents.

I have no issues with HTML documentation. The chm writer simply did not support embedding images. I have uploaded a patch in the bug tracker.

Regards, Darius

Reply by email