ROOT
Version v6.32
master
v6.34
v6.30
v6.28
v6.26
v6.24
v6.22
v6.20
v6.18
v6.16
v6.14
v6.12
v6.10
v6.08
v6.06
Reference Guide
►
ROOT
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
Loading...
Searching...
No Matches
htmlex.C
Go to the documentation of this file.
1
/// \file
2
/// \ingroup tutorial_legacy
3
/// This file demonstrates how THtml can document sources.
4
///
5
/// See the [Users Guide](https://root.cern/root/htmldoc/guides/users-guide/ROOTUsersGuide.html)
6
/// chapter [Automatic HTML Documentation](https://root.cern/root/htmldoc/guides/users-guide/ROOTUsersGuideChapters/HTMLDoc.pdf), and
7
/// [THtml's class documentation](https://root.cern/doc/master/classTHtml.html).
8
///
9
/// To see this demo script in action start up ROOT and run
10
/// ~~~{.cpp}
11
/// root [0] .x $(ROOTSYS)/tutorials/htmlex.C+
12
/// ~~~
13
/// and check the output in `./htmldoc`.
14
///
15
/// and of course we can put HTML code into comments, too.
16
///
17
/// \macro_code
18
///
19
/// \author Axel Naumann
20
21
#include "
THtml.h
"
22
23
class
THtmlDemo
:
public
TObject
{
24
public
:
25
THtmlDemo
(): fHtml(nullptr)
26
{
27
printf
(
"This class is for demonstration purposes only!\n"
);
28
}
29
~THtmlDemo
()
override
{
if
(fHtml)
delete
fHtml; }
30
31
// inline methods can have their documentation in front
32
// of the declaration. DontDoMuch is so short - where
33
// else would one put it?
34
void
DontDoMuch
() {}
35
36
void
Convert()
37
{
38
// Create a "beautified" version of this source file.
39
// It will be called htmldoc/htmlex.C.html.
40
41
GetHtml()->SetSourceDir(
"$(ROOTSYS)/tutorials"
);
42
GetHtml()->Convert(
"htmlex.C"
,
"Example of THtml"
,
"./htmldoc/"
,
"./"
);
43
}
44
45
void
ReferenceDoc
()
46
{
47
// This function documents THtmlDemo.
48
// It will create THtmlDemo.html and src/THtmlDemo.cxx.html
49
// - the beautified version of the source file
50
51
GetHtml()->SetSourceDir(
"$(ROOTSYS)/tutorials"
);
52
GetHtml()->SetOutputDir(
"./htmldoc"
);
53
GetHtml()->MakeIndex(
"THtmlDemo"
);
// create ClassIndex.html and the javascript and CSS files
54
GetHtml()->MakeClass(
"THtmlDemo"
);
// update the class doc
55
}
56
57
void
MakeDocForAllClasses
(
Bool_t
evenForROOT
=
kFALSE
)
58
{
59
// Creates the documentation pages for all classes that have
60
// been loaded, and that are accessible from "./".
61
// If evenForROOT is set, we'll try to document ROOT's classes,
62
// too - you will end up with a copy of ROOT's class reference.
63
// The documentation will end up in the subdirectory htmldoc/.
64
65
if
(
evenForROOT
)
66
GetHtml()->SetSourceDir(
".:$(ROOTSYS)"
);
67
else
68
GetHtml()->SetSourceDir(
"."
);
69
GetHtml()->SetOutputDir(
"./htmldoc"
);
70
GetHtml()->MakeAll();
71
}
72
73
void
RunAll
() {
74
// Show off a bit - do everything we can.
75
MakeDocForAllClasses
();
76
ReferenceDoc
();
77
Convert();
78
}
79
80
protected
:
81
THtml
* GetHtml()
82
{
83
// Return out THtml object, and create it if it doesn't exist.
84
if
(!fHtml) fHtml =
new
THtml
();
85
return
fHtml;
86
}
87
88
private
:
89
Int_t
fVeryUselessMember
;
// This is a very useless member.
90
THtml
* fHtml;
// our local THtml instance.
91
ClassDefOverride
(
THtmlDemo
, 0);
// A demo of THtml.
92
};
93
94
void
htmlex
() {
95
THtmlDemo
htmldemo
;
96
htmldemo
.RunAll();
97
}
Bool_t
bool Bool_t
Definition
RtypesCore.h:63
Int_t
int Int_t
Definition
RtypesCore.h:45
kFALSE
constexpr Bool_t kFALSE
Definition
RtypesCore.h:101
ClassDefOverride
#define ClassDefOverride(name, id)
Definition
Rtypes.h:341
TRangeDynCast
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Definition
TCollection.h:358
THtml.h
ROOT::Detail::TRangeCast
Definition
TCollection.h:311
THtml
Legacy ROOT documentation system.
Definition
THtml.h:40
TObject
Mother of all ROOT objects.
Definition
TObject.h:41
tutorials
legacy
htmlex.C
ROOT v6-32 - Reference Guide Generated on Sun Apr 13 2025 06:50:57 (GVA Time) using Doxygen 1.10.0