| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 3a56253 commit bef992a
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -21,6 +21,25 @@ require daslib/strings_boost | |||
| 21 | 21 | require daslib/regex | |
| 22 | 22 | require daslib/regex_boost | |
| 23 | 23 | ||
| 24 | + enum DocumentBlock { | ||
| 25 | + Typedefs, | ||
| 26 | + GlobalConstants, | ||
| 27 | + Enumerations, | ||
| 28 | + Structures, | ||
| 29 | + StructureAnnotations, | ||
| 30 | + FunctionAnnotations, | ||
| 31 | + CallMacros, | ||
| 32 | + ReaderMacros, | ||
| 33 | + VariantMacros, | ||
| 34 | + TypeinfoMacros, | ||
| 35 | + Annotations, | ||
| 36 | + EnumerationAnnotations, | ||
| 37 | + StructureMacros, | ||
| 38 | + TypeMacros, | ||
| 39 | + Classes, | ||
| 40 | + Functions, | ||
| 41 | + } | ||
| 42 | + | ||
| 24 | 43 | let { //! Configuration constants for the RST documentation generator. | |
| 25 | 44 | log_documentation = false | |
| 26 | 45 | show_hidden_groups = false | |
@@ -36,6 +55,24 @@ var public { | |||
| 36 | 55 | strict_struct_fields = true | |
| 37 | 56 | group_function_overloads = true | |
| 38 | 57 | property_assignment_operator = ":=" | |
| 58 | + doc_block_order = [ | ||
| 59 | + DocumentBlock.Typedefs, | ||
| 60 | + DocumentBlock.GlobalConstants, | ||
| 61 | + DocumentBlock.Enumerations, | ||
| 62 | + DocumentBlock.Structures, | ||
| 63 | + DocumentBlock.StructureAnnotations, | ||
| 64 | + DocumentBlock.FunctionAnnotations, | ||
| 65 | + DocumentBlock.CallMacros, | ||
| 66 | + DocumentBlock.ReaderMacros, | ||
| 67 | + DocumentBlock.VariantMacros, | ||
| 68 | + DocumentBlock.TypeinfoMacros, | ||
| 69 | + DocumentBlock.Annotations, | ||
| 70 | + DocumentBlock.EnumerationAnnotations, | ||
| 71 | + DocumentBlock.StructureMacros, | ||
| 72 | + DocumentBlock.TypeMacros, | ||
| 73 | + DocumentBlock.Classes, | ||
| 74 | + DocumentBlock.Functions | ||
| 75 | + ] | ||
| 39 | 76 | } | |
| 40 | 77 | ||
| 41 | 78 | var private seen_function_labels : table<string; uint> | |
@@ -2095,25 +2132,44 @@ def public documents(name : string; mods : array<Module?>; fname : string; var g | |||
| 2095 | 2132 | break | |
| 2096 | 2133 | } | |
| 2097 | 2134 | ||
| 2098 | - document_typedefs(doc_file, mods) | ||
| 2099 | - document_global_constants(doc_file, mods) | ||
| 2100 | - let wasEnums = document_enumerations(doc_file, mods) | ||
| 2101 | - if (hook.afterEnums != null) { | ||
| 2102 | - hook.afterEnums |> invoke(doc_file, wasEnums) | ||
| 2103 | - } | ||
| 2104 | - document_structures(doc_file, mods) | ||
| 2105 | - document_structure_annotations(doc_file, mods, hook) | ||
| 2106 | - document_function_annotations(doc_file, mods, hook) | ||
| 2107 | - document_call_macros(doc_file, mods) | ||
| 2108 | - document_reader_macros(doc_file, mods) | ||
| 2109 | - document_variant_macros(doc_file, mods) | ||
| 2110 | - document_typeinfo_macros(doc_file, mods) | ||
| 2111 | - document_annotations(doc_file, mods, hook) | ||
| 2112 | - document_enumeration_annotations(doc_file, mods, hook) | ||
| 2113 | - document_structure_macros(doc_file, mods) | ||
| 2114 | - document_typemacros(doc_file, mods) | ||
| 2115 | - document_classes(doc_file, mods) | ||
| 2116 | - document_functions(doc_file, mods, groups) | ||
| 2135 | + for (docBlock in doc_block_order) { | ||
| 2136 | + if (docBlock == DocumentBlock.Typedefs) { | ||
| 2137 | + document_typedefs(doc_file, mods) | ||
| 2138 | + } elif (docBlock == DocumentBlock.GlobalConstants) { | ||
| 2139 | + document_global_constants(doc_file, mods) | ||
| 2140 | + } elif (docBlock == DocumentBlock.Enumerations) { | ||
| 2141 | + let wasEnums = document_enumerations(doc_file, mods) | ||
| 2142 | + if (hook.afterEnums != null) { | ||
| 2143 | + hook.afterEnums |> invoke(doc_file, wasEnums) | ||
| 2144 | + } | ||
| 2145 | + } elif (docBlock == DocumentBlock.Structures) { | ||
| 2146 | + document_structures(doc_file, mods) | ||
| 2147 | + } elif (docBlock == DocumentBlock.StructureAnnotations) { | ||
| 2148 | + document_structure_annotations(doc_file, mods, hook) | ||
| 2149 | + } elif (docBlock == DocumentBlock.FunctionAnnotations) { | ||
| 2150 | + document_function_annotations(doc_file, mods, hook) | ||
| 2151 | + } elif (docBlock == DocumentBlock.CallMacros) { | ||
| 2152 | + document_call_macros(doc_file, mods) | ||
| 2153 | + } elif (docBlock == DocumentBlock.ReaderMacros) { | ||
| 2154 | + document_reader_macros(doc_file, mods) | ||
| 2155 | + } elif (docBlock == DocumentBlock.VariantMacros) { | ||
| 2156 | + document_variant_macros(doc_file, mods) | ||
| 2157 | + } elif (docBlock == DocumentBlock.TypeinfoMacros) { | ||
| 2158 | + document_typeinfo_macros(doc_file, mods) | ||
| 2159 | + } elif (docBlock == DocumentBlock.Annotations) { | ||
| 2160 | + document_annotations(doc_file, mods, hook) | ||
| 2161 | + } elif (docBlock == DocumentBlock.EnumerationAnnotations) { | ||
| 2162 | + document_enumeration_annotations(doc_file, mods, hook) | ||
| 2163 | + } elif (docBlock == DocumentBlock.StructureMacros) { | ||
| 2164 | + document_structure_macros(doc_file, mods) | ||
| 2165 | + } elif (docBlock == DocumentBlock.TypeMacros) { | ||
| 2166 | + document_typemacros(doc_file, mods) | ||
| 2167 | + } elif (docBlock == DocumentBlock.Classes) { | ||
| 2168 | + document_classes(doc_file, mods) | ||
| 2169 | + } elif (docBlock == DocumentBlock.Functions) { | ||
| 2170 | + document_functions(doc_file, mods, groups) | ||
| 2171 | + } | ||
| 2172 | + } | ||
| 2117 | 2173 | fwrite(doc_file, "\n") | |
| 2118 | 2174 | fclose(doc_file) | |
| 2119 | 2175 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments