Skip to content

Publish the generated libosrm C++ API reference at /libosrm-api/ - #46

Open
antheducation wants to merge 1 commit into
Project-OSRM:masterfrom
antheducation:libosrm-api-reference
Open

Publish the generated libosrm C++ API reference at /libosrm-api/#46
antheducation wants to merge 1 commit into
Project-OSRM:masterfrom
antheducation:libosrm-api-reference

Conversation

@antheducation

Copy link
Copy Markdown

What this is

The rendered C++ API reference for libosrm, published at /libosrm-api/, plus a
LIBOSRM C++ API button on the front page next to DEMO and DOCUMENTATION.

Companion PR in the backend repo: Project-OSRM/osrm-backend#7677, which
adds the generator (tools/api-docs/) and points docs/libosrm.md and the README here.

Why

/docs/<version>/libosrm documents the C++ library by linking each type to its header file on
GitHub — "a short description of what the types do and where to find documentation on it". The
HTTP and Node.js APIs both have real reference pages here; the C++ one never has. This fills
that gap in the place a reader is already looking.

What is in the diff

  • libosrm-api/ — 64 generated files: a landing page, an api/ index and 56 symbol pages,
    plus sourcey.css, sourcey.js, a search index, a sitemap and llms.txt / llms-full.txt.
    Static HTML, no build step, no runtime dependencies. 421 symbols, 355 links back to the exact header line each was read from at
    osrm-backend commit e9abd4e0268c692210c4f8e6dcd1d184ff2c8f72 (tip of master, after
    v26.8.0).
  • libosrm-api/README.md — states that the directory is generated and gives the one command
    that regenerates it.
  • index.html — one added button.

Everything except that README is byte-for-byte the output of
python tools/api-docs/build.py in the backend repo at the pinned commit, so it can be
regenerated and diffed rather than trusted.

Two things worth knowing

  • _og/ is deliberately not committed. Sourcey also emits social-preview images under
    _og/; Jekyll drops leading-underscore paths on GitHub Pages, so they would 404. Excluding
    them costs only the og:image previews and keeps the diff ~3.7 MB smaller. If you would
    rather have them, the fix is an include: ["_og"] line in a _config.yml, and I will add it.
  • This repository already stores built documentation for every release from v5.5.0 to
    v26.6.1 under docs/, so committing generated output here follows the existing convention
    rather than introducing a new one. I put the reference at the top level rather than under
    docs/<version>/ because it is pinned to a commit rather than to a release; if you would
    prefer it versioned alongside the VitePress builds, say where and I will move it.

Happy to adjust the button wording, the path, or anything else.

The site's own libosrm page (/docs/<version>/libosrm) has, since 2016, pointed C++
embedders at header files on GitHub instead of offering a reference. This adds the
rendered reference to the site so those types are browsable here, and links it from
the front page next to DEMO and DOCUMENTATION.

libosrm-api/ is generated output pinned to osrm-backend commit
e9abd4e0268c692210c4f8e6dcd1d184ff2c8f72 (tip of master, after v26.8.0). Every file
except the README is byte-for-byte the output of tools/api-docs/build.py in the
backend repo, which runs Doxygen over the public headers and renders the XML with
sourcey@3.6.5. Every symbol links back to its exact file and line at that commit.

_og/ is intentionally not committed: Jekyll drops leading-underscore paths on
GitHub Pages and those files are only social-preview images.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant