refactor: one declaration renderer, one member partial, one vocabulary - #132
Merged
Conversation
Member sections were six near-copies. They now share one partial per language, which also gives namespace, group and index pages the source links and separators only cpp/class had. Member types link to their definition, and the all-members table appears only where members are actually inherited.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Core structure work behind #130 and #131, with a regression guard built first.
The guard
test/snapshots/holds the full rendered Markdown for all 11 fixtures plus the search entriesgenerate()returns andrun()never writes to disk. The other suites assert on chosen lines, so anything outside them landed silently. I proved it fails on a one-word label change before relying on it, and every commit below was judged against it.One declaration renderer
member.protowas 116 lines of parser code duplicating thesignaturehelper, feeding one search-snippet fallback, kept "for classic templates" — a directory the docs tell users to pass and which is not in this repo.compound.protowas written and never read. Both gone;src/signature.tsis now the only thing that knows what a declaration looks like. Net 207 lines deleted.One visible effect: the macro search snippet was
\define ``GGROUP_DEFINE`, now#define GGROUP_DEFINE 1`.Function pointers (fixes #131)
Parameters came from a hardcoded list of member kinds. Doxygen reports a function pointer as a variable with no
<param>elements at all, describing its arguments only in a<parameterlist>, so they fell through and nothing rendered. Parameters now come from whatever evidence exists. And since Doxygen splitsint (*retry)(int n)into type, name and argsstring, joining those three restores the declaration without parsing C.One member partial
The six member sections were near-copies. Measured: 92 lines (cpp/class), 60, 50, and only cpp/class carried source links and relation lists — java/class did not, which settled whether the divergence was design or drift.
They now share one partial per language. Namespace, group and index pages gain the source links and separators; enum tables sit in the same position everywhere. Full blast radius across the corpus: 12
Defined inlines, 13 separators, and the enum table moving.Member types link (#130)
A member's own section now echoes its type as a link, so a struct member pointing at another type can be followed. Only where the type points somewhere, and only for members that are not callable, since functions already link their types in the parameter and summary tables.
The all-members table now appears only where members are actually inherited.
MountainBikekeeps it and showsPedalHarderinherited fromBicycle;Bicycleand the ten fixture classes with no bases lose a table that repeated the one below it with less in it.One vocabulary
SECTION_LABELS,searchCategoryForKindand the return-column set lived in three modules withdefine → Macroswritten twice. Now co-located insrc/vocabulary.ts. They do not collapse into one table, since kind and section are different axes, so this is adjacency rather than unification.Bundles the 2.1.17 bump.