Skip to content

Add a landing page on GitHub Pages - #9

Merged
mackoj merged 2 commits into
mainfrom
website
Nov 13, 2026
Merged

mackoj merged 2 commits into
mainfrom
website

Conversation

@mackoj

@mackoj mackoj commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

A landing page for the library, to be published at https://mackoj.github.io/swift-jsonpath/. It follows swift-arazzo's site: one static site/index.html and a pages.yml workflow.

The page

  • Hero: "JSONPath for Swift. Both dialects. No dependencies.", with a short code sample and links to Get started, GitHub and the API reference.
  • What is JSONPath: three queries on the README's bookstore document and what each one selects ($..price, a filter, a Jayway path function).
  • JSON Pointer: where RFC 6901 is used ($ref, JSON Patch, validator error locations); three pointers explained (tokens, ~0/~1 escaping, the # fragment form); JSONPath and JSON Pointer compared; and what the library does with pointers: query results to pointers, set by pointer with - to append, strict parsing, Codable as a string.
  • Features: RFC 9535; the Jayway dialect plus anyDialect; mutations and JSON Pointer; the order-preserving JSONValue and Codable bridge; editor support (token ranges, typed errors); zero dependencies and Swift 6.
  • Dialects: the README's feature table, trimmed.
  • Code tour: six tabs (Query, Jayway, JSON Pointer, Mutate, Codable, Editors), all quoted from the README.
  • Built for: configuration and remote data, API testing (swift-arazzo uses it), developer tools, porting from Jayway or Sextant.
  • Quality and speed: 715/715 compliance cases, 322 ported Sextant tests, 0 dependencies, 4 CI builds, and a benchmark table.
  • Install, with a copy button.

The page loads nothing external (no fonts, scripts or analytics) and follows the system's light or dark mode. Tabs work from the keyboard, and without JavaScript every example is shown. At 390 px wide nothing overflows; I checked that in headless Chrome.

Keeping it true

  • The code tour and install snippet are marked data-readme. ReadmeTests.sitePageQuotesTheReadme fails when one of their lines is not a README line; I checked that it fails on an edited line. The README tests already compile and run those snippets.
  • AGENTS.md says to update the page along with the README.
  • The README links the site. Its install snippet now names the latest release, from: "0.0.4"; it said 0.0.1.

Merge after #8

GitHub Pages is already enabled and set to deploy from GitHub Actions, so the site goes live when this merges.

The Quality section now has a benchmark table comparing 0.0.4 with main: parsing, the 8 queries in each dialect, $..author, and replace and remove on the 1.4 MB document. The numbers are #8's p50s and the commands are #8's, so merge #8 first.

Checks

  • swift test (363 tests), swift-format 6.3 lint
  • yamllint, actionlint, zizmor on the new workflow
  • Light, dark and phone renderings checked in headless Chrome

site/index.html presents the library: what JSONPath is, with three
queries on the README's bookstore; six features; the two Dialects side
by side; a tabbed code tour; who it is for; quality numbers (715/715
compliance cases, 322 Sextant tests, 0 dependencies, 4 CI builds); and
the install snippet. One static file, light and dark, no external
requests. .github/workflows/pages.yml deploys site/ on pushes to main
that touch it, as in swift-arazzo.

The code tour and install snippet are copied from the README and marked
data-readme; ReadmeTests.sitePageQuotesTheReadme fails when one of
their lines is not a README line, so the page cannot drift from the
snippets the README tests run. AGENTS.md says to update the page with
the README. The README links the site, and its install snippet now
names the latest release, 0.0.4, instead of 0.0.1.
Six benchmarks from Benchmarks/ (#8) on the generated 1.4 MB document:
parsing, the 8 RFC 9535 and Jayway queries, a descendant scan, and
replace and remove. The numbers are #8's p50s, so this lands after it.
@mackoj
mackoj merged commit 04bfd2d into main Nov 13, 2026
16 checks passed
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