120 Commits

Author SHA1 Message Date
Simon McVittie
99da009308 wikiheaders: Escape backslash in man pages
Otherwise, groff will interpret it as a macro, causing the man page
for SDL_GetPrefPath() to be mis-rendered. Escape unescaped backslashes
as `\(rs` ("reverse solidus") before escaping other characters with
macros that, themselves, contain backslashes.

Resolves: https://github.com/libsdl-org/SDL/issues/13039
Signed-off-by: Simon McVittie <smcv@collabora.com>
2025-09-04 19:59:15 -04:00
Ryan C. Gordon
af74b1fe84 wikiheaders: Generate a current list of supported environment variables.
Fixes #13827.
2025-09-02 15:49:52 -04:00
Ryan C. Gordon
5b688514c7 wikiheaders: Don't autolink things that are already linked.
This is a dirty hack, but it currently works for our purposes. We just refuse
to link an eligible string (like, say...`SDL_shadercross`), if there's a '['
character right before it.

This WILL NOT WORK if the string is in the middle of a link! For example, if
you had `[please refer to SDL_shadercross](https://example.com/)`, this will
still fail in the usual ways, but we're not building out a robust parser here
at the moment, and this catches the most common problem.

Fixes #13160.
Fixes https://github.com/libsdl-org/sdlwiki/issues/752
Closes https://github.com/libsdl-org/sdlwiki/pull/725
2025-08-26 14:43:59 -04:00
Ryan C. Gordon
3896b1b3f4 wikiheaders: Let each subproject specify how to find their property symbols. 2025-06-17 16:41:24 -04:00
Ryan C. Gordon
b8187e2abd wikiheaders: Trim whitespace from end of lines in section headers. 2025-06-01 10:43:08 -04:00
krizej
3be57ec774 docs: fix man page return value section generation 2025-05-20 13:04:45 -04:00
Ryan C. Gordon
1f7aa16eae wikiheaders: Man pages should escape apostrophe chars.
This prevents problems if one starts a line, which would cause it to be
interpreted as a command character.

Fixes #13038.
2025-05-14 11:36:43 -04:00
Ryan C. Gordon
a7344206e8 wikiheaders: Patched to compile.
(whoops.)
2025-05-05 23:58:59 -04:00
Ryan C. Gordon
06c2f9fcfc wikiheaders: Correct wiki README digest links. 2025-05-05 23:56:12 -04:00
Ryan C. Gordon
ad46394e82 wikiheaders: README.md should be READMEs.md
So it doesn't conflict with the old README directory.
2025-05-05 23:49:06 -04:00
Ryan C. Gordon
2c97a48c51 wikiheaders: READMEs go in the base dir of the wiki now.
Reference PR #12529.

(and several other issues.)
2025-05-05 23:36:08 -04:00
krizej
a390f5716e docs: improve man page generation 2025-04-08 22:52:43 -04:00
Ryan C. Gordon
c2dac95f58 Revert "Add CategoryAPICategory to the complete API index"
This reverts commit 21a42d2b0d.

It doesn't work like this, sorry.  :)
2025-01-16 18:02:01 -05:00
Sam Lantinga
21a42d2b0d Add CategoryAPICategory to the complete API index 2025-01-16 09:26:00 -08:00
Ryan C. Gordon
2b8fb0bdd4 wikiheaders: Maybe fix perl warning.
Reference Issue #11944.
2025-01-13 15:18:39 -05:00
Ryan C. Gordon
507593f485 wikiheaders: Allow symbols to be filtered from manpage generation by regex.
This is specifically to prevent generating a manpage for "Uint32" and friends.

Fixes #11898.
2025-01-09 14:13:00 -05:00
Sam Lantinga
f2074d7af3 Updated copyright for 2025 2025-01-01 07:45:52 -08:00
Ryan C. Gordon
2f68efda83 wikiheaders: Add underscore to the "big ascii" character table. 2024-12-17 23:23:13 -05:00
Ryan C. Gordon
9a9616894d wikiheaders: Fix uninitialized variable issue. 2024-12-13 13:52:35 -05:00
Ryan C. Gordon
ac92af02ea wikiheaders: put a header on the quick reference pages. 2024-12-10 11:36:19 -05:00
Ryan C. Gordon
be5fba963a wikiheaders: optionally generate a Quick Reference page.
Plus some fixes to SDL's headers this brought up.
2024-12-10 11:25:15 -05:00
Ryan C. Gordon
e9b5f6749e wikiheaders: add (disabled) code to check for missing \threadsafety tags.
Reference Issue #7140.
2024-10-22 10:48:19 -04:00
Ryan C. Gordon
ffe4e571d1 wikiheaders: regex hack to make a URL not confuse wikilink genertion. 2024-10-04 15:34:18 -04:00
Ryan C. Gordon
abdd8b4929 wikiheaders: generate wiki redirect pages for individual enumerators. 2024-08-16 23:45:14 -04:00
Sam Lantinga
5e513ecc7f Don't automatically free temporary memory, let the application call SDL_FreeTemporaryMemory() when it's ready.
Also mark up all functions that return temporary memory with SDL_DECLSPEC_TEMP, to help people implementing language bindings.

Fixes https://github.com/libsdl-org/SDL/issues/10378
2024-07-26 10:05:03 -07:00
Ryan C. Gordon
2f6e34d2d0 wikiheaders: Added copyright comment to the top of file. 2024-07-22 22:39:09 -04:00
Ryan C. Gordon
7c2329cd78 wikiheaders: Fix C typedef parsing.
Before, it was treating `typedef struct x x;` as a struct typedef instead of
a datatype typedef. Worse, it was treating `typedef struct x *x` the same!

This might require us to manually clean out some incorrect CategoryAPIStruct
tags that have accumulated in various pages.
2024-06-15 11:31:17 -04:00
Ryan C. Gordon
c0c0c64a1d wikiheaders: Some quick scripting to make params/return info consistent.
- Lowercase the first letter of \param and \returns data; in the former case,
  it looks better in the table and Doxyggen (imho), in the latter it's because
  it's inserted after the word "Returns" to make an english sentence on the
  wiki. This is disabled in this commit, but it was useful to turn it on to
  fix up the headers manually.

- Make sure everything ends with punctuation. Inserts a period if there's
  no existing period or exclamation point at the end of the text. This is
  enabled going forward, so we won't have to manage it ourselves.
2024-06-14 02:08:50 -04:00
Ryan C. Gordon
2ad7c70ac6 documentation: clean up a minor syntax issue. 2024-06-13 18:10:28 -04:00
Ryan C. Gordon
a9d0eaf34a wikiheaders: Warn if a function returns non-void but has no \returns line. 2024-06-13 16:45:59 -04:00
Ryan C. Gordon
97ec4b0937 wikiheaders: fixed to work with not-SDL3 projects.
(SDL2 still uses DECLSPEC, not SDL_DECLSPEC.)
2024-06-12 19:30:10 -04:00
Ryan C. Gordon
fe620f0345 wikiheaders: List parameter and return value datatypes.
This lets them be clickable on the wikipages when they are SDL symbols.

Reference Issue #9236 (the "Missing links" checklist).
Reference Issue #9995.
2024-06-12 19:30:10 -04:00
Ryan C. Gordon
96bb06d9c7 wikiheaders: Clean out extra blank lines in function declarations on wiki.
This has been driving me nuts for awhile now.  :)
2024-06-11 12:37:41 -04:00
Ryan C. Gordon
386aa56711 wikiheaders: Make cleaning out function attributes more generic.
Changes the wiki page's "Syntax" section from things like...

