My THtml does not look like ROOT's Posted Documentation

I have created a few classes in the style of the Event class. When I generate the documentation via…

.L MyClass.cpp++
THtml ht
ht.MakeClass(“MyClass”)

I get html documentation but it doesn’t look like ROOTs current documentation, i.e.
root.cern.ch/root/html/TH1

Is there any way to make mine look like yours?

I’m using ROOT v5.12.00 on a Windows machine with Visual C++ 2005 Express Edition.

John Estrada

We have introduced a new (and I hope) better style with version 5.13/01.
This version will be released (5.13/02) on August 30.

Rene

Rene - Thanks for the quick reply. I’ll look forward to the 5.13/02 release.

Slightly off topic but are there any meetings or conferences coming up that the ROOT team is planning on attending. I’d enjoy hearing about the future of ROOT and also learn some tricks on advanced techniques.

John Estrada

Hi John,

sorry, the THtml doc definitely needs an update… You’ll have to run THtml h; h.MakeAll(kFALSE,"you can just put a bogus class name filter here"); to get the ROOT.css and ROOT.js style sheet and javascript file which you’ll need to have the new layout.

I’ll a) update the doc (because this behavior is far from obvious), and b) make CreateStyleSheet() and CreateJavascript() public. Thanks for pointing this out!

Cheers, Axel.

Hi,

I am using ROOT 5.12/00a, and the behaviour of THtml seems to have changed compared to previous ROOT versions.

My problem is illustrated in the small macro attached.
The .html file contains wrong links (wrong prefix paths).

Is there an easy work-around in ROOT 5.12/00a, or do I have
to wait for the next version ?

Sincerely
Dirk
TestTHtml.C (1.38 KB)

Hi Dirk,

you should call html.Convert("TestTHtml.C","Title of the Page","./htmldoc",""); THtml doesn’t know where the doc is, relative to the output dir of the converted code. The last parameter “” tells THtml that it’s “right here” (the default value is “…/” for backward compatibility, and - as you correctly pointed out - it gets it just wrong for the release version, where I didn’t realize yet that this parameter is needed). The obvious semi-work-around is to call html.Convert("TestTHtml.C","Title of the Page","./htmldoc/somesubdir",""); so that Convert creates links to “./htmldoc”. Not really satisfying…

The link to the ROOT files end up as local links because THtml finds these ROOT files in your current dir (e.g. it sees “./html/inc/THtml.h”) and thus assumes you also want to document ROOT’s classes. Simply cd out of $ROOTSYS. I don’t think this is a new behavior.

Under these two conditions, with current CVS, it works for me. The next development version is planned in less than three weeks. So you’ll either have to wait, use the CVS snapshot, or play some tricks with the output path.

Cheers, Axel.

Axel - That worked. Thanks for the help.

John Estrada

Hi Axel,

I downloaded THtml.cxx Rev.1.115, and THtml.h Rev. 1.27, and recompiled my ROOT 5.12/00a. Then I used html.Convert(“TestTHtml.C”,“Title of the Page”,"./htmldoc","");
in my TestHtml.C and references to MyClass and ROOT’s classes are now fine. There are still 2 other problems:

Problem-1:
I load library like

gSystem->Load("../lib/ToolSet.so");  // provides class CVPixel
CVPixel *p;

then the link created for CVPixel points to the root.cern.ch/root/html/CVPixel.html
which of course does not exist. How could I tell THtml to create a link to the
CVPixel.html in my source directory ? And at the same time keep the
URL’s to ROOT classes.

Problem-2:
The statements BEGIN_HTML and END_HTML are not recogniced
any more with THtml::Convert().
It still worked on ROOT version 5.11.

Dirk

Hi Dirk,

[quote=“Dime”]I load library like

gSystem->Load("../lib/ToolSet.so");  // provides class CVPixel
CVPixel *p;

then the link created for CVPixel points to the root.cern.ch/root/html/CVPixel.html
which of course does not exist. How could I tell THtml to create a link to the
CVPixel.html in my source directory ? And at the same time keep the
URL’s to ROOT classes.[/quote]
Hard to tell - can you send me the output of CVPixel::Class()->GetImplFileName()? THtml doesn’t really know whether a class is part of ROOT or a user class. If the directory is of the form “something/src/SomeFile” it assumes that it’s a ROOT class. THtml then creates a link to Root.Html.Root if it can’t find it in any of the paths specified via SourceDir + GetImplFileName(). You can set Root.Html.something: myserver/mydocdir
to specify a URL for your case.

[quote=“Dime”]Problem-2:
The statements BEGIN_HTML and END_HTML are not recogniced
any more with THtml::Convert().
It still worked on ROOT version 5.11.[/quote] Thanks for the report; this is now fixed. THtml now detects it inside and outside of comments when Convert()ing a file. The CVS revisions containing the fix will be 1.116 for THtml.cxx and 1.28 for THtml.h; they should appear soon.

Cheers, Axel.

Hi Axel,

thank you, now the BEGIN_HTML and END_HTML are recognized again.

My other problem still remains: first to answer your question, the output of
CVPixel::Class()->GetImplFileName() is “CVPixel.cxx”.
I guess this is expected.

Attached is a mofified version of my macro TestHtml.C
When I excecute the macro, then
the URL for ROOT classes is now correct with a prefix of root.cern.ch/root/html/
Also the URI for MyClass is correct with a prefix of
.htmldoc
But the URI for CVPixel is .htmldoc which is wrong in my case.
The documentation for CVPixel class is located in another place,
it happens to be in …/v20060822/htmldoc

Note that my TestHtml.C does not compile and excecute on your machine, because you are missing my file ToolSet.so.

The problem is, how to tell THtml where
to find the class documentation and sources which are located
in different directories. I often encounter this case, when I generate
.html documentation from .C macros which use classes from different
libraries which are located at different directories on the disk or on the
network.

Is there a solution already in THtml or in ROOT ?
I played with Unix.*.Root.Html.SourceDir, and THtml::SetSourceDir() but
no success.

Dirk
TestTHtml.C (1.21 KB)

Hi,

THtml was not able to deal with multiple libs (more than one ROOT and one user lib) properly. I’ve now implemented a first attempt. The usage is a bit challenging, but I believe it makes sense. You’re a bit of a Guinea pig now; please let me know whether it works and makes sense for you.

ROOT offers a system called “rootmap file” which allows auto-loading and more. Basically, it maps class names to the libraries they depend on. Assuming you have a libB with dictionaries built from Blinkdef.h, and that libB depends on libA and libCore, you would call

This would append / replace the map entries in the output file rootmap. When you start up ROOT, it loads (also) the rootmap files accessible via the LD_LIBRARY_PATH (or PATH on windows). Once you have your rootmap file, you can just write “root [] CVPixel c” and ROOT will automatically load your library, say libCV.so.

THtml will now also know that CVPixel is in libCV.so. If it can’t find the source file for that class it will not document it, but create a link to its (previously generated) documentation. It checks whether the configuration (“environment”) variable Root.Html.LibName is defined, and creates a link using that value as base URL. So you could put
Root.Html.CV: …/v20060822/htmldoc
into your .rootrc, or call gEnv->SetValue(“Root.Html.CV”, “…/v20060822/htmldoc”), and THtml will create the proper link.

The most complicated part is the mapfile. As long as you can put its generation into your Makefile you should be fine. And this approach is generic, and it’s based on a tool that should be used more often anyway :slight_smile:

The patch should appear in CVS soon, as revision 1.117 of THtml.

Cheers, Axel.