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

Documents CompScript's API #53

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

viroulep
Copy link
Contributor

I found myself often going back and forth between the builtin Help and ListFunctions, 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.

gen_docs_api.js Outdated Show resolved Hide resolved
Copy link
Collaborator

@timreyn timreyn left a 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 Show resolved Hide resolved
gen_docs_api.js Outdated

// FIXME: reorder categories into a more structured order?
// eg: wcif, events, groups, persons, cluster, ...?
const categories = [
Copy link
Collaborator

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?

Copy link
Contributor Author

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
Copy link
Collaborator

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?

Copy link
Contributor Author

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)
Copy link
Contributor Author

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!

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

Successfully merging this pull request may close these issues.

2 participants