Skip to content

fix: improved layout of tables to extend to the right side of page #41

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

Merged
merged 2 commits into from
May 6, 2025

Conversation

m-jahn
Copy link
Member

@m-jahn m-jahn commented Apr 23, 2025

  • previously, tables were too confined by the TOC side bar on right side
  • with input from sphinxawesome maintainer, we can now change layout of specific pages to omit local TOC and extend main page
  • tested locally and looks much better

Summary by CodeRabbit

  • Documentation
    • Expanded the "Contributing" section with detailed instructions for setting up a local development environment and submitting changes.
    • Added a note clarifying the licensing of catalog workflows.
    • Updated documentation templates to include metadata for improved rendering and adjusted table widths for better display.
  • New Features
    • Introduced a new layout template to enhance documentation structure and responsiveness.

Copy link
Contributor

coderabbitai bot commented Apr 23, 2025

📝 Walkthrough

Walkthrough

The changes introduce a new layout template for documentation rendering and update existing markdown templates to include YAML front matter for metadata and improved table responsiveness. The README is expanded with detailed contributor instructions, including environment setup and the standard Git workflow. The new layout template provides conditional rendering of the main content area based on metadata, enhancing flexibility for documentation pages. No changes were made to exported or public entities in the codebase.

Changes

File(s) Change Summary
README.md Expanded the "Contributing" section with a detailed "Working with a local copy" guide and added a licensing clarification note.
source/_templates/all_other_workflows.md,
source/_templates/all_standardized_workflows.md
Added YAML front matter for metadata (notoc: true, description), and changed table width from 135% to 100% for improved responsiveness.
source/_templates/layout.html Introduced a new template extending !layout.html, with conditional rendering of the <main> element based on metadata, and new blocks.

Sequence Diagram(s)

sequenceDiagram
    participant Contributor
    participant GitHub
    participant LocalRepo
    participant CondaEnv

    Contributor->>GitHub: Fork repository
    Contributor->>LocalRepo: Clone fork locally
    Contributor->>CondaEnv: Set up conda environment
    Contributor->>LocalRepo: Configure environment variables
    Contributor->>LocalRepo: Build catalog data sources
    Contributor->>LocalRepo: Generate catalog web page
    Contributor->>LocalRepo: Stage, commit, and push changes
    Contributor->>GitHub: Create pull request
Loading
sequenceDiagram
    participant DocRenderer
    participant layout.html
    participant meta

    DocRenderer->>layout.html: Render page
    layout.html->>meta: Check for 'notoc'
    alt meta contains 'notoc'
        layout.html->>DocRenderer: Render <main> with simple padding
    else
        layout.html->>DocRenderer: Render <main> with grid layout and padding
    end
    layout.html->>DocRenderer: Render body block
Loading

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

♻️ Duplicate comments (1)
source/_templates/all_other_workflows.md (1)

1-4: Duplicate front‑matter check
Same as in all_standardized_workflows.md: ensure your MyST/Sphinx setup is correctly parsing the YAML front‑matter so the notoc flag is available to the layout template.

🧹 Nitpick comments (7)
README.md (7)

64-65: Split long sentence for clarity
This sentence is quite long and conflates two ideas. Consider breaking it into two separate sentences for readability.

