-
Notifications
You must be signed in to change notification settings - Fork 3
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
Documents CompScript's API #53
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great, thank you!
gen_docs_api.js
Outdated
|
||
// FIXME: reorder categories into a more structured order? | ||
// eg: wcif, events, groups, persons, cluster, ...? | ||
const categories = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One possibility would be to share this list with the list in 'functions'. But that goes against your comment above, and 'display' which is not that useful to document. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I found a way to make it work by creating a dedicated categories
array and filtering out based on the name.
It's also helpful for the other documentation point you made!
gen_docs_api.js
Outdated
- WCIF changes: **${mutations && mutations.length > 0 ? `${mutations.join(', ')}` : 'none'}**` | ||
|
||
const documentation = categories.map(c => { | ||
const functions = require(`./functions/${c}.js`).functions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One other thing that could be useful is a file-level 'description' that goes right under the header, explaining what is in that file. The default could be "TODO" just like the function documentation. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, I've taken a shot at this in the latest diff :)
@@ -23,7 +23,7 @@ const ClearWCIF = { | |||
object.extensions = object.extensions.filter(({ id }) => !id.startsWith("org.cubingusa.natshelper")) | |||
} | |||
} | |||
cleanupExtensions(competition) | |||
cleanupExtensions(ctx.competition) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've thrown this fix in that I totally missed in the earlier diff, sorry about that!
I found myself often going back and forth between the builtin
Help
andListFunctions
, and I figured it would be easier to just have an API reference somewhere.It's based on top of #52 so you may again want to look at the last two commits individually; the documentation can be viewed rendered by github's markdown engine here.