Skip to content
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

Autogenerate JS Core API Docs #4021

Open
lidel opened this issue Jan 21, 2022 · 5 comments
Open

Autogenerate JS Core API Docs #4021

lidel opened this issue Jan 21, 2022 · 5 comments
Assignees
Labels
effort/days need/triage P1 topic/docs

Comments

@lidel
Copy link

@lidel lidel commented Jan 21, 2022

Problem

Right now JS Core API docs are maintained by hand as a directory with bunch of Markdown files.

This is unsustainable, docs often get out of date (#4013, #3990, #4014, #3911, etc), wasting everyone's time.

Proposed solution

cc @achingbrain @BigLep + @hugomrdias if there is any prior art for doing this in JS land

@lidel lidel added P1 topic/docs need/triage effort/days labels Jan 21, 2022
@lidel lidel added this to Weekly Candidates in Maintenance Priorities - JS Jan 21, 2022
@hugomrdias
Copy link

@hugomrdias hugomrdias commented Jan 25, 2022

The end goal was always to use https://typedoc.org/ to gen the docs, we didnt do it because the output wasn't always the best because of legacy cjs code.
You can check nft.storage client workflow https://github.com/nftstorage/nft.storage/blob/main/.github/workflows/client.yml#L79 and output https://nftstorage.github.io/nft.storage/client

@galargh
Copy link

@galargh galargh commented Feb 1, 2022

I think this might be a pretty interesting task for one of our Dev Productivity Launchpad Cadets. According to the schedule, they'll start working on issues after Feb 21. Would that timeline work here?

@laurentsenta
Copy link

@laurentsenta laurentsenta commented Mar 2, 2022

👋 I took a quick shot at this issue to try to move it forward, without much success yet,

It's not straightforward to point typedoc to ipfs-core/index.ts and get a "good looking" documentation,
it looks like typedoc doesn't resolve references import, so all we get are empty API types. (also some of our interfaces seemed to break typedoc's parser)

There is a monorepo configuration with typedoc, but I couldn't get it to work. It looks like our setup confuses typedoc: it tries to load our index.js and find its source typescript. Which doesn't exist.

I did manage to generate an equivalent of the current doc by pointing typedoc at the ipfs-core-types folder and marking every ts file as an entry point.

I see a few options:

  • Invest into typedoc to make it work with our codebase and use it /everywhere/,
  • Build our own solution, just the minimum that works with this codebase,
  • Look into other tools such as jsdoc with better-docs plugin.

Notes with all the commands & experiments I ran:

https://gist.github.com/laurentsenta/aa7c70a0b83880abe9b6ad0ffd34d488

@SgtPooki SgtPooki self-assigned this Mar 15, 2022
@SgtPooki
Copy link

@SgtPooki SgtPooki commented Mar 15, 2022

@laurentsenta @galargh

Laurent, are you planning on taking this on?

@laurentsenta
Copy link

@laurentsenta laurentsenta commented Mar 17, 2022

@SgtPooki Not right now, feel free to take over,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort/days need/triage P1 topic/docs
Projects
Development

No branches or pull requests

5 participants