hbdoc overhaul

645 views
Skip to first unread message

vszakats

unread,
Oct 26, 2016, 7:51:38 AM10/26/16
to Harbour Developers
Hi All,

In the last few day I've refactored hbdoc in 3.4 and made
improvements to create more readable output using existing
NFDOCs (with fixes and minor adjustments). As a side-effect,
hbdoc also became smaller and faster. Very basic Markdown
support have also been implemented.

It's been now resynced to 3.2 along with doc updates:


"before" and "after" screenshots attached below. Enjoy.

-Viktor

hbdoc-after.png
hbdoc-before.png

Klas Engwall

unread,
Oct 26, 2016, 3:24:34 PM10/26/16
to harbou...@googlegroups.com
Hi Viktor,
Thanks :-)

The screenshots you posted are looking very good. Now, while you are at
it, can you please also fix the spelling of "C level API compatability"
in hbdoc.prg to "C level API compatibility"? Someone with a heavy
American accent must have written that line from how it sounds over
there. It has annoyed me for some time :-)

Regards,
Klas

José Maria Quintas

unread,
Oct 26, 2016, 3:38:56 PM10/26/16
to harbou...@googlegroups.com
I made a test here.

Nothing, but files on Harbour doc format. (here from a MySQL database)
It is like a "doc viewer".
Content on "See also" is used to link pages.
Generate some main docs using Harbour routines as example, because they do not exists on Harbour.

http://www.harbourdoc.com.br/show.asp?key="Harbour"

And a "doc viewer" like this could be made using Harbour source code.

José M. C. Quintas
--
You received this message because you are subscribed to the Google Groups "Harbour Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-deve...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Toninho

unread,
Oct 26, 2016, 6:38:29 PM10/26/16
to Harbour Developers
Nice job, thank you.

vszakats

unread,
Oct 26, 2016, 7:02:06 PM10/26/16
to Harbour Developers
The screenshots you posted are looking very good. Now, while you are at
it, can you please also fix the spelling of "C level API compatability"
in hbdoc.prg to "C level API compatibility"? Someone with a heavy
American accent must have written that line from how it sounds over
there. It has annoyed me for some time :-) 

Thanks Klas. I'll fix this (and some more) in a next commit.

-Viktor

vszakats

unread,
Oct 26, 2016, 8:27:56 PM10/26/16
to Harbour Developers
Hi José,


On Wednesday, October 26, 2016 at 9:38:56 PM UTC+2, JoséQuintas wrote:
I made a test here.

Nothing, but files on Harbour doc format. (here from a MySQL database)
It is like a "doc viewer".
Content on "See also" is used to link pages.
Generate some main docs using Harbour routines as example, because they do not exists on Harbour.

http://www.harbourdoc.com.br/show.asp?key="Harbour"

And a "doc viewer" like this could be made using Harbour source code.

I'm so far siding with static page generation because of
the simplicity and the advantage that it can be hosted 
practically anywhere (like now on GitHub) with no server
code and machine to maintain and worry about.

(even a static page can be made dynamic by using
JS and reading the doc from a JSON "database".)

-Viktor

José Maria Quintas

unread,
Oct 27, 2016, 7:36:43 AM10/27/16
to harbou...@googlegroups.com
No, it's not about site.
I want to show that doc files already have all is needed.
hbdoc already create html from docs.
the only thing to do is transform see also to links.
Can be all static pages, each doc a static page, hbdoc can do this.

José M. C. Quintas

vszakats

unread,
Oct 27, 2016, 7:54:21 AM10/27/16
to Harbour Developers


On Thursday, October 27, 2016 at 1:36:43 PM UTC+2, JoséQuintas wrote:
No, it's not about site.
I want to show that doc files already have all is needed.
hbdoc already create html from docs.
the only thing to do is transform see also to links.
Can be all static pages, each doc a static page, hbdoc can do this.

Transforming "see also" items into links got implemented
in these recent changes (can't link across components though,
and they are not validated/verified).

