Skip to content

Convert footnotes to GFM#98

Merged
leynos merged 3 commits intomainfrom
codex/change-numbered-footnotes-to-enumerated-footnotes
Jul 19, 2025
Merged

Convert footnotes to GFM#98
leynos merged 3 commits intomainfrom
codex/change-numbered-footnotes-to-enumerated-footnotes

Conversation

@leynos
Copy link
Copy Markdown
Owner

@leynos leynos commented Jul 19, 2025

Summary

  • convert bare numeric references to GFM footnotes
  • document references in a works cited section

Testing

  • make fmt
  • make lint
  • make test

https://chatgpt.com/codex/tasks/task_e_687ad8ebcf408322aad6793238a1fcab

Summary by Sourcery

Convert inline numeric citations in the Rust doctest guide to GitHub Flavored Markdown footnotes and append a works cited section listing the sources.

Enhancements:

  • Reflow documentation paragraphs for consistent formatting.

Documentation:

  • Replace all bare numeric references with GFM footnote markers throughout the guide.
  • Add a comprehensive works cited section at the end mapping each footnote to its source.

@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai Bot commented Jul 19, 2025

Reviewer's Guide

This PR refactors all bare numeric citations into GitHub Flavored Markdown footnotes, adds a structured “Works cited” section with footnote definitions, and converts the in-document HTML reference table into a pipe-delimited GFM table for consistency and readability.

File-Level Changes

Change Details Files
Convert inline numeric citations to GFM footnotes
  • Replaced bare numeric markers (e.g., “1”, “3”) with corresponding [^n] footnote anchors
  • Updated all in-text references to use GFM footnote syntax
  • Ensured each anchor matches a footnote definition at the end
docs/rust-doctest-dry-guide.md
Introduce a “Works cited” section with footnote definitions
  • Appended a dedicated Works cited section listing each [^n] reference in full
  • Renumbered and organized citations into proper GFM footnote definitions
  • Removed legacy numeric reference list at the end
docs/rust-doctest-dry-guide.md
Transform HTML reference table into a GFM table
  • Replaced the original markup with a pipe-delimited Markdown table
  • Preserved all column headers and row content during conversion
  • Adjusted spacing and alignment for proper GitHub rendering
  • docs/rust-doctest-dry-guide.md

    Tips and commands

    Interacting with Sourcery

    • Trigger a new review: Comment @sourcery-ai review on the pull request.
    • Continue discussions: Reply directly to Sourcery's review comments.
    • Generate a GitHub issue from a review comment: Ask Sourcery to create an
      issue from a review comment by replying to it. You can also reply to a
      review comment with @sourcery-ai issue to create an issue from it.
    • Generate a pull request title: Write @sourcery-ai anywhere in the pull
      request title to generate a title at any time. You can also comment
      @sourcery-ai title on the pull request to (re-)generate the title at any time.
    • Generate a pull request summary: Write @sourcery-ai summary anywhere in
      the pull request body to generate a PR summary at any time exactly where you
      want it. You can also comment @sourcery-ai summary on the pull request to
      (re-)generate the summary at any time.
    • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
      request to (re-)generate the reviewer's guide at any time.
    • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
      pull request to resolve all Sourcery comments. Useful if you've already
      addressed all the comments and don't want to see them anymore.
    • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
      request to dismiss all existing Sourcery reviews. Especially useful if you
      want to start fresh with a new review - don't forget to comment
      @sourcery-ai review to trigger a new review!

    Customizing Your Experience

    Access your dashboard to:

    • Enable or disable review features such as the Sourcery-generated pull request
      summary, the reviewer's guide, and others.
    • Change the review language.
    • Add, remove or edit custom review instructions.
    • Adjust other review settings.

    Getting Help

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jul 19, 2025

Warning

Rate limit exceeded

@leynos has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 3 minutes and 36 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 9c41c42 and b20ffb7.

📒 Files selected for processing (1)
  • docs/rust-doctest-dry-guide.md (9 hunks)

