Skip to content

Indent code blocks to make it part of ordered list#1570

Merged
avik-pal merged 1 commit intoLuxDL:mainfrom
abhro:pairwise-fusion-docstring-list
Dec 26, 2025
Merged

Indent code blocks to make it part of ordered list#1570
avik-pal merged 1 commit intoLuxDL:mainfrom
abhro:pairwise-fusion-docstring-list

Conversation

@abhro
Copy link
Contributor

@abhro abhro commented Nov 22, 2025

Note: the fix in this commit doesn't even work. The rendered list is still fragmented, with a single item list, then a code block, then another single item list, then another code block.

However, the second list does start at 2 as opposed to 1 in the current build. Unsure of the build intricacies involved here. But for most Markdown parsers, it should appear as one list.

@gemini-code-assist
Copy link

Summary of Changes

Hello @abhro, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses a documentation formatting issue by adjusting the indentation of Julia code blocks within ordered lists. The goal is to improve the rendering of these sections, making the code blocks appear as sub-elements of their respective list items, thereby enhancing readability and adherence to common Markdown interpretation, despite potential rendering quirks in the immediate build environment.

Highlights

  • Markdown Formatting: Indented Julia code blocks within an ordered list in src/layers/containers.jl to ensure they are rendered as part of the list items.
  • Partial Resolution: The author notes that while the change aims to align with standard Markdown parsers, the current build might still show fragmented lists, though the numbering is improved.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request aims to fix a Markdown rendering issue in the PairwiseFusion docstring by indenting code blocks to make them part of an ordered list. The change correctly applies a 4-space indent to the code blocks, which is standard practice. While this is a step in the right direction, the complete fix likely requires also correcting inconsistent indentation in the paragraphs of the list items themselves, as noted in the detailed comment.

Comment on lines +392 to +397
```julia
y = x[1]
for i in 1:N
y = connection(x[i + 1], layers[i](y))
end
```

Choose a reason for hiding this comment

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

medium

Indenting this code block by 4 spaces is the correct approach to associate it with the list item according to Markdown standards, and is consistent with other docstrings in this file (e.g., RepeatedLayer).

However, as you've noted, this may not fully resolve the rendering issue. The problem likely lies in the inconsistent indentation of the paragraph preceding this block. On line 390, the text is indented by 3 spaces, while the list item on line 389 effectively starts its content at column 5 (after 1.).

To fix the list rendering completely, the paragraph on line 390 should also be indented by 4 spaces to align with the text on line 389. While that line isn't part of this change, adjusting it should make your indentation of this code block work as expected.

@abhro abhro force-pushed the pairwise-fusion-docstring-list branch from 5bc9a35 to 193794e Compare December 3, 2025 14:33
@avik-pal avik-pal force-pushed the pairwise-fusion-docstring-list branch from 193794e to 4508673 Compare December 9, 2025 21:07
@abhro abhro force-pushed the pairwise-fusion-docstring-list branch from 4508673 to 9511ac3 Compare December 23, 2025 17:39
It doesn't work. The rendered list is still fragmented, with a single
item list, then a code block, then another single item list, then
another code block.

However, the second list does start at 2 as opposed to 1 in the current
build. Unsure of the build intricacies involved here. But for most
Markdown parsers, it should appear as one list.
@avik-pal avik-pal force-pushed the pairwise-fusion-docstring-list branch from 9511ac3 to 783d8f9 Compare December 25, 2025 23:28
@codecov
Copy link

codecov bot commented Dec 26, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.19%. Comparing base (9a9a4c1) to head (783d8f9).
⚠️ Report is 1 commits behind head on main.

❗ There is a different number of reports uploaded between BASE (9a9a4c1) and HEAD (783d8f9). Click for more details.

HEAD has 25 uploads less than BASE
Flag BASE (9a9a4c1) HEAD (783d8f9)
54 29
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1570      +/-   ##
==========================================
- Coverage   82.28%   74.19%   -8.10%     
==========================================
  Files         172      172              
  Lines        7141     7130      -11     
==========================================
- Hits         5876     5290     -586     
- Misses       1265     1840     +575     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@avik-pal avik-pal merged commit fa58661 into LuxDL:main Dec 26, 2025
44 of 46 checks passed
@abhro abhro deleted the pairwise-fusion-docstring-list branch December 26, 2025 01:27
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