Skip to content

Improve library API documentation #46

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
MasterKale opened this issue Aug 4, 2020 · 8 comments · Fixed by #66
Closed

Improve library API documentation #46

MasterKale opened this issue Aug 4, 2020 · 8 comments · Fixed by #66
Labels
documentation Improvements or additions to documentation

Comments

@MasterKale
Copy link
Owner

I'm not really happy with the TypeDoc-generated docs that are hosted at https://api-docs.simplewebauthn.dev/. It's primarily because of things like this:

Screen Shot 2020-08-04 at 9 40 35 AM

What arguments are within Options? Who knows?!

This is partially my fault for rolling with an old version of TypeDoc that works with a plugin that supports a "library" mode. I chose this approach because early testing produced adequate documentation of the monorepo's multiple libraries, but it just hasn't scaled well as the libraries' have evolved.

Now that I have a proper website up with its own docs section, though, it's feasible for me to start maintaining manually-authored API docs and host them there to achieve the desired level of exposure of the various methods' arguments.

@MasterKale
Copy link
Owner Author

I'm looking around for inspiration and found a couple of things that are inspiring me:

React-Table

Their documentation site is Docusaurus-based. API docs is its own section on the sidebar, and each method has its own breakdown of parameters. Here's an example:
https://react-table.tanstack.com/docs/api/useGroupBy

Slack's API

They must use an in-house solution. I really like their "Arguments" section listing out the various options, what's required/optional...:
https://api.slack.com/methods/chat.postMessage

@MasterKale MasterKale added the documentation Improvements or additions to documentation label Aug 4, 2020
@P4sca1
Copy link
Contributor

P4sca1 commented Sep 7, 2020

I really like the nuxt api docs:
https://nuxtjs.org/api

They have created a template for it along with a git based cms system, which may be interesting for you: https://content.nuxtjs.org/themes/docs

Here are other docs using the docs template by nuxt:
https://pwa.nuxtjs.org/
https://axios.nuxtjs.org/

@MasterKale
Copy link
Owner Author

Oh dang, Nuxt has a way for me to quickly get a site like that up and running? I went with Docusaurus because I thought I'd have to wire up my own version of Nuxt's site and opted for something that seemed more turnkey.

I honestly prefer Nuxt's format, though, so I'll take a closer look at the template you linked.

@MasterKale
Copy link
Owner Author

TypeDoc has a new beta out that may improve docs output 😮 TypeStrong/typedoc#1364 (comment)

@MasterKale
Copy link
Owner Author

Whoops, didn't mean for this to get closed (so that's what happens when you link an issue to a PR 🤔). PR #66 upgraded docs to a beta release of TypeDoc that uses its upcoming Library mode and some of the roughness that inspired this ticket has already gone away.

That said I'm reopening this ticket to continue tracking improvements. I'm still not entirely satisfied, but maybe with some luck I can help the TypeDoc project improve its library mode.

@MasterKale MasterKale reopened this Oct 28, 2020
@MasterKale
Copy link
Owner Author

I took a look at the shape of the API docs today and I think I'm satisfied enough with them to finally close out this ticket. Thanks to the awesome work delivered by @jstewmon in PR #67 back in December the docs now allow you to drill way down from SimpleWebAuthn-specific types into types defined in TypeScript's DOM library. For example, it's now possible to click through from PublicKeyCredentialRequestOptionsJSON to see types for, say, AuthenticatorTransport:

https://api-docs.simplewebauthn.dev/modules/_simplewebauthn_typescript_types.html#authenticatortransport

I'm satisfied that the API docs are sufficiently useful now.

@cleverplatypus
Copy link

Where are the API Docs? https://api-docs.simplewebauthn.dev/ seems to be down.

Cheers

@MasterKale
Copy link
Owner Author

The API docs became a huge maintenance burden for me so I took them down a while ago, I can't remember exactly when. It's been my hope that the strong typing throughout the library and the guidance I maintain at https://simplewebauthn.dev/docs/ would be sufficient.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants