X-Git-Url: http://nitlanguage.org diff --git a/src/nitdoc.nit b/src/nitdoc.nit index 3f8978a..23cf6b8 100644 --- a/src/nitdoc.nit +++ b/src/nitdoc.nit @@ -24,9 +24,9 @@ import abstracttool # Store knowledge and facilities to generate files class DocContext -special AbstractCompiler + super AbstractCompiler # Destination directory - readable writable var _dir: String = "." + readable writable var _dir: String = "doc" # Content of a generated file var _stage_context: StageContext = new StageContext(null) @@ -65,192 +65,223 @@ special AbstractCompiler f.close end - # Currently computed mmmodule - readable var _mmmodule: nullable MMSrcModule - - # Is the current directory module computed as a simple modude ? - readable writable var _inside_mode: Bool = false - - # Is the current module computed as a intruded one ? - readable writable var _intrude_mode: Bool = false + # Start a new file + fun clear + do + _stage_context = new StageContext(null) + end - # Compued introducing entities (for the index) - var _entities: Array[MMEntity] = new Array[MMEntity] + # Sorter of entities in alphabetical order + var _sorter: AlphaSorter[MMEntity] = new AlphaSorter[MMEntity] - # Register an entity (for the index) - fun register(e: MMEntity) + # Sort entities in the alphabetical order + fun sort(array: Array[MMEntity]) do - _entities.add(e) - if e isa MMSrcModule then - _mmmodule = e - end + _sorter.sort(array) end - # Start a new file - fun clear + readable var _opt_dir: OptionString = new OptionString("Directory where doc is generated", "-d", "--dir") + readable var _opt_source: OptionString = new OptionString("What link for source (%f for filename, %l for first line, %L for last line)", "--source") + readable var _opt_public: OptionBool = new OptionBool("Generate only the public API", "--public") + readable var _opt_nodot: OptionBool = new OptionBool("Do not generate graphes with graphviz", "--no-dot") + + fun public_only: Bool do - _stage_context = new StageContext(null) + if self._opt_public.value == true then return true + return false end - # Generate common files (frames, index, overview) - fun extract_other_doc + # The current processed filename + var filename: String + + # The main virtual module + var mainmod: nullable MMVirtualModule + + redef fun perform_work(mods) do - info("Generating other files",1) - _mmmodule = null - inside_mode = false - intrude_mode = false - clear - add("
\n") - add("Overview