From: Alexandre Terrasa Date: Thu, 17 Aug 2017 20:07:11 +0000 (-0400) Subject: nitdoc: use model filters X-Git-Url: http://nitlanguage.org nitdoc: use model filters Signed-off-by: Alexandre Terrasa --- diff --git a/src/doc/doc_base.nit b/src/doc/doc_base.nit index 6794d9d..ce36170 100644 --- a/src/doc/doc_base.nit +++ b/src/doc/doc_base.nit @@ -28,6 +28,8 @@ import model::model_views class DocModel super ModelView + autoinit model, mainmodule, filter + # `DocPage` composing the documentation associated to their ids. # # This is where `DocPhase` store and access pages to produce documentation. diff --git a/src/nitdoc.nit b/src/nitdoc.nit index 801e715..9d31058 100644 --- a/src/nitdoc.nit +++ b/src/nitdoc.nit @@ -41,9 +41,13 @@ private class Nitdoc super Phase redef fun process_mainmodule(mainmodule, mmodules) do - var doc = new DocModel(mainmodule.model, mainmodule) - if not toolcontext.opt_private.value then doc.min_visibility = protected_visibility - if not toolcontext.opt_no_attributes.value then doc.include_attribute = false + var min_visibility = private_visibility + if not toolcontext.opt_private.value then min_visibility = protected_visibility + var accept_attribute = true + if toolcontext.opt_no_attributes.value then accept_attribute = false + + var filters = new ModelFilter(min_visibility, accept_attribute = accept_attribute) + var doc = new DocModel(mainmodule.model, mainmodule, filters) var phases = [ new IndexingPhase(toolcontext, doc),