Skip to content

Commit

Permalink
wikiheaders: Allow symbols to be filtered from manpage generation by …
Browse files Browse the repository at this point in the history
…regex.

This is specifically to prevent generating a manpage for "Uint32" and friends.

Fixes #11898.
  • Loading branch information
icculus committed Jan 9, 2025
1 parent 7acf78b commit 507593f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .wikiheaders-options
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ bugreporturl = https://github.com/libsdl-org/sdlwiki/issues/new
warn_about_missing = 0
wikipreamble = (This is the documentation for SDL3, which is the current stable version. [SDL2](https://wiki.libsdl.org/SDL2/) was the previous version!)
wikiheaderfiletext = Defined in [<SDL3/%fname%>](https://github.com/libsdl-org/SDL/blob/main/include/SDL3/%fname%)

manpageheaderfiletext = Defined in SDL3/%fname%
manpagesymbolfilterregex = \A[US]int\d+\Z

# All SDL_test_* headers become undefined categories, everything else just converts like SDL_audio.h -> Audio
# A handful of others we fix up in the header itself with /* WIKI CATEGORY: x */ comments.
Expand Down
3 changes: 3 additions & 0 deletions build-scripts/wikiheaders.pl
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
my $wikipreamble = undef;
my $wikiheaderfiletext = 'Defined in %fname%';
my $manpageheaderfiletext = 'Defined in %fname%';
my $manpagesymbolfilterregex = undef;
my $headercategoryeval = undef;
my $quickrefenabled = 0;
my @quickrefcategoryorder;
Expand Down Expand Up @@ -127,6 +128,7 @@
$wikipreamble = $val, next if $key eq 'wikipreamble';
$wikiheaderfiletext = $val, next if $key eq 'wikiheaderfiletext';
$manpageheaderfiletext = $val, next if $key eq 'manpageheaderfiletext';
$manpagesymbolfilterregex = $val, next if $key eq 'manpagesymbolfilterregex';
$headercategoryeval = $val, next if $key eq 'headercategoryeval';
$quickrefenabled = int($val), next if $key eq 'quickrefenabled';
@quickrefcategoryorder = split(/,/, $val), next if $key eq 'quickrefcategoryorder';
Expand Down Expand Up @@ -2758,6 +2760,7 @@ sub generate_quickref {
my $sym = $_;
next if not defined $wikisyms{$sym}; # don't have a page for that function, skip it.
next if $sym =~ /\A\[category documentation\]/; # not real symbols
next if (defined $manpagesymbolfilterregex) && ($sym =~ /$manpagesymbolfilterregex/);
my $symtype = $headersymstype{$sym};
my $wikitype = $wikitypes{$sym};
my $sectionsref = $wikisyms{$sym};
Expand Down

0 comments on commit 507593f

Please sign in to comment.