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

[py] remove fn def and asserts from code snippet for print page #2114

Merged
merged 2 commits into from
Dec 28, 2024

Conversation

Delta456
Copy link
Contributor

@Delta456 Delta456 commented Dec 26, 2024

User description

Thanks for contributing to the Selenium site and documentation!
A PR well described will help maintainers to review and merge it quickly

Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, and help reviewers by making them as simple and short as possible.

Description

Remove function definition and asserts from code snippet

Motivation and Context

Doesn't empathise on the test and asserts shown to the user isn't required.

Types of changes

  • Change to the site (I have double-checked the Netlify deployment, and my changes look good)
  • Code example added (and I also added the example to all translated languages)
  • Improved translation
  • Added new translation (and I also added a notice to each document missing translation)

Checklist

  • I have read the contributing document.
  • I have used hugo to render the site/docs locally and I am sure it works.

PR Type

Documentation


Description

  • Updated all code block references in print page documentation to focus on the essential print options configuration
  • Removed function definitions and assertions from Python code examples to improve readability
  • Synchronized changes across all translations (English, Japanese, Portuguese, and Chinese)
  • Made documentation more concise by showing only the relevant code parts

Changes walkthrough 📝

Relevant files
Documentation
print_page.en.md
Update Python code block references for print page documentation

website_and_docs/content/documentation/webdriver/interactions/print_page.en.md

  • Updated line ranges in code block references to exclude function
    definitions and assertions
  • Adjusted code snippets to show only the relevant print options
    configuration
  • +8/-8     
    print_page.ja.md
    Sync Japanese translation with English code block changes

    website_and_docs/content/documentation/webdriver/interactions/print_page.ja.md

  • Updated line ranges in code block references to match changes in
    English version
  • Removed function definitions and assertions from code examples
  • +8/-8     
    print_page.pt-br.md
    Sync Portuguese translation with English code block changes

    website_and_docs/content/documentation/webdriver/interactions/print_page.pt-br.md

  • Updated line ranges in code block references to match English version
  • Removed function definitions and assertions from code examples
  • +8/-8     
    print_page.zh-cn.md
    Sync Chinese translation with English code block changes 

    website_and_docs/content/documentation/webdriver/interactions/print_page.zh-cn.md

  • Updated line ranges in code block references to match English version
  • Removed function definitions and assertions from code examples
  • +8/-8     

    💡 PR-Agent usage: Comment /help "your question" on any pull request to receive relevant information

    Copy link

    netlify bot commented Dec 26, 2024

    👷 Deploy request for selenium-dev pending review.

    Visit the deploys page to approve it

    Name Link
    🔨 Latest commit 80f7649

    Copy link
    Contributor

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ No major issues detected

    Copy link
    Contributor

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Score
    General
    Fix inconsistent code block line range that overlaps with another section

    The line range in the code block reference for page ranges example appears
    incorrect. The range #L18-L26 overlaps with the paper size example range. Consider
    adjusting to #L18-L20 to match other translations.

    website_and_docs/content/documentation/webdriver/interactions/print_page.pt-br.md [56]

    -{{< gh-codeblock path="examples/python/tests/interactions/test_print_options.py#L18-L26" >}}
    +{{< gh-codeblock path="examples/python/tests/interactions/test_print_options.py#L18-L20" >}}
    • Apply this suggestion
    Suggestion importance[1-10]: 8

    Why: The incorrect line range could cause confusion and display wrong code snippets. Fixing this ensures consistency across translations and proper code example display.

    8

    Copy link
    Member

    @harsha509 harsha509 left a comment

    Choose a reason for hiding this comment

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

    LGTM
    Thank you @Delta456

    @harsha509 harsha509 merged commit de1b1b5 into SeleniumHQ:trunk Dec 28, 2024
    3 checks passed
    selenium-ci added a commit that referenced this pull request Dec 28, 2024
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    2 participants