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

Suggestion: Improve code snippet readability in documentation for easier copy-paste #509

Open
Programmer-RD-AI opened this issue Jan 23, 2025 · 0 comments

Comments

@Programmer-RD-AI
Copy link

Programmer-RD-AI commented Jan 23, 2025

Hi,

I wanted to suggest an improvement to the documentation format gently. While the .. testcode:: blocks are great for testing examples, they present two minor friction points for new users:

  1. Readability
    The indented code blocks without syntax highlighting make it harder to scan/understand examples quickly

  2. Copy-Paste Experience
    When copying code directly from GitHub's rendered documentation:

    • The extra indentation requires manual adjustment
    • Hidden .. testoutput:: blocks can accidentally get copied

Would you consider either:

  • Adding triple-backtick (```python) code fences alongside testcode blocks
  • Including a "Copy to Clipboard" button via Sphinx extensions (like this one)
  • Adjusting indentation levels for better copy-paste ability

This would make it even easier for folks to:

  1. Quickly try examples from the docs
  2. Experiment with Tenacity's awesome features
  3. Adopt best practices faster

I'm happy to help submit a PR if this aligns with the project's direction! Just let me know what approach you'd prefer.

Thanks!

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

No branches or pull requests

1 participant