```c
void SDL_LockMutex(SDL_Mutex *mutex) SDL_ACQUIRE(mutex);
```

...to...

```c
void SDL_LockMutex(SDL_Mutex *mutex);
```
2024-06-11 12:30:32 -04:00
Ryan C. Gordon
b53f6cf77a wikiheaders: Removed a FIXME comment. 2024-06-11 11:37:45 -04:00
Ryan C. Gordon
8e782602de wikiheaders: Fixes and cleanups to fix SDL_ReportAssertion's wiki page. 2024-06-11 11:29:44 -04:00
Ryan C. Gordon
c3a4b15a74 wikiheaders: Don't present printf-support compiler metadata in wiki. 2024-06-11 10:58:02 -04:00
Sam Lantinga
6f2621438a Renamed DECLSPEC to SDL_DECLSPEC 2024-05-17 17:09:09 -07:00
Ryan C. Gordon
5e6d85b8f0 wikiheaders: bridge wiki Category docs to the headers!
Did an initial cleanup on the headers and wrote a few pieces of documentation,
but this needs more work to fill out the documentation.
2024-05-16 11:48:23 -04:00
Sam Lantinga
fbe7e2e6d3 Moved the SDL version back to SDL_version.h
Added a comment at the top of SDL.h with the current version, for informational purposes
2024-05-15 14:38:29 -07:00
Sam Lantinga
661f2fc1fc Removed the SDL_Version structure, moved SDL version to SDL.h
Inspired by https://github.com/libsdl-org/SDL/issues/9788
2024-05-15 10:43:31 -07:00
Ryan C. Gordon
62a7e419f7 wikiheaders: Automatically categorize API symbols by subsystem. 2024-05-14 13:30:42 -04:00
Ryan C. Gordon
1d2b00efe1 wikiheaders: A few fixes that the SDL2 branch exposed. 2024-05-07 14:23:19 -04:00
Ryan C. Gordon
353001e077 wikiheaders: Fixed LaTeX chapter list and symbol sorting. 2024-05-05 02:44:45 -04:00
Ryan C. Gordon
b181e7b1ca wikiheaders: LaTeX output support.
Reference Issue #9440.
2024-05-05 02:03:44 -04:00
Ryan C. Gordon
0768e0e431 wikiheaders: Fixed See Also section in --copy-to-headers.
This broke when the list bullet markdown was fixed, and then the fixed wiki
data was copied back to the headers.
2024-05-05 01:53:37 -04:00
Ryan C. Gordon
a16b76cf80 wikiheaders: Markdown should use '-' for unordered lists, not '*'. 2024-05-05 01:22:45 -04:00
Ryan C. Gordon
77f4ffcc79 wikiheaders: Don't list SDL property #defines below functions.
They will still generate "please refer to" pages, though.
2024-05-03 13:19:27 -04:00
Ryan C. Gordon
92bd7d99dd wikiheaders: Deal with multiline typedefs.
This happens more than once with function pointer typedefs.

Reference Issue #9440.
2024-05-03 13:01:20 -04:00
Ryan C. Gordon
3348d0caaf wikiheaders: Deal with SDLMAIN_DECLSPEC functions. 2024-05-03 09:31:27 -04:00