(there was a casing related regression that I just fixed)

I've also added an index page with TOC, split HTML source
per component and added 'edit' buttons.

-Viktor

José Maria Quintas

unread,
Oct 27, 2016, 9:05:47 AM10/27/16
to harbou...@googlegroups.com
It is ready. Nice job. Thank you.

And there is a Clipper documentation too.

José M. C. Quintas


José M. C. Quintas

Em 27/10/2016 09:54, vszakats escreveu:
>
> Transforming "see also" items into links got implemented
> in these recent changes (can't link across components though,
> and they are not validated/verified).
>
> (there was a casing related regression that I just fixed)
>
> I've also added an index page with TOC, split HTML source
> per component and added 'edit' buttons.
>
> -Viktor
>
> -

vszakats

unread,
Nov 1, 2016, 3:55:44 PM11/1/16
to Harbour Developers
Hi,

Some improvements since the initial post:

- added new index page
- added menu in header to jump between components
- added support for other language than English (currently: pt-BR)
- added language selection menu to header
- added table of content in sidebar
- added hover highlight of long function names in sidebar
- added 'edit this page' links for each doc section
- resolved SEE ALSO links to work across components
- added option for reproducible output
- moved hbdoc to contrib directory (3.4)
- snapshot builds now include HTML documentation (3.4)
- added 'go to index', 'go to top' links for each function
- recognize legacy markups like <b>
- added small vector logo to header
- fixed some HTML5 validation issues
- content doctoring:
  - merged some Pull Requests with new/improved docs (Thanks Pete)
  - convert source file references to links (matching the
    revision of the documentation)
  - autodetect Harbour functions and convert them to links
    if possible, otherwise just highlight them
  - autodetect and highlight keyboard keys and symbols like
    command and constants
  - autoremove PROCEDURE Main()/RETURN enclosures from examples
  - remove indent from in-content code snippets
  - implement proper rendering for multiline SYNTAX sections
  - manually fixed/improved doc markups in several places
  - (lots of heuristics and tricky code)

Links:


-Viktor

Sami Laham

unread,
Nov 3, 2016, 9:28:07 AM11/3/16
to Harbour Developers
Nice Job !!!!

Thank you Viktor.



Ash

unread,
Nov 3, 2016, 10:50:35 AM11/3/16
to Harbour Developers
A job done well. Thank you.

Ash

vszakats

unread,
Nov 7, 2016, 10:56:44 AM11/7/16
to Harbour Developers
Hi,

Further hbdoc improvements:

- link to the source code of functions/components,
  if it could be auto-detected
- add 'Permalink' button for each entry
- localise doc elements not coming from NFDOC sources
- adjust format for printing, so that PDF export from a browser
  results in usable output
- multi-language support is now enabled by default
- add source code highlighting (JavaScript-based) for
  examples and code snippets
- pin page header, to make switching components easier
- scrollable sidebar
- improve file and keyword detection
- fix lots of minor content bugs and added many tags
- readability improvements
- fix tapping on menus on iOS/Safari
Brazilian Portuguese string translations here:
(reviews/corrections are welcome)

-Viktor

frank van nuffel

unread,
Nov 7, 2016, 12:03:54 PM11/7/16
to Harbour Developers
Hi Viktor,

Thank you very much!  Harbour is since long known to me, as a language/compiler/environment, but I never inclined to start using it because not wanting to put time and effort in putting the pieces together myself, in terms of documentation _and_ (above all) links to the source code

Seems you just done both (and pbly more) .oO on top of hbmk2

This is a great presentation as far as I can tell

Congratulations!

Frank


Op maandag 7 november 2016 16:56:44 UTC+1 schreef vszakats:

vszakats

unread,
Nov 10, 2016, 5:34:40 PM11/10/16
to Harbour Developers
Thank you, Frank!

-Viktor

vszakats

