https://github.com/cyyynthia/vitepress-scalar

WIP: A VitePress addon to integrate Scalar OpenAPI references.

https://github.com/cyyynthia/vitepress-scalar

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.7%) to scientific vocabulary

Keywords

docs documentation openapi scalar vitepress
Last synced: 5 months ago · JSON representation

Repository

WIP: A VitePress addon to integrate Scalar OpenAPI references.

Basic Info
  • Host: GitHub
  • Owner: cyyynthia
  • License: bsd-3-clause
  • Language: TypeScript
  • Default Branch: mistress
  • Homepage:
  • Size: 126 KB
Statistics
  • Stars: 5
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Topics
docs documentation openapi scalar vitepress
Created over 1 year ago · Last pushed over 1 year ago
Metadata Files
Readme Funding License

README.md

VitePress Scalar

GitHub Sponsors License

A VitePress addon to integrate Scalar OpenAPI references. Seamlessly integrates with the default theme[^vp-theme], including if you customized it[^vp-theme-customization].

[^vp-theme]: VitePress Scalar has been only tested with the default VitePress theme. It shouldn't have any issues working with a completely custom theme, but at this time it is untested and probably broken.

[^vp-theme-customization]: While changes to colors will work out of the box, more advanced changes may require some tweaks to be applied to Scalar-related styles. Due to the crude implementation at this time, certain theme changes may not work at this time but may gain better support later (e.g. sidebar).

[!CAUTION] At this time, this addon is HIGHLY experimental. It currently is merely a proof of concept, and while it works(ish) for the most part, using it in production at this time is not advisable. There are many areas that have not been tested, and/or are good enough for a PoC but will need complete refactors to be production grade.

Breaking changes can and will happen.

Areas of improvement

As this project is at this stage mostly a proof of concept, there are many things that are unhandled, poorly handled, or temporary.

Here is a non-exhaustive list of the things that would absolutely need to get handled before being anywhere near production readiness:

  • [ ] Markdown handling. Currently, the whole OpenAPI spec fetching, parsing and rendering is handled by Scalar at runtime. It's fine for a PoC, but is terrible for production. Not only does this mean the runtime will make calls to fetch the spec, parse it on the viewer's computer, but it also uses a completely different Markdown parsing pipeline than the one used to parse documents, which is really not ideal.
    • The OpenAPI spec should be processed at build-time, the same way Markdown documents are. Remark should be patched out to use VitePress's Markdown rendering logic, which would improve the integration with VitePress's theme, and run the configured Markdown plugins on the OpenAPI docs.
    • There is a valid argument that can be made, that doing it this way allows the docs to automagically update without having to re-build and deploy the VitePress app. Even if support for runtime rendering is preserved, it should just build VitePress's Markdown rendering logic in the final app to keep it consistent.
  • [x] Sidebar. The current implementation just heavily changes Scalar's theme to make its sidebar look like VitePress's, but that's not ideal. It'd be nice to ditch Scalar's sidebar and use the one from VitePress directly to improve compatibility with user styles & reduce code size.
  • [ ] Scalar search. The search component from Scalar has been stripped out; the goal is to merge it with VitePress's own search system but this has not been done at this time - so there is no way to search through the docs for now.
  • [ ] Builtin Scalar client. It seems to be working, but is completely untested and seems to have issues with how things are linked, causing problems while navigating the client.
  • [x] Local OpenAPI files. Or even the whole way OpenAPI reference pages are declared. Right now, using a Markdown file was the easiest way to get something up and running, as VitePress's internals are really not expecting a lot of extensibility in this area. It is not impossible, however, to have a custom plugin to handle this in a much more advanced manner - including with support for local files.
  • [ ] Internationalized OpenAPI files. For projects having their documentation available in multiple languages, it may be interesting to explore the possibilities regarding i18n. Or consider that the existing implementation is sufficient - either way, there should be a guide for this.
  • [ ] Accessibility review. Accessibility has not been checked at all for now, but I am pretty sure there are at least a few places where contrast is insufficient. Scalar was designed with an almost pitch-black background whereas VitePress has a brighter dark theme.

All of these will most likely require heavy changes to the way things are implemented here. This is especially true for how Scalar is consumed; right now the ApiReference component is used to do everything; this will need to change.

Owner

  • Name: Cynthia
  • Login: cyyynthia
  • Kind: user
  • Location: Toulouse, France
  • Company: @Borkenware

23f. French Computer Science student at the University of Toulouse. I have a crippling cookie and coffee addiction.

GitHub Events

Total
  • Watch event: 1
Last Year
  • Watch event: 1

Committers

Last synced: 10 months ago

All Time
  • Total Commits: 2
  • Total Committers: 1
  • Avg Commits per committer: 2.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 2
  • Committers: 1
  • Avg Commits per committer: 2.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Cynthia c****a@c****v 2
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Dependencies

package.json npm
  • @tsconfig/node-lts ^20.1.3 development
  • @tsconfig/strictest ^2.0.5 development
  • @types/node ^20.14.12 development
  • esbuild ^0.21.5 development
  • vite ^5.3.5 development
  • vitepress ^1.3.1 development
  • @scalar/api-reference ^1.24.59
  • @vueuse/core ^10.11.0
  • fast-glob ^3.3.2
  • vue ^3.4.34
pnpm-lock.yaml npm
  • 315 dependencies