# Write the content to a new file
fun write_to(filename: String)
do
- print "Generate {filename}"
var f = new OFStream.open(filename)
for s in _stage_context.content do
f.write(s)
# Generate common files (frames, index, overview)
fun extract_other_doc
do
+ info("Generating other files",1)
_module = null
inside_mode = false
intrude_mode = false
init
do
+ keep_ast = true
super("nitdoc")
option_context.add_option(opt_dir)
end
do
var m = module
if not need_doc(dctx) then m = global.intro.module
- var m = dctx.known_owner_of(m)
+ m = dctx.known_owner_of(m)
if m == dctx.module then
return "<a href=\"#{html_anchor}\">{self}</a>"
else
var res = new Buffer
res.append(signature.to_html(dctx))
var s = self
- if s.node != null then
- if s.node isa ADeferredMethPropdef then
+ if s isa MMMethod then
+ if s.is_abstract then
res.append(" is abstract")
- else if s.node isa AInternMethPropdef then
+ else if s.is_intern then
res.append(" is intern")
end
end
redef fun doc
do
var n = node
- if n == null or not node isa PPropdef then
+ if n == null or not n isa APropdef then
return null
end
- assert n isa PPropdef
var d = n.n_doc
if d == null then
return null
end
- assert d isa ADoc
if d.n_comment.is_empty then
return null
else
end
end
redef class MMMethod
- redef fun kind do return if global.is_init then "init" else "meth"
+ redef fun kind do return if global.is_init then "init" else "fun"
end
redef class MMAttribute
- redef fun kind do return "attr"
+ redef fun kind do return "var"
end
redef class MMTypeProperty
redef fun kind do return "type"
# Extract and generate html file for the module
fun extract_module_doc(dctx: DocContext)
do
+ dctx.info("Generating HTML for module {name}",1)
dctx.register(self)
dctx.clear
return null
end
var np = n.n_packagedecl
- assert np isa APackagedecl
var d = np.n_doc
if d == null then
return null
end
- assert d isa ADoc
if d.n_comment.is_empty then
return null
else
do
var m = module
if not need_doc(dctx) then m = global.module
- var m = dctx.known_owner_of(m)
+ m = dctx.known_owner_of(m)
if m == dctx.module then
return "<a href=\"#{html_anchor}\">{self}</a>"
else
# skip pass 1 because constructors are not inherited
var cmap = new HashMap[MMLocalClass, Array[MMLocalProperty]]
var mmap = new HashMap[MMModule, Array[MMLocalProperty]]
- var props = new Array[MMLocalClass]
for c in che.greaters do
if c isa MMSrcLocalClass then
var km = dctx.known_owner_of(c.module)
end
var mmap = new HashMap[MMModule, Array[MMLocalProperty]]
- var props = new Array[MMLocalClass]
for c in crhe.order do
if module.mhe <= c.module or dctx.owned_modules.has(c.module) or not c isa MMSrcLocalClass then continue
var km = dctx.known_owner_of(c.module)
redef fun doc
do
- var n = nodes.first
- if not n isa AClassdef then
+ var n = node
+ if not n isa AStdClassdef then
return null
end
- assert n isa AClassdef
var d = n.n_doc
if d == null then
return null
end
- assert d isa ADoc
if d.n_comment.is_empty then
return null
else