unread,
Nov 10, 2016, 5:35:36 PM11/10/16
to Harbour Developers
Some more news since the previous message:

- Clipper 5.3 and Clipper Tools 3 docs have been added
- this was facilitated by a custom made script that converts
  decompiled .ng files into NFDOC sources. It uses untouched
  original sources plus a few hunks worth of small patch
  fixing an original typo. Plus a hbmk2 -fixcase run.
- improve and extend internal heuristics dealing with the now
  much larger and diverse content
- rework entry IDs for permalinks and interlinks. Now they are
  quite nice and clean.
- rework internal references detection. It now works across
  components and languages, and it will show a menu if the
  reference can be found in multiple places (f.e. both Clipper and
  Harbour docs, or both hbct and CT3 docs)
- migrated out-of-NFDOC copyright headers inside NFDOC
  entries.
- add coverage statistics: per component, per language.
  Currently: ~21% for all English docs. 23.8% for Harbour core.
- doc content improvements
- still a lot of content issues, there are limits to automatic corrections
  and detection. Cl*pper class docs are not in good shape after
  auto-conversion.
- bad news: hbdoc sources are messier than ever
- last but not least: new Harbour core docs, thanks to Pete.

Clipper docs:

Index:

Please note that the most recent homepage revision resides here:

-Viktor

Hazael

unread,
Nov 11, 2016, 10:19:09 AM11/11/16
to Harbour Developers
Very nice presentation and professional work.
Well done Viktor!

Qatan

Alex Strickland

unread,
Nov 11, 2016, 11:20:38 AM11/11/16
to harbou...@googlegroups.com
Hi Viktor

Would you consider adding some issues that are low hanging fruit for the docs, and which other people might be able to take up?

--
Regards
Alex
--
You received this message because you are subscribed to the Google Groups "Harbour Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-deve...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


-- 

vszakats

unread,
Nov 11, 2016, 12:34:41 PM11/11/16
to Harbour Developers
Hi Alex,


On Friday, November 11, 2016 at 5:20:38 PM UTC+1, Alex Strickland wrote:
Hi Viktor

Would you consider adding some issues that are low hanging fruit for the docs, and which other people might be able to take up?

Good question, thanks for it.

Not sure how low-hanging they are, but these come to mind:

- better Markdown parser would be nice (even as a separate project,
  to be integrated as a second step later).
- lots of cleaning up needed in original Clipper docs:
   - updates to play better with hbdoc parser, add tags
   - fix broken 'see also' links
   - add <table>, <table-noheader>, etc tags
- but before that, advise how to start with that. Is it legal to upload
  decompiled .ng sources to a repo? (decompiled and HTML-ized
  copies are floating on the internet since many years.)
- anything content related in existing Harbour docs:
    - typos, formatting errors, fixing incorrect/outdated information
    - review/replace/extend existing text
    - reviewing STATUS/COMPLIANCE/PLATFORMS fields, they
      are in many places incorrect/incomplete/missing.
    - better and/or more examples
    - document new functions. Probably it's a good idea to document
      hb_*() functions and focusing only on things that work differently
      in Cl*pper compatibility functions, highlighting platform differences,
      possible extra features or other useful Harbour-specific information.
      (redoing existing C5.3 docs from scratch looks unnecessary).
      [Later these extra bits may even me merged on top of Cl*pper docs.]
    - document contribs that are currently totally undocumented  

Here's a list of Harbour functions referenced, but with references
broken because of missing doc entry:

AdsBinaryToFile()
AdsCloseTable()
AdsConnect()
AdsFileToBinary()
AdsGetKeyNum()
AdsIsRecordLocked()
AdsRegisterProgressCallback()
AdsSetFileType()
AdsSetSearchPath()
AdsSetServerType()
AdsShowDeleted()
Checksum()
Crypt()
DispOutAt()
HighByte()
LowByte()
MakeHI()
QQOut()
RangeRepl()
__Accept()
__Eject()
gdImageColorAllocate()
gdImageColorTransparent()
gdImageTransparent()
hb_BChar()
hb_BCode()
hb_SToD()
hb_StrFormat()

