Skip to content

docs: add the libmuslim Dart API section - #27

Merged
rizukirr merged 3 commits into
mainfrom
docs/libmuslim-dart
Aug 18, 2026
Merged

docs: add the libmuslim Dart API section#27
rizukirr merged 3 commits into
mainfrom
docs/libmuslim-dart

Conversation

@rizukirr

Copy link
Copy Markdown
Member

Adds a Dart section to the libmuslim docs, alongside the existing C and Rust ones, documenting the libmuslim_dart package.

Content only, five new files under docs/libmuslim/dart/. Nothing outside docs/ is touched.

docs/libmuslim/dart/_category_.json                       Dart, position 3
docs/libmuslim/dart/Prayer times API/_category_.json
docs/libmuslim/dart/Prayer times API/overview.md
docs/libmuslim/dart/Prayer times API/quick-start.md
docs/libmuslim/dart/Prayer times API/api-reference.md

Structure and voice follow the Rust section, so the three language sections stay parallel.

Verification

npm run typecheck and npm run build both pass, with no broken links and no broken-anchor warnings.

Every example and every printed value in these pages was executed against the package, not written from reading the source:

  • The Jakarta quick start output was produced by running the documented program. It matches the Rust page's figures for the same date, location and method, which is an independent cross-check of both bindings.
  • The ArgumentError and PrayerTimesUnavailable messages are the real strings, copied from a run.
  • The Tromsø high-latitude example was run for both solstices. The set of affected prayers genuinely differs between them, so the page tells readers to read prayers rather than assume a fixed list.
  • CalculationMethod.kemenag.displayName and .key were read back from the C method table at runtime.
  • The calculation-method preset table was transcribed from METHOD_TABLE in prayertimes.h.

What the pages say the Dart binding does not do

The Rust section next door documents a timezone module and a published crate, so the differences are stated explicitly rather than left for a reader to infer:

  • No timezone.h wrapper. utcOffset is a fixed Duration with no DST handling. The overview says so and points at the timezone pub package meanwhile.
  • Not on pub.dev. I checked, the API returns 404, so installation is documented as a Git dependency rather than dart pub add.
  • HighLatMethod, MidnightMode and the astronomical constants are not exposed. The reference gives the reason for each, for example MethodParams has no high-latitude field, so exposing HighLatMethod would be a lever wired to nothing.
  • Platform support. The struct layout is verified against the compiled C on Linux x86-64 only.

AI disclosure

Per AI_POLICY.md: these pages were drafted with Claude Code, and the AI assistance was substantial rather than incidental.

That is also why the verification above is written out in detail. Rather than trusting generated prose, every runnable claim was executed against the real package and the output pasted back in, and the "what it does not do" section exists because the first draft's plausible-sounding parity with the Rust binding was wrong on several points.

Review is still warranted on the prose and on whether the Dart section belongs at position 3.

Documents libmuslim_dart alongside the existing C and Rust sections, with
the same overview / quick start / API reference shape.

Every example and every printed value was run against the package at
commit aee9055 rather than written from the source: the Jakarta quick
start output matches the Rust page's figures for the same inputs, and the
ArgumentError and PrayerTimesUnavailable messages are the real ones.

Records what the Dart binding does not have. It does not wrap timezone.h,
so utcOffset is a fixed Duration with no DST handling and the overview
points at the timezone package instead. The package is not on pub.dev yet,
so installation is a git dependency. HighLatMethod, MidnightMode and the
astronomical constants are not exposed, and the reference says why for
each.
Rewrites the 21 prose occurrences across the Dart pages and both
_category_.json descriptions. A few needed rephrasing rather than a
straight swap, since a comma alone would have produced a run-on.

Code blocks are untouched. The semicolons there are Dart syntax.
@vercel

vercel Bot commented Aug 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
muslimtify Ready Ready Preview Aug 18, 2026 9:46am

prism-react-renderer bundles a fixed language set. It covers c, rust,
json, yaml and css, which is why those blocks highlight, but it has no
bash, dart or powershell, and nothing was requesting them.

The visible symptom was the new Dart pages rendering as plain monospace,
but bash was the bigger miss: 66 blocks across the install, configuration
and CLI docs, unhighlighted since the site was set up.

Measured in the built HTML before and after. bash, dart and powershell go
from zero non-plain Prism token types to 20, 14 and 3.

jsonc is still plain. Prism ships no jsonc grammar and no alias for it,
so the two blocks using it need retagging to json5 or json, which is a
content change and not part of this fix.
@rizukirr

Copy link
Copy Markdown
Member Author

Pushed f4641f1, which fixes syntax highlighting. Adding it here at the maintainer's request, so this PR now touches docusaurus.config.ts as well as docs/.

The bug

The new Dart pages rendered as plain monospace. The cause is not in the pages: prism-react-renderer bundles a fixed language set, and themeConfig.prism declared only theme and darkTheme, with no additionalLanguages. Any language outside the bundle gets no grammar and renders as plain text.

Measured in the built HTML by counting distinct non-plain Prism token types per language:

Language Blocks Before After
bash 66 plain 20 token types
dart 19 plain 14 token types
powershell 2 plain 3 token types
jsonc 2 plain still plain, see below
c 19 24 token types unchanged
rust 14 13 token types unchanged
json, yaml, css 9 highlighted unchanged

bash is the larger finding and predates this branch. It is the most used language on the site, covering the install, configuration and CLI pages, and it has never been highlighted.

Left alone deliberately

jsonc is still plain. Prism ships no jsonc grammar and no alias for it, so the only fix is retagging those two blocks to json5 or json. That is a content change to pages outside this PR's scope, so it is flagged rather than done. json5 is the closer match, since it is the bundled grammar that handles comments.

npm run typecheck and npm run build both pass, no broken links or anchors.

@rizukirr
rizukirr merged commit 320c23a into main Aug 18, 2026
3 checks passed
@rizukirr
rizukirr deleted the docs/libmuslim-dart branch August 18, 2026 09:55
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