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 # Documentation generator for the nit language.
16 # Generate API documentation in HTML format from nit source code.
22 var toolcontext
= new ToolContext
23 var ctx
= new NitdocContext(toolcontext
)
24 ctx
.process_options
(args
)
25 var arguments
= ctx
.toolcontext
.option_context
.rest
29 var mbuilder
= new ModelBuilder(model
, ctx
.toolcontext
)
30 var mmodules
= mbuilder
.parse
(arguments
)
32 if mmodules
.is_empty
then return
34 var mainmodule
: MModule
35 if mmodules
.length
== 1 then
36 mainmodule
= mmodules
.first
38 mainmodule
= new MModule(model
, null, "<main>", new Location(null, 0, 0, 0, 0))
39 mainmodule
.is_fictive
= true
40 mainmodule
.set_imported_mmodules
(mmodules
)
44 var nitdoc
= new Nitdoc(ctx
, model
, mainmodule
)