Skip to content

Conversation

@machow
Copy link
Collaborator

@machow machow commented Oct 9, 2024

Recently, quartodoc cribbed the structure shiny used to render parameters in its documentation 😁. This PR attempts to take swap out the existing logic in the shiny docs renderer with quartodoc.

Note that I've set the CI to install quartodoc from main. Once everything looks good here and in this Great Tables PR, I can do a quartodoc release!

Here are some critical changes:

  • Introduced the ParamRow dataclass, to represent a row in a parameter table (prev just used a tuple).
  • Moved sanitization into ParamRow, rather than performing in each render method
  • New!: Added html classes to headers. E.g. "## Examples {.doc-section, .doc-section-examples}

for more information on how to create custom input bindings. (The article is about
Shiny for R, but the JavaScript and general principles are the same.)
Methods
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think I deleted this while pairing w/ Barret, but can put back in. I think it caused griffe to error when parsing the docstring (but could be wrong).


def check_if_missing_expected_example(el, converted):
if re.search(r"(^|\n)#{2,6} Examples\n", converted):
if re.search(r"(^|\n)#{2,6} Examples", converted):
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

quartodoc adds class names to the sections now, so we had to remove the newline from the regex.

@schloerke
Copy link
Collaborator

Closing in favor of #1727

@schloerke schloerke closed this Oct 10, 2024
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