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

for interfaces that extend another, reorder properties in API reference pages #209

Closed
jgravois opened this issue May 29, 2018 · 3 comments
Closed
Assignees
Labels

Comments

@jgravois
Copy link
Contributor

jgravois commented May 29, 2018

currently we alphabetize the properties associated with an interface.

example: url and updates are listed last in IUpdateFeaturesRequestOptions

it'd be substantially easier to grok the doc for the individual interfaces that extend IRequestOptions in particular if we consistently used the following order.

  1. required
  2. optional
  3. inherited

bonus points if we could bubble up unique properties all the way to the caller doc page.

@jgravois
Copy link
Contributor Author

jgravois commented Jun 7, 2018

i took some time to look into this this afternoon and its going to be a bit tougher than i thought to implement the fix.

i didn't have a problem applying the sort when we create the typedoc.json that powers the site.

children.sort(function (a, b) {
  if (!a.flags.isOptional && b.flags.isOptional) {
    return -1;
  }
  if (a.flags.isOptional && !b.flags.isOptional) {
    return 1;
  }
  return 0;
})

the problem is that by that point, each corresponding object already has an id assigned and that is what acetate uses when it creates the actual table.

{% for id in group.children %}
{% set child = API_TOOLS.findChildById(id, children) %}

i'm gonna have to chew on this more.

@jgravois
Copy link
Contributor Author

jgravois commented Sep 18, 2018

@patrickarlt.

i think implementing your suggestion in #137 (comment) is the single most important thing that could be done to more successfully onboard new users/contributors.

i 🙏 you'll have a cycle sometime soon to take a crack at:

  • inlining requestOptions properties in the API reference page for methods
  • reordering properties so that required params are listed before optional parameters and inherited parameters are listed at the bottom

@jgravois
Copy link
Contributor Author

resolved via #531

for those following along at home, the relevant code can be found in docs/src/build-typedoc.js: rankChild().

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

No branches or pull requests

3 participants