-Viktor

Pritpal Bedi

unread,
Nov 11, 2016, 4:35:53 PM11/11/16
to Harbour Developers
Hi Viktor

Excellent job!

Do you intend to keep above links as is or those are 
scheduled to be changed in future ? I am in the middle of 
adding the feature to various links of Harbour documenttaion 
in HbIDE and HbDBU and thinking of embedding these 
links literally instead of providing interface to add users own.

Thanks.


Pritpal Bedi
a student of software analysis & concepts
 

vszakats

unread,
Nov 12, 2016, 5:43:35 AM11/12/16
to Harbour Developers
Hi Pritpal,
Thank you Pritpal, I'm glad you find this useful.

Things are not completely settled yet (in particular the direct 
Clipper doc URLs) and of course may also change in the long run,
but at the moment I don't have plans to update the doc links.
If there will be any change I'll be making sure to post a note about
it on this list.

To minimise exposure to a change, you may consider using this

-Viktor

vszakats

unread,
Nov 23, 2016, 1:47:02 PM11/23/16
to Harbour Developers
Updates on the doc overhaul:

- rework the way source code of functions is being discovered.
  It means that the 'source code' button now works - and accurately 
  so - for _every_ function. It now even jumps to the precise line
  number. The requirement to use the same filename for NFDOC .txt
  and source code is no more.
- detect redirected functions (synonyms) and link to their effective
  source code, instead of the redirector stub.
- fix some broken 'see also' links by better doing a better job at
  identifying those.
- show source filename when hovering over the 'source code' button
- link to the Harbour source code implementation from Cl*pper docs.
- much improved keyword detection inside doc sources.
  This mainly affects legacy docs, like Cl*pper, CT3
- add 'Search' button to lookup a function references inside the source
  repository and also in these very forums.
- rewrite the Norton Guide parser to parse the .ng files directly and
  not require and MS-DOS based decompiler anymore. Output is .json.
  Thanks to Dave Pearson's eg project sources for .ng file parsing details:
- rewrite .ngs parser to a .json parser, fixing/improving some content
  related issues along the way

URL:

To contribute, press the "Improve this doc" button.

-Viktor

Gerald Drouillard

unread,
Nov 23, 2016, 2:24:51 PM11/23/16
to harbou...@googlegroups.com
Very nice.  Thank you.

--
You received this message because you are subscribed to the Google Groups "Harbour Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-devel+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Regards
--------------------------------------
Gerald Drouillard
Cell: 734.502.4356

vszakats

unread,
Nov 24, 2016, 5:00:29 AM11/24/16
to Harbour Developers
To forum admins:

It may be nice to update the "Clipper 5.3 docs" links in the 
header of this and user's forums to:


It currently points to http://x-hacker.org/ng/53guide/, which
doesn't work since a while.

Thank you.

-Viktor

Bacco

unread,
Nov 24, 2016, 5:49:25 AM11/24/16
to harbour-devel
Hi, Viktor

I've changed the link on Harbour Developers list welcome message.


Regards
Bacco

Bacco

unread,
Nov 24, 2016, 5:54:06 AM11/24/16
to harbour-devel
PS: not an Admin at all, but mods have edit privileges in the welcome message)
Need others to change the users and commits list, I have no access there.

Regards

vszakats

unread,
Nov 24, 2016, 10:23:39 AM11/24/16
to Harbour Developers
Thank you Bacco, also for the cleanups, it's looking great.

The user's list header could use such cleanups as well,
f.e. the harbour.github.io homepage is likely more than
temporary, so the old one can just be replaced by it.

-Viktor

Nenad Batoćanin

unread,
Nov 24, 2016, 12:34:45 PM11/24/16
to Harbour Developers
Great job, thank you very much!

Regards, NB
Reply all
Reply to author
Forward
0 new messages