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

docs: move description list render logic into quartodoc #1725

Closed
wants to merge 4 commits into from

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}

@@ -52,18 +52,6 @@ def _process_value(
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).

@@ -279,7 +258,7 @@ def read_file(file: str | Path, root_dir: str | Path | None = None) -> FileConte


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