Summary by CodeRabbit

  • Documentation
    • Improved formatting, clarity, and consistency throughout the guide.
    • Updated citation style to use bracketed footnote references.
    • Reformatted lists, tables, and code blocks for better readability.
    • Enhanced section headings and inline code formatting.
    • No changes to technical content or code examples.

Walkthrough

Revise the docs/rust-doctest-dry-guide.md document for improved formatting, clarity, and consistency. Replace numeric citations with Markdown footnotes, reformat lists, tables, and code blocks, and update bibliographic entries. Do not alter technical content, code examples, or logic.

Changes

File(s) Change Summary
docs/rust-doctest-dry-guide.md Reformat document: convert numeric citations to footnotes, update tables and lists, clarify headings, and enhance Markdown compliance. No changes to code or technical content.

Possibly related PRs

  • Fix citation footnotes netsuke#21: Converts inline numeric citations to Markdown footnotes and updates bibliography formatting in documentation, directly paralleling these changes.
  • Run make fmt netsuke#16: Applies comprehensive editorial and formatting improvements to documentation, including table reformatting and text reflow, matching the scope of this update.

Poem

In the land of docs, a tidy sweep,
Footnotes march where numbers sleep.
Tables gleam in Markdown’s light,
Lists align, all code in sight.
No logic changed, but clarity grew—
A guide refreshed, and crisp as dew!
📚✨

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch codex/change-numbered-footnotes-to-enumerated-footnotes

🪧 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 auto-generate unit tests to generate unit tests for 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
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey @leynos - I've reviewed your changes - here's some feedback:

  • Verify that your documentation host (e.g., GitHub Pages, docs.rs) fully supports GFM-style footnotes and preview the rendered output to catch any broken references.
  • Double-check that each [^n] citation correctly matches its footnote definition to prevent orphaned or duplicate references in the works-cited section.
  • For future formatting overhauls, consider splitting large refactors into smaller commits or logical chunks to make review and validation safer and more manageable.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Verify that your documentation host (e.g., GitHub Pages, docs.rs) fully supports GFM-style footnotes and preview the rendered output to catch any broken references.
- Double-check that each [^n] citation correctly matches its footnote definition to prevent orphaned or duplicate references in the works-cited section.
- For future formatting overhauls, consider splitting large refactors into smaller commits or logical chunks to make review and validation safer and more manageable.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link
Copy Markdown
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: 5

🔭 Outside diff range comments (1)
docs/rust-doctest-dry-guide.md (1)

160-164: Use capital “OK” and the ellipsis character.

Change Ok(())OK(()), and replace <...> with to meet en-GB spelling and typographical rules.

-/// # Ok(())
+/// # OK(())
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between b33cb5d and 9c41c42.