-Ideas can be discussed on the [catalog's Issues page](https://github.com/snakemake/snakemake-workflow-catalog/issues) first, and contributions made through Github Pull Requests, see the [next section](#working-with-a-local-copy) for details.
+You can first discuss ideas on the [catalog's Issues page](https://github.com/snakemake/snakemake-workflow-catalog/issues). Contributions should then be submitted via GitHub Pull Requests—see the [Working with a local copy](#working-with-a-local-copy) section below.

66-69: Shorten heading and intro phrasing
The heading and lead‑in can be more concise. For example:

-## Working with a local copy
-In order to make contributions, you can set up a local copy of the catalog and test your changes.
+## Local setup
-To contribute, clone and build a local copy of the catalog to test your changes.
🧰 Tools
🪛 LanguageTool

[style] ~67-~67: Consider a shorter alternative to avoid wordiness.
Context: ...details. ## Working with a local copy In order to make contributions, you can set up a lo...

(IN_ORDER_TO_PREMIUM)


73-73: Hyphenate compound adjective
In “top right corner”, use a hyphen for the compound modifier:

-Click on the "Fork" button in the top right corner …
+Click on the "Fork" button in the top‑right corner …
🧰 Tools
🪛 LanguageTool

[uncategorized] ~73-~73: Consider adding a hyphen.
Context: ...b. 2. Click on the "Fork" button in the top right corner ([Github documentation: Forking ...

(TOP_LEFT_CORNER)


82-82: Condense environment setup instruction
The phrase “in order to work with the catalog locally” is verbose. Consider:

-1. Create a conda/mamba environment in order to work with the catalog locally.
+1. Create a conda/mamba environment for the catalog.
🧰 Tools
🪛 LanguageTool

[style] ~82-~82: Consider a shorter alternative to avoid wordiness.
Context: ...g: 1. Create a conda/mamba environment in order to work with the catalog locally. ```bash...

(IN_ORDER_TO_PREMIUM)


90-90: Fix missing preposition
Add “to” for correct grammar and clarity:

-The variable `TEST_REPO` is used fetch only data from a single workflow.
+The variable `TEST_REPO` is used to fetch data from a single workflow.
🧰 Tools
🪛 LanguageTool

[uncategorized] ~90-~90: Possible missing preposition found.
Context: ...ables. The variable TEST_REPO is used fetch only data from a single workflow. **...

(AI_HYDRA_LEO_MISSING_TO)


119-121: Group Git steps for brevity
Three successive “Run” steps can be combined to reduce repetition:

-5. Run `git add .` to stage your changes.
-6. Run `git commit -m "fix: your commit message"` to commit your changes.
-7. Run `git push` to push your changes to your fork on Github.
+5. Stage, commit, and push your changes:
+   ```bash
+   git add .
+   git commit -m "fix: your commit message"
+   git push
+   ```
🧰 Tools
🪛 LanguageTool

[style] ~121-~121: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...it message"to commit your changes. 7. Rungit push` to push your changes to your...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


144-144: Use period instead of exclamation for tone
For consistency with professional documentation, replace the exclamation point with a period:

-Note: All workflows collected and presented on the Catalog are licensed under their own terms!
+Note: All workflows collected and presented on the Catalog are licensed under their own terms.
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6d19532 and c833aa7.

📒 Files selected for processing (4)
  • README.md (2 hunks)
  • source/_templates/all_other_workflows.md (1 hunks)
  • source/_templates/all_standardized_workflows.md (1 hunks)
  • source/_templates/layout.html (1 hunks)
🧰 Additional context used
🪛 LanguageTool
README.md

[style] ~67-~67: Consider a shorter alternative to avoid wordiness.
Context: ...details. ## Working with a local copy In order to make contributions, you can set up a lo...

(IN_ORDER_TO_PREMIUM)


[uncategorized] ~73-~73: Consider adding a hyphen.
Context: ...b. 2. Click on the "Fork" button in the top right corner ([Github documentation: Forking ...

(TOP_LEFT_CORNER)


[style] ~82-~82: Consider a shorter alternative to avoid wordiness.
Context: ...g: 1. Create a conda/mamba environment in order to work with the catalog locally. ```bash...

(IN_ORDER_TO_PREMIUM)


[uncategorized] ~90-~90: Possible missing preposition found.
Context: ...ables. The variable TEST_REPO is used fetch only data from a single workflow. **...

(AI_HYDRA_LEO_MISSING_TO)


[style] ~121-~121: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...it message"to commit your changes. 7. Rungit push` to push your changes to your...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)

🔇 Additional comments (6)
source/_templates/layout.html (3)

1-4: Verify parent template inclusion and block override
The use of {% extends "!layout.html" %} combined with {{ super() }} looks correct to pull in the base layout content before defining your own main block. Ensure that the !layout.html path matches the theme’s template lookup (the ! prefix is specific to sphinxawesome).


5-10: Validate conditional TOC logic and metadata access
The if meta is defined and meta is not none and 'notoc' in meta check drives whether we drop the sidebar and expand the content width. Please verify in a rendered page that meta indeed contains the front‑matter keys (e.g. notoc) and that this condition fires as intended. You might also simplify to something like if meta.get('notoc') if meta is always a dict.


11-13: Approve body block placeholder
Defining an inner {% block body %} allows page templates to inject their content inside your <main> wrapper. This pattern aligns with Jinja/Sphinx best practices.

source/_templates/all_standardized_workflows.md (2)

1-4: Ensure front‑matter is parsed by MyST/Sphinx
You’ve added YAML front‑matter (notoc: true, description: ...). Confirm that your Sphinx/MyST configuration includes myst_enable_extensions = ["front_matter"] (or equivalent) so this metadata is available in the meta context for the new layout template.


13-13: Standardize table width to responsive 100%
Switching :width: from a fixed 135% to 100% ensures the table will adapt to the container width without horizontal scrolling. This change aligns with the new layout and is approved.

source/_templates/all_other_workflows.md (1)

13-13: Table width update approved
Changing the :width: attribute to 100% standardizes table sizing in line with the new layout and removes unnecessary overflow.

@cademirch cademirch self-requested a review May 5, 2025 19:08
Copy link

@cademirch cademirch left a comment

Choose a reason for hiding this comment

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

Looks great to me! Tables are much more readable, and look way nicer. Awesome work @m-jahn.

Screengrabs to show diff:
Before this PR:
smk-cat-before
With this PR:
smk-cat-after

@m-jahn m-jahn merged commit 9414e40 into snakemake:main May 6, 2025
1 check passed
@cmeesters
Copy link
Member

cmeesters commented May 7, 2025

@cademirch thank you for reviewing! - have seen my GitHub notification too late.
@m-jahn awesome work, indeed!

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.

3 participants