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: ✨ align table colwidths on reference index page #971

Merged
merged 6 commits into from
Jan 20, 2025

Conversation

signekb
Copy link
Member

@signekb signekb commented Jan 16, 2025

Description

This PR customises the summarize function for layout.Sections by adding column widths to the tables.
This change only affects the tables created on the reference index page.

Full disclosure: I don't really like the way the render and summarize function(s) are set up in quartodoc, but I kept it as close to the original as possible (basically only adding the + ': {tbl-colwidths="[40,60]"}' in L70 here).

An alternative solution would be to change the output directory of quartodoc to e.g., out_index: docs/reference/index-quartodoc.qmd and then add a custom index page docs/reference/index.qmd that looks something like this:

---
tbl-colwidths: [40,60]
---

{{< include /docs/reference/index-quartodoc.qmd >}}

Effect of this PR

Before/current After

Closes #946

This PR needs an in-depth review.

Checklist

  • Updated documentation
  • Ran just run-all

signekb and others added 5 commits January 9, 2025 16:29
…ises

Whenever returns and raises don't have a "name" (which they don't have in Google style docstrings) the default layout results in empty columns (when table_style: table) or floating colons (when table_style: description-list). This custom renderer fixes that.
This function is used for creating the index page. I have copied the function from MdRenderer and added the column widths.
@signekb signekb requested a review from a team as a code owner January 16, 2025 10:42
Base automatically changed from feat/add-custom-quartodoc-renderer to main January 20, 2025 08:07
Copy link
Member

@lwjohnst86 lwjohnst86 left a comment

Choose a reason for hiding this comment

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

Yea, I don't love how quartodoc is internally implemented, but this looks fine with me 😁 we aren't building quartodoc, and it isn't high priority to make elegant, well designed code for it. Just whatever works 😛

@lwjohnst86 lwjohnst86 merged commit 90fe27d into main Jan 20, 2025
3 checks passed
@lwjohnst86 lwjohnst86 deleted the docs/align-table-colwidth-on-reference-index-page branch January 20, 2025 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Align column widths in the function overview tables to avoid splitting function names
2 participants