Recent

Author Topic: Small CHM improvement  (Read 1254 times)

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7861
Small CHM improvement
« on: May 28, 2019, 04:52:58 pm »
I've made a small enhancement to the index of the ref.chm manual. If an entry has multiple entries, now these are no longer numbered, but have the relevant section title. (see image)

New CHM (for testpurposes)

wp

  • Hero Member
  • *****
  • Posts: 6664
Re: Small CHM improvement
« Reply #1 on: May 28, 2019, 06:34:56 pm »
Great!
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7861
Re: Small CHM improvement
« Reply #2 on: May 28, 2019, 07:19:41 pm »
This one replaces the one in the recent snapshot, which was generated after the index fixes:

Quote
r42124 | marco | 2019-05-25 18:41:18 +0200 (Sat, 25 May 2019) | 5 lines
Changed paths:
   M /trunk/packages/chm/fpmake.pp
   M /trunk/packages/chm/src/chmcmd.lpr
   M /trunk/packages/chm/src/chmfilewriter.pas
   M /trunk/packages/chm/src/chmreader.pas
   M /trunk/packages/chm/src/chmsitemap.pas
   M /trunk/packages/chm/src/chmwriter.pas
   M /trunk/utils/fpdoc/dw_htmlchm.inc

 * redone sitemap to support multiple name,local pairs for index.
 * rewritten binary index generation. Use natural sort for index.
 * updated html scanning for ID= tags as anchor, reduces warnings with more modern html code.
 
Still work to do, ags helpfile still has 70 differences. Possibly however due to case sensitive anchors on index level.
---
r42129 | marco | 2019-05-27 09:48:45 +0200 (Mon, 27 May 2019) | 1 line
Changed paths:
   M /trunk/packages/chm/src/chmsitemap.pas

 * add a dummy property to keep lazarus CHM compiling for now.
---

These will be merged back into 3.2 in time. Since sitemap classes were quite heavily modified, probably lhelp and chmmaker need to be checked.

Basically indexes now support multiple <name,local> pairs per chmsitemap item.

ASerge

  • Hero Member
  • *****
  • Posts: 1433
Re: Small CHM improvement
« Reply #3 on: May 29, 2019, 04:13:08 am »
This one replaces the one in the recent snapshot, which was generated after the index fixes:
For the ref.chm "relevant section titles" are empty (numbers in order only). For other cmhs everything is fine.

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7861
Re: Small CHM improvement
« Reply #4 on: May 29, 2019, 10:10:12 am »
The fixed CHM is a separate download (see link in first post). I now also replaced it in the snapshot.

ASerge

  • Hero Member
  • *****
  • Posts: 1433
Re: Small CHM improvement
« Reply #5 on: May 29, 2019, 02:45:49 pm »
The fixed CHM is a separate download (see link in first post). I now also replaced it in the snapshot.
Both are fine now.

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7861
Re: Small CHM improvement
« Reply #6 on: May 29, 2019, 03:01:51 pm »
Do they work in the IDE for you ? For me the treeview has empty titles. Also I see sometimes paths with backslashes in them in lhelp.

ASerge

  • Hero Member
  • *****
  • Posts: 1433
Re: Small CHM improvement
« Reply #7 on: May 29, 2019, 06:49:23 pm »
Do they work in the IDE for you ? For me the treeview has empty titles. Also I see sometimes paths with backslashes in them in lhelp.
Example. In the IDE, I set the cursor to "procedure" and pressed F1.
lhelp is displayed, on the left tree root element is "Reference Guide"
At status panel (at bottom) "ms-its:ref.chm::/ref\refse91.html#keyword_procedure not found!"
Many tabs (at bottom), the last one is selected with the caption "[unknown]"
If I select Index and double-click on any item, the last tab is renamed to "Reference Guide"

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7861
Re: Small CHM improvement
« Reply #8 on: May 29, 2019, 07:28:54 pm »
Thanks for the info, I've found it. Probably a result of regenerating that ref.chm on windows instead of linux. I will fix it in the coming days.

The confusing bit was the binary index was ok (probably fixes the path internally), but the .hhk file wasn't.

The textmode IDE mostly uses the binary index, so that explains why the early tests worked.

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7861
Re: Small CHM improvement
« Reply #9 on: May 30, 2019, 12:46:34 pm »
I fixed the empty TOC treeview issue. (though IMHO lookup should go to index, but there is a bug report for that iirc)

Note that the fix was in FPC, so update FPC to r42137 and rebuild everything.

The help is extremely slow though (5 seconds on a keyword) . I don't know what causes it, but it seems to it is the treeviews.

serbod

  • Full Member
  • ***
  • Posts: 129
Re: Small CHM improvement
« Reply #10 on: May 30, 2019, 01:28:29 pm »
Looks like you do some of that I alredy done 2 years ago. =)

https://github.com/serbod/lazhelp

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7861
Re: Small CHM improvement
« Reply #11 on: May 30, 2019, 02:09:18 pm »
Looks like you do some of that I alredy done 2 years ago. =)

https://github.com/serbod/lazhelp

I don't know what you have done(mantis items?). Most of my work was on the write side btw, not the reader side, centered around multiple name-value types per sitemapitem and fixing the binary index for that and for "seealso's"

My main test was the helpfile of the AGS project.
« Last Edit: May 30, 2019, 02:12:52 pm by marcov »

serbod

  • Full Member
  • ***
  • Posts: 129
Re: Small CHM improvement
« Reply #12 on: May 30, 2019, 02:33:27 pm »
I don't remember exactly, what was done. Changes affect all, that related to chm - reader, writer, lhelp, chmmaker. Many data structures and formats was modified to comply known HTML HELP specifications ( http://www.nongnu.org/chmspec/latest/index.html )

Also, lhelp was significally improved and optimized, so it starts and searchs instantly, as native MS Help Viewer. Some freezes on large HTML pages related to IPro HTML components.

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7861
Re: Small CHM improvement
« Reply #13 on: May 30, 2019, 02:41:50 pm »
Also, lhelp was significally improved and optimized, so it starts and searchs instantly, as native MS Help Viewer. Some freezes on large HTML pages related to IPro HTML components.

I only work on the CHM package. I quickly looked at the diffs, but the heavy reformatting makes it hard to see what is actually improved.

I would have committed simple, clean patches with the comments, but figuring this all out is quite a chore. It might be easier to simply pull up chmspec, and redo it.
« Last Edit: May 30, 2019, 02:45:51 pm by marcov »

serbod

  • Full Member
  • ***
  • Posts: 129
Re: Small CHM improvement
« Reply #14 on: May 30, 2019, 03:02:46 pm »
It might be easier to simply pull up chmspec, and redo it.

When I started, I was think same. =) Good luck.