Test xhp files

Hi All,

Is there an easy way to test how an xhp file will be rendered, as i'd like to test them out before submitting them as a patch to gerrit, which will result in less bugs being introduced.

Hi Jay,

Yousuf 'Jay' Philips schrieb:

Hi All,

Is there an easy way to test how an xhp file will be rendered, as i'd
like to test them out before submitting them as a patch to gerrit, which
will result in less bugs being introduced.

you can use the macro attached to https://bugs.documentfoundation.org/show_bug.cgi?id=95064. Look into the code, it has a lot of comments.

But you can use it only once, it will not update. I have not idea how to unlock the file while LibreOffice is running. If you want to preview the file a second time, you need to close and reopen LibreOffice.

I have not found an easy way yet. The problem is, that you need LibreOffice's HTML-viewer, because the xhp files contain propriety protocols vnd.sun.star.xhp and vnd.sun.star.zip and new (which I have not tested with my macro) vnd.libreoffice.image.

If you have build LibreOffice including helpcontent2, you only need to rebuild it to see your changes. That is currently the safest way. To catch slips of the pen, you can first open it in the browser, which detects things like a missing closing tag, or validate it against the xmlhelp.dtd.

Kind regards
Regina

Hi Regina,

Hi Jay,

you can use the macro attached to
https://bugs.documentfoundation.org/show_bug.cgi?id=95064. Look into the
code, it has a lot of comments.

Tried out the macro and it works fine to render all stuff which is on the page and unchanged embedded stuff that is already existing in the built help. Unfortunately it fails when referencing/embedding newly created files and when an embed id was changed, which i do to all ids, as i'm changing them to german to english. :smiley:

But you can use it only once, it will not update. I have not idea how to
unlock the file while LibreOffice is running. If you want to preview the
file a second time, you need to close and reopen LibreOffice.

I modified the code to create a different temp*.jar file each time it is run, so that it can show updates to the open help file and it deletes the previously generated temp*.jar file the next time its run. Have attached the modified code to the bug report for you to look over. Look forward to seeing this integrated into the authoring tool.

I have not found an easy way yet. The problem is, that you need
LibreOffice's HTML-viewer, because the xhp files contain propriety
protocols vnd.sun.star.xhp and vnd.sun.star.zip and new (which I have
not tested with my macro) vnd.libreoffice.image.

If you have build LibreOffice including helpcontent2, you only need to
rebuild it to see your changes. That is currently the safest way. To
catch slips of the pen, you can first open it in the browser, which
detects things like a missing closing tag, or validate it against the
xmlhelp.dtd.

As the help files are simply zipped versions of the .xhp folders placed in LO's help folder, i've written a batch script to zip them up and overwrite the help files. This method overcomes all possible problems that could occur with the macro and the batch script takes a few seconds to complete and all thats needed is to start/restart LO and open the help.

Yousuf 'Jay' Philips