Bug 94553 - WIKIHELP: converter does not support nested lists
Summary: WIKIHELP: converter does not support nested lists
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Documentation (show other bugs)
Version:
(earliest affected)
5.0.0.5 release
Hardware: Other All
: medium normal
Assignee: Akash Deshpande
URL:
Whiteboard: target:5.3.0
Keywords: difficultyBeginner, easyHack, skillPython
Depends on:
Blocks:
 
Reported: 2015-09-27 17:28 UTC by Andras Timar
Modified: 2017-02-14 08:58 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andras Timar 2015-09-27 17:28:33 UTC
Warning: Unhandled element "list" in "list" (source/text/simpress/guide/gluepoints.xhp)
Warning: Unhandled element "listitem" in "None" (source/text/simpress/guide/gluepoints.xhp)
Warning: Unhandled element "listitem" in "None" (source/text/simpress/guide/gluepoints.xhp)
Warning: Unhandled element "listitem" in "None" (source/text/simpress/guide/gluepoints.xhp)
Warning: Unhandled element "list" in "list" (source/text/simpress/guide/gluepoints.xhp)
Warning: Unhandled element "listitem" in "None" (source/text/simpress/guide/gluepoints.xhp)
Warning: Unhandled element "listitem" in "None" (source/text/simpress/guide/gluepoints.xhp)
Warning: Unhandled element "listitem" in "None" (source/text/simpress/guide/gluepoints.xhp)
Warning: Unhandled element "list" in "list" (source/text/simpress/guide/gluepoints.xhp)
Warning: Unhandled element "listitem" in "None" (source/text/simpress/guide/gluepoints.xhp)
Warning: Unhandled element "listitem" in "None" (source/text/simpress/guide/gluepoints.xhp)
Warning: Unhandled element "listitem" in "None" (source/text/simpress/guide/gluepoints.xhp)
Comment 1 Robinson Tryon (qubit) 2016-01-19 00:13:20 UTC
(In reply to Andras Timar from comment #0)
> Warning: Unhandled element "list" in "list"

Hi Andras,
Should this bug be moved over to Redmine? (https://wiki.documentfoundation.org/Development/Wikihelp#Feedback_and_Bugs)

I don't see any docs on the 'Wikihelp' wiki page about how to run the conversion process. Could you please add a quick blurb and link to it from here? Thanks!

Status -> NEEDINFO
Comment 2 Andras Timar 2016-01-20 08:29:57 UTC
I added notes to https://wiki.documentfoundation.org/Development/Wikihelp#Technical_Information
The conversion script is part of LibreOffice source code. Do it's a task for a developer, not for infra.
Comment 3 Andras Timar 2016-06-22 11:50:22 UTC
@Akash: Please note that the situation has changed slightly. Cloph pushed https://cgit.freedesktop.org/libreoffice/help/commit/?id=184121fb7abffe19012e3a64187281f0332a4b20 and after this we have a different warning for source/text/simpress/guide/gluepoints.xhp

But the result is the same, nested list looks bad.

https://help.libreoffice.org/Impress/Using_Gluepoints
Comment 4 Akash Deshpande 2016-07-10 22:42:17 UTC
Hi, I have been looking at this. A quick summary and a question:
1) I removed the changes by cloph (it was mentioned to be a hack and it introduced more 'unhandled element errors'
2) I added List as an element to be handled inside List (nesting) - all 'unhandled element' errors for gluepoints went away
  Inserted the following into List.start_element()
        elif name == 'list':
            self.parse_child(List(attrs, self, self.isInTable))

3) In the ListItem.get_all() method, added a re.sub to insert '#' for additional items for the inside list.
  Inserted the following: (some more code and comments but just a one line summary here)
  text = re.sub(r'\n\s*#', '\n##', text)

Now, I get an extra '#' for all inside List members (instead of just the first one, which is the case currently).  As far as I can tell, this will fix the html files.

Questions/comments:
1) To be certain everything looks good, I would like to generate html files from the wiki files.  Can you please tell me how to do this?
2) I still need to thoroughly test everything.  I am also doing some traveling so I will need some more time.
3) There are other run time errors (unhandled element, key errors etc.) by help-to-wiki.py.  The file also has 'FIXME' comments.  I will be happy to look at them.

Thank you!
Akash
Comment 5 Andras Timar 2016-07-11 07:25:44 UTC
(In reply to Akash Deshpande from comment #4)
> 1) To be certain everything looks good, I would like to generate html files
> from the wiki files.  Can you please tell me how to do this?

Install MediaWiki, and try it locally. There is no better converter from wiki syntax to html than MediaWiki itself.

> 2) I still need to thoroughly test everything.  I am also doing some
> traveling so I will need some more time.

OK.

> 3) There are other run time errors (unhandled element, key errors etc.) by
> help-to-wiki.py.  The file also has 'FIXME' comments.  I will be happy to
> look at them.
> 

Thanks!
As I wrote elsewhere, you can test your patches by generating wiki text from help source with and without the patches. The diff should be only your intended fixes, and if it is so, then your patches are good.
Comment 6 jani 2016-08-11 06:34:10 UTC
A polite ping, still working on this patch ?
Comment 7 Akash Deshpande 2016-08-11 13:40:09 UTC
(In reply to jan iversen from comment #6)
> A polite ping, still working on this patch ?

Hi Jan,

I just came back from a vacation, almost exactly at the time you sent the email!  I will continue on my task and expect to have a lot of time in the next few days.  I will send you all another update within a week.  If the approach I mentioned in comment 4 works without any side effects, I expect to send a commit.

Thank you all for the patience.

Akash
Comment 8 Akash Deshpande 2016-08-17 01:46:50 UTC
I submitted a patch a couple of days ago: https://gerrit.libreoffice.org/#/c/28107/

Regression looks good, just the one desired change (the extra '#' character)

$ help-to-wiki.py -n
$ diff -r wiki0 wiki # wiki0 is the run without my changes
diff -r wiki0/Impress/Using_Gluepoints/MAIN wiki/Impress/Using_Gluepoints/MAIN
9c9
< #Choose {{MenuItem|Edit - Glue Points}}.
---
> ##Choose {{MenuItem|Edit - Glue Points}}.

And all the 'Unhandled element' warnings have disappeared.

Please let me know!  I am eager to get my first patch approved.  Of course, if there are any concerns or comments, I will do my best to address them.

I did not install MediaWiki as it has a lot of details and I will need to install MySql etc. but I will be happy to get it done for future reference.
Comment 9 Commit Notification 2016-08-17 06:48:49 UTC
Akash Deshpande committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/help/commit/?id=2e141341684eb610834db92693d715f3fd01d0dd

tdf#94553 fix nested lists in wikihelp