📒 Files selected for processing (1)
  • docs/rust-doctest-dry-guide.md (8 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
docs/**/*.md

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • AGENTS.md
**/*.md

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • AGENTS.md

⚙️ CodeRabbit Configuration File

🪛 LanguageTool
docs/rust-doctest-dry-guide.md

[uncategorized] ~20-~20: Loose punctuation mark.
Context: ...a developer executes cargo test --doc, rustdoc initiates a multi-stage proce...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~61-~61: Possible missing comma found.
Context: ...te)`). This is not a bug or an oversight but a fundamental aspect of the design, enf...

(AI_HYDRA_LEO_MISSING_COMMA)


[grammar] ~80-~80: Please add a punctuation mark at the end of paragraph.
Context: ...private functions must either be marked as ignore, forgoing the test guarantee,...

(PUNCTUATION_PARAGRAPH_END)


[uncategorized] ~82-~82: Loose punctuation mark.
Context: ...tions must either be marked as ignore, forgoing the test guarantee, or be dupl...

(UNLIKELY_OPENING_PUNCTUATION)


[style] ~103-~103: This phrase is redundant. Consider using “inside”.
Context: ...): These document the item they are inside of (e.g., a module or the crate itself). T...

(OUTSIDE_OF)


[grammar] ~123-~123: Please add a punctuation mark at the end of paragraph.
Context: ...tem's purpose. For instance, an example for String::clone() should not just show...

(PUNCTUATION_PARAGRAPH_END)


[misspelling] ~142-~142: This word is normally spelled as one.
Context: ...rongly discouraged. It is considered an anti-pattern because users often copy example code v...

(EN_COMPOUNDS_ANTI_PATTERN)


[style] ~205-~205: Consider using the typographical ellipsis character here instead.
Context: ... error-handling examples, the entire fn main() -> Result<...> {... } and Ok(()) scaffolding ca...

(ELLIPSIS)


[locale-violation] ~205-~205: Lower-case ‘Ok’ is American English. For British English use “OK”.
Context: ...e fn main() -> Result<...> {... } and Ok(()) scaffolding can be hidden, pres...

(OK)


[style] ~215-~215: As an alternative to the over-used intensifier ‘very’, consider replacing this phrase.
Context: ...s can sometimes be hidden to de-clutter very simple examples. The existence of features...

(EN_WEAK_ADJECTIVE)


[style] ~221-~221: This word has been used in one of the immediately preceding sentences. Using a synonym could make your text more interesting to read, unless the repetition is intentional.
Context: ...ver, the ideal documentation example is often just a small, illustrative snippet that...

(EN_REPEATEDWORDS_OFTEN)


[style] ~242-~242: The word ‘Caveats’ is a legal term. To make your text as clear as possible to all readers, do not use this foreign term unless it is used with its legal meaning. Possible alternatives are “cautions” or “warnings”.
Context: ... | Primary Use Case & Caveats ...

(CAVEAT)


[misspelling] ~244-~244: This word is normally spelled as one.
Context: ... | Use Case: For pseudo-code, examples known to be broken, or to tem...

(EN_COMPOUNDS_PSEUDO_CODE)


[style] ~244-~244: The word ‘Caveat’ is a legal term. To make your text as clear as possible to all readers, do not use this foreign term unless it is used with its legal meaning. Possible alternatives are “caution” or “warning”.
Context: ...oken, or to temporarily disable a test. Caveat: Provides no guarantee that the code is...

(CAVEAT)


[locale-violation] ~245-~245: Lower-case ‘ok’ is American English. For British English use “OK”.
Context: ...e test passes if the code panics. | ok on panic, failed if it does not panic. ...

(OK)


[locale-violation] ~246-~246: Lower-case ‘ok’ is American English. For British English use “OK”.
Context: ...The test passes if compilation fails. | ok on compilation failure, failed if it co...

(OK)


[style] ~246-~246: The word ‘Caveat’ is a legal term. To make your text as clear as possible to all readers, do not use this foreign term unless it is used with its legal meaning. Possible alternatives are “caution” or “warning”.
Context: ...row checker or type system constraints. Caveat: Highly brittle. A future Rust version ...

(CAVEAT)


[locale-violation] ~247-~247: Lower-case ‘ok’ is American English. For British English use “OK”.
Context: ... execute it. | ok if compilation succeeds. ...

(OK)


[locale-violation] ~248-~248: Lower-case ‘ok’ is American English. For British English use “OK”.
Context: ...ecified Rust edition's rules. | ok on success. ...

(OK)


[uncategorized] ~252-~252: Loose punctuation mark.
Context: ...Detailed Attribute Breakdown - ignore: This is the bluntest instrument in the ...

(UNLIKELY_OPENING_PUNCTUATION)


[misspelling] ~256-~256: This word is normally spelled as one.
Context: ... non-Rust code blocks or illustrative pseudo-code. - should_panic: This attribute inve...

(EN_COMPOUNDS_PSEUDO_CODE)


[uncategorized] ~258-~258: Loose punctuation mark.
Context: ...ustrative pseudo-code. - should_panic: This attribute inverts the normal test ...

(UNLIKELY_OPENING_PUNCTUATION)


[style] ~261-~261: Consider using a more formal/concise alternative here.
Context: ...s successfully or panics for a reason other than the one expected (if a specific panic m...

(OTHER_THAN)


[uncategorized] ~263-~263: Loose punctuation mark.
Context: ...sage is asserted).[^3] - compile_fail: This is a powerful tool for creating ed...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~270-~270: Loose punctuation mark.
Context: ...ch would break the test.[^4] - no_run: This attribute strikes a crucial balanc...

(UNLIKELY_OPENING_PUNCTUATION)


[uncategorized] ~277-~277: Loose punctuation mark.
Context: ...thout executing it.[^5] - edition20xx: This attribute allows an example to be ...

(UNLIKELY_OPENING_PUNCTUATION)


[formatting] ~303-~303: If the ‘because’ clause is essential to the meaning, do not use a comma before the clause.
Context: ...ed by #[cfg(test)]. This will not work, because rustdoc does not enable the test co...

(COMMA_BEFORE_BECAUSE)


[grammar] ~418-~418: Please add a punctuation mark at the end of paragraph.
Context: ...mpiler.[^15] The compiler only sees the host cfg (e.g., target_os = "windows"),...

(PUNCTUATION_PARAGRAPH_END)


[locale-violation] ~452-~452: Lower-case ‘ok’ is American English. For British English use “OK”.
Context: ... runs, does nothing, and is reported as ok. While simple to write, this can be mi...

(OK)


[style] ~481-~481: Consider using the typographical ellipsis character here instead.
Context: ...ocumentation. This is achieved with the #[doc(cfg(...))] attribute, which requires enabling ...

(ELLIPSIS)


[style] ~508-~508: Since ownership is already implied, this phrasing may be redundant.
Context: ...hree distinct types of tests, each with its own purpose: - Doctests: These are ide...

(PRP_OWN)


[style] ~519-~519: Consider using the typographical ellipsis character here instead.
Context: ...dules within your source files (often mod tests {... }) and are compiled only with `#[cfg...

(ELLIPSIS)


[style] ~565-~565: Consider using the typographical ellipsis character here instead.
Context: ...ub and crates.io, where hidden lines (#...) look like ugly, commented-out code. A...

(ELLIPSIS)


[grammar] ~580-~580: Please add a punctuation mark at the end of paragraph.
Context: ... first write and debug the example as a standard #[test] function in a temporary fi...

(PUNCTUATION_PARAGRAPH_END)


[style] ~605-~605: Consider using the typographical ellipsis character here instead.
Context: ...f fallible functions, always use the fn main() -> Result<...> pattern, hiding the boilerplate. Avoi...

(ELLIPSIS)


[style] ~612-~612: Consider using the typographical ellipsis character here instead.
Context: ...ity* in the final documentation. Use #[cfg(feature = "...")] or other cfg flags inside th...

(ELLIPSIS)


[style] ~620-~620: You have already used ‘right’ in nearby sentences. Consider using an alternative word to let your writing stand out and sound more polished.
Context: ...a square peg into a round hole. Use the right tool for the job. ### Works cited [^1...

(REP_RIGHT)


[typographical] ~624-~624: To join two clauses or introduce examples, consider using an em dash.
Context: ...or the job. ### Works cited [^1]: rust - How can I write documentation tests for ...

(DASH_RULE)


[typographical] ~626-~626: Except for inverted sentences, ‘can I’ requires a question mark at the end of the sentence.
Context: ... accessed on July 15, 2025, https://stackoverflow.com/questions/70111757/how-can-i-write-documentation-tests-for-private-modules [^2]: Rustdoc doctests need fixing - ...

(MD_PRP_QUESTION_MARK)


[typographical] ~628-~628: To join two clauses or introduce examples, consider using an em dash.
Context: ...les> [^2]: Rustdoc doctests need fixing - Swatinem, accessed on July 15, 2025, ...

(DASH_RULE)


[typographical] ~631-~631: To join two clauses or introduce examples, consider using an em dash.
Context: ...fix-rustdoc/> [^3]: Documentation tests - The rustdoc book - Rust Documentation, a...

(DASH_RULE)


[typographical] ~631-~631: To join two clauses or introduce examples, consider using an em dash.
Context: ...: Documentation tests - The rustdoc book - Rust Documentation, accessed on Ju...

(DASH_RULE)


[typographical] ~641-~641: To join two clauses or introduce examples, consider using an em dash.
Context: ...> [^6]: How to organize your Rust tests - LogRocket Blog, accessed on July 15, ...

(DASH_RULE)


[typographical] ~646-~646: To join two clauses or introduce examples, consider using an em dash.
Context: ...rust/> [^8]: Writing Rust Documentation - DEV Community, accessed on July 15, 2025...

(DASH_RULE)


[typographical] ~652-~652: To join two clauses or introduce examples, consider using an em dash.
Context: ...t-is-rustdoc.html> [^10]: Documentation - Rust API Guidelines, accessed on July 15...

(DASH_RULE)


[typographical] ~655-~655: To join two clauses or introduce examples, consider using an em dash.
Context: ...1]: Best practice for doc testing README - help - The Rust Programming Langu...

(DASH_RULE)


[typographical] ~655-~655: To join two clauses or introduce examples, consider using an em dash.
Context: ...t practice for doc testing README - help - The Rust Programming Language For...

(DASH_RULE)


[typographical] ~659-~659: To join two clauses or introduce examples, consider using an em dash.
Context: ...mpile_fail doc test ignored in cfg(test) - help - The Rust Programming Langu...

(DASH_RULE)


[typographical] ~659-~659: To join two clauses or introduce examples, consider using an em dash.
Context: ...ail doc test ignored in cfg(test) - help - The Rust Programming Language For...

(DASH_RULE)


[typographical] ~666-~666: To join two clauses or introduce examples, consider using an em dash.
Context: ...or-doctests/50426> [^14]: quote_doctest - Rust - Docs.rs, access...

(DASH_RULE)


[typographical] ~666-~666: To join two clauses or introduce examples, consider using an em dash.
Context: ...ests/50426> [^14]: quote_doctest - Rust - Docs.rs, accessed on J...

(DASH_RULE)


[typographical] ~669-~669: To join two clauses or introduce examples, consider using an em dash.
Context: ...quote-doctest> [^15]: Advanced features - The rustdoc book - Rust Documentation, a...

(DASH_RULE)


[typographical] ~669-~669: To join two clauses or introduce examples, consider using an em dash.
Context: ...5]: Advanced features - The rustdoc book - Rust Documentation, accessed on J...

(DASH_RULE)


[typographical] ~672-~672: To join two clauses or introduce examples, consider using an em dash.
Context: ...doc/advanced-features.html> [^16]: rust - How can I conditionally execute a module...

(DASH_RULE)


[typographical] ~674-~674: Except for inverted sentences, ‘can I’ requires a question mark at the end of the sentence.
Context: ... accessed on July 15, 2025, https://stackoverflow.com/questions/50312190/how-can-i-conditionally-execute-a-module-level-doctest-based-on-a-feature-flag have doctests?, accessed on Ju...

(MD_PRP_QUESTION_MARK)


[uncategorized] ~679-~679: Loose punctuation mark.
Context: ...[^18]: How do you write your doc tests? : r/rust - Reddit, accessed on July 15, ...

(UNLIKELY_OPENING_PUNCTUATION)


[typographical] ~679-~679: To join two clauses or introduce examples, consider using an em dash.
Context: ...ow do you write your doc tests? : r/rust - Reddit, accessed on July 15, 2025...

(DASH_RULE)

Comment thread docs/rust-doctest-dry-guide.md Outdated
Comment thread docs/rust-doctest-dry-guide.md Outdated
Comment thread docs/rust-doctest-dry-guide.md Outdated
Comment thread docs/rust-doctest-dry-guide.md Outdated
Comment thread docs/rust-doctest-dry-guide.md Outdated
@leynos leynos merged commit 042aea2 into main Jul 19, 2025
2 checks passed
@leynos leynos deleted the codex/change-numbered-footnotes-to-enumerated-footnotes branch July 19, 2025 01:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant