Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

feat: docs #2

Merged
merged 1 commit into from Aug 7, 2022
Merged

feat: docs #2

merged 1 commit into from Aug 7, 2022

Conversation

valgaze
Copy link
Contributor

@valgaze valgaze commented Jul 27, 2022

Proof of concept for auto-gen'd docs in markdown, demo here

  • bun run docs to generate types then generate docs based on types in directory api-docs

  • Uses typedoc to focus contributor doc energy on high-value content rather than manually annotating + updating types & parameters

  • Use typedoc.json's publicPath field to set base path for URLs (otherwise falls back to relative prefixed with commit)

  • duplicative tsconfig.docs.json variant since extends appears to be in-flight

  • (not sure) optional "images" folder for embedding fun bun logo or gif, ex ![desc](media://bun.png)

bunidea

Without publicPath links in repo to specific code appear to have a pathing issue

@valgaze valgaze force-pushed the autodocs_idea branch 3 times, most recently from df6cea3 to d934e79 Compare July 27, 2022 06:54
@valgaze valgaze changed the title add idea for autogenerated docs idea for autogenerated docs Jul 27, 2022
Copy link
Collaborator

@xHyroM xHyroM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why npm: scripts?

@valgaze
Copy link
Contributor Author

valgaze commented Jul 27, 2022

@xHyroM Fun for benchmark

@xHyroM
Copy link
Collaborator

xHyroM commented Jul 27, 2022

Probably remove it, we don't need to have benchmark for generating docs

@xHyroM
Copy link
Collaborator

xHyroM commented Jul 27, 2022

Why api-docs folder is in .gitignore?
image

@valgaze
Copy link
Contributor Author

valgaze commented Jul 27, 2022

@xHyroM wasn't sure whether many files would make noisy source control-- I'll add to this PR

@xHyroM
Copy link
Collaborator

xHyroM commented Jul 27, 2022

resolve conflicts

@xHyroM xHyroM changed the title idea for autogenerated docs feat: autogenerated docs Jul 27, 2022
@xHyroM xHyroM changed the title feat: autogenerated docs feat: docs Jul 27, 2022
@Jarred-Sumner
Copy link
Contributor

This is nice. Can we put all of them into a single file and into the readme of this repository below "Contributing"? The goal is so you can CMD + F easily to search all of bun's types at once

@valgaze
Copy link
Contributor Author

valgaze commented Jul 27, 2022

@xHyroM -- deconflicted

@Jarred-Sumner -- There's too much data for a renderable README-- using concat-md I was getting ~6mb's and it'll probably grow over time right?

ex.
image

W/ this Typedoc appraoch, maybe a compromise would be to concat the module.md that gets generated. That way you could have a renderable readme and still get the CTRL-f search'y experience

ex. https://gist.github.com/valgaze/04dde2c997c016e0640256afb616b23d

To pull off you could do something like the following:

  • README_top.md: Top "static" template the README,

  • Concat README.top w/ api-docs/modules.md into README

{
    "special_script": "bun run docs && cp README_top.md README.md && cat api-docs/modules.md >> README.md"
}

@xHyroM
Copy link
Collaborator

xHyroM commented Jul 27, 2022

Or we can turn on GitHub pages with Jekyll theme (for now)

@paperdave
Copy link

paperdave commented Jul 28, 2022

i looked at the demo linked at the top:

image

is this intentional that it points to the bundled types as well as the source?

@xHyroM
Copy link
Collaborator

xHyroM commented Aug 2, 2022

  • can you resolve conflicts?

@valgaze
Copy link
Contributor Author

valgaze commented Aug 6, 2022

@xHyroM deconflicted

@xHyroM
Copy link
Collaborator

xHyroM commented Aug 6, 2022

@xHyroM deconflicted

@valgaze Can you exclude dist/types.d.ts ?

@xHyroM
Copy link
Collaborator

xHyroM commented Aug 7, 2022

@xHyroM
Copy link
Collaborator

xHyroM commented Aug 7, 2022

@valgaze

@valgaze
Copy link
Contributor Author

valgaze commented Aug 7, 2022

@xHyroM Alright sorted-- once merged the publicPath url's in the docs should resolve properly

@xHyroM
Copy link
Collaborator

xHyroM commented Aug 7, 2022

Okay, thanks

@xHyroM xHyroM merged commit da01e14 into oven-sh:master Aug 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants