stdlib-js / www

Website for stdlib, a standard library for JavaScript and Node.js.
https://stdlib.io
Apache License 2.0
7 stars 8 forks source link

RFC: link to TypeScript documentation from API docs #8

Closed kgryte closed 4 years ago

kgryte commented 4 years ago

Checklist

Please ensure the following tasks are completed before submitting a feature request.

Description

Description of the feature request.

This RFC proposes to allow API docs users to directly navigate from a package's API docs to its corresponding TypeScript declarations, as hosted on the website, should they exist.

Currently, we use typedoc to generate TypeScript HTML docs, and, because of project conventions (e.g., consistent use of ./docs/types for storing declaration files), the package slugs are consistent:

https://stdlib.io/docs/ts/modules/_assert_is_anagram_docs_types_index_d_.html

In which case, we should be able to predictably resolve a API docs package to its corresponding declaration URL.

As for the API docs package top navigation element, possibly the menu item should be "TypeScript" (alongside "Tests" and "Benchmarks" and "Source"), maybe after "Source"?

As for determining whether declaration files exist, we'll probably want to modify asset database script (https://github.com/stdlib-js/www/blob/master/tools/scripts/build_api_docs_asset_database.js) to check for TypeScript docs. The one caveat being that, as with the bundles, we'll need to make sure that the TypeScript docs have been generated just prior (or are the "latest") so that the asset database does not drift from the actual available docs.

Related Issues

Does this feature request have any related issues?

No.

Questions

Any questions for reviewers?

No.

Other

Any other information relevant to this feature request? This may include screenshots, references, sample output, and/or implementation notes.

No.

Planeshifter commented 4 years ago

Closing: A link to TypeScript definitions (if available) is now present in the navbar.