var opt_source = new OptionString("Format to link source code (%f for filename, " +
"%l for first line, %L for last line)", "--source")
- # Directory where the CSS and JS is stored.
- var opt_sharedir = new OptionString("Directory containing nitdoc assets", "--sharedir")
-
# Use a shareurl instead of copy shared files.
#
# This is usefull if you don't want to store the Nitdoc templates with your
var opt_github_gitdir = new OptionString("Git working directory used to resolve path name (ex: /home/me/mypackage/)", "--github-gitdir")
# Do not produce HTML files
- var opt_no_render = new OptionBool("do not render HTML files", "--no-render")
+ var opt_no_render = new OptionBool("Do not render HTML files", "--no-render")
redef init do
super
option_context.add_option(
- opt_source, opt_sharedir, opt_shareurl, opt_custom_title,
+ opt_source, opt_share_dir, opt_shareurl, opt_custom_title,
opt_custom_footer, opt_custom_intro, opt_custom_brand,
opt_github_upstream, opt_github_base_sha1, opt_github_gitdir,
opt_piwik_tracker, opt_piwik_site_id,
var output_dir = ctx.output_dir
if not output_dir.file_exists then output_dir.mkdir
# locate share dir
- var sharedir = ctx.opt_sharedir.value
- if sharedir == null then
- var dir = ctx.nit_dir
- sharedir = dir/"share/nitdoc"
- if not sharedir.file_exists then
- print "Error: cannot locate nitdoc share files. Uses --sharedir or envvar NIT_DIR"
- abort
- end
- end
+ var sharedir = ctx.share_dir / "nitdoc"
# copy shared files
if ctx.opt_shareurl.value == null then
sys.system("cp -r -- {sharedir.to_s.escape_to_sh}/* {output_dir.to_s.escape_to_sh}/")
redef fun init_topmenu(v, doc) do
super
var mpackage = mentity.mpackage
- topmenu.add_li new ListItem(new Link(mpackage.nitdoc_url, mpackage.html_name))
+ if mpackage != null then
+ topmenu.add_li new ListItem(new Link(mpackage.nitdoc_url, mpackage.html_name))
+ end
topmenu.add_li new ListItem(new Link(mentity.nitdoc_url, mentity.html_name))
topmenu.active_item = topmenu.items.last
end
# TODO filter here?
super
var mclasses = new HashSet[MClass]
- mclasses.add_all mentity.collect_intro_mclasses(v.ctx.min_visibility)
- mclasses.add_all mentity.collect_redef_mclasses(v.ctx.min_visibility)
+ mclasses.add_all mentity.collect_intro_mclasses(v.doc.filter)
+ mclasses.add_all mentity.collect_redef_mclasses(v.doc.filter)
if mclasses.is_empty then return
var list = new UnorderedList
list.css_classes.add "list-unstyled list-labeled"
private fun mclass_inherited_mprops(v: RenderHTMLPhase, doc: DocModel): Set[MProperty] do
var res = new HashSet[MProperty]
- var local = mentity.collect_local_mproperties(v.ctx.min_visibility)
- for mprop in mentity.collect_inherited_mproperties(v.ctx.min_visibility) do
+ var local = mentity.collect_local_mproperties(v.doc.filter)
+ for mprop in mentity.collect_inherited_mproperties(doc.mainmodule, v.doc.filter) do
if local.has(mprop) then continue
#if mprop isa MMethod and mprop.is_init then continue
if mprop.intro.mclassdef.mclass.name == "Object" and