1 # This file is part of NIT ( http://www.nitlanguage.org ).
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
15 # Create DocPage instances for each documentated Mentity.
20 # ExtractionPhase populates the DocModel with DocPage.
24 # Instanciates documentation pages for the given DocModel.
26 doc
.add_page
new OverviewPage("overview", "Overview")
27 doc
.add_page
new SearchPage("search", "Index")
28 for mgroup
in doc
.mgroups
do
29 doc
.add_page
new ReadmePage(mgroup
)
30 doc
.add_page
new MGroupPage(mgroup
)
32 for mmodule
in doc
.mmodules
do
33 doc
.add_page
new MModulePage(mmodule
)
35 for mclass
in doc
.mclasses
do
36 doc
.add_page
new MClassPage(mclass
)
38 for mproperty
in doc
.mproperties
do
39 doc
.add_page
new MPropertyPage(mproperty
)
44 # The Nitdoc overview page.
49 # The Nidoc full index page.
54 # A DocPage documenting a MEntity.
59 # Type of MEntity documented by this page.
62 # MEntity documented by this page.
65 redef var id
is lazy
do return mentity
.nitdoc_id
66 redef var title
is lazy
do return mentity
.nitdoc_name
69 # A page that displays a `MGroup` README.
73 redef type MENTITY: MGroup
74 redef var id
is lazy
do return "readme_{mentity.nitdoc_id}"
77 # A documentation page about a MGroup.
81 redef type MENTITY: MGroup
84 # A documentation page about a MModule.
88 redef type MENTITY: MModule
91 # A documentation page about a MClass.
95 redef type MENTITY: MClass
98 # A documentation page about a MProperty.
102 redef type MENTITY: MProperty