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

JSDoc? #18

Closed
fenwick67 opened this issue Oct 10, 2019 · 5 comments
Closed

JSDoc? #18

fenwick67 opened this issue Oct 10, 2019 · 5 comments

Comments

@fenwick67
Copy link
Contributor

There are loads of methods in the README . If I were to rewrite these as JSDoc strings in the code, then set up an npm task for building documentation HTML, would that be useful work? It might make developing against this a bit easier (enabling intellisense etc).

@cblgh
Copy link
Member

cblgh commented Oct 10, 2019

do you have any example of that?

i don't mind, but most of the work with the docs has already been done : ) and adding a new method only takes a few seconds (copy an existing method in the docs and write new words)

commenting them in the source code would be helpful though, and if writing JSDoc strings would help you when working against this lib then i think that would be useful work

sorry if this is a circumspect answer, i just want people to do what's useful for them & create cool stuff hehe

@fenwick67
Copy link
Contributor Author

Here's a couple of examples:

jsPdf docs
phaser docs
Lodash has their own build system but it's built off of docstrings in a similar manner.

There's also jsdoc-to-markdown which could inject info from docstrings into the README.md instead of making html. That might be what I try first.

@cblgh
Copy link
Member

cblgh commented Oct 11, 2019

@fenwick67 thanks for the examples! i was still on the fence until i came across ws's way of doing it

https://github.com/websockets/ws/blob/master/doc/ws.md

so the README stays handwritten, and refers to a docs.md, which is generated by the jsdoc strings. it feels like a reasonable balance :)

also what's getting me off the fence is that really nice ToC with links, that's super useful for an overview and getting to where you want to be fast. i think the docs.md approach would be what i want for this repo ^_^

@okdistribute
Copy link
Member

might be nice to have this for lower level cabal core as well!

@cblgh
Copy link
Member

cblgh commented Oct 17, 2019

this has been merged thanks to the excellent @fenwick67 #19! now we also have a great approach to use in cabal-core ^_^

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

No branches or pull requests

3 participants