Skip to content

feat: add copy button functionality to code blocks and update styles - #915

Open
ssimpson89 wants to merge 1 commit into
ctrliq:mainfrom
ssimpson89:add-copy-button
Open

feat: add copy button functionality to code blocks and update styles#915
ssimpson89 wants to merge 1 commit into
ctrliq:mainfrom
ssimpson89:add-copy-button

Conversation

@ssimpson89

Copy link
Copy Markdown
Contributor
SUMMARY

This update adds a clipboard button to code blocks to allow for direct copying. It also corrects some code blocks that had terminal info that breaks the standard convention in the docs.

ISSUE TYPE
  • Bug, Docs Fix or other nominal change
COMPONENT NAME
  • Docs

Signed-off-by: Stephen Simpson <ssimpson89@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings September 10, 2026 18:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Dark-theme CSS selectors for the new copybutton/tooltip rules are currently broader than the light-theme base rules, creating avoidable risk of unintended global styling side effects.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR enhances the Ascender Sphinx doc site by enabling “copy to clipboard” buttons on rendered code blocks via sphinx-copybutton, updates theme CSS to style the new UI in both light and dark modes, and normalizes several shell examples to avoid embedding host-specific prompts in documentation.

Changes:

  • Add and configure the sphinx-copybutton Sphinx extension, including prompt stripping and line-continuation handling for shell examples.
  • Add light/dark theme CSS rules for the copy button and tooltip, plus layout padding to prevent wrapped code from flowing under the button.
  • Update selected RST code samples to use consistent $ prompts and cleaner literal/code-block formatting.
File summaries
File Description
docs/docsite/sphinx_ascender_theme/static/css/dark.css Adds dark-mode overrides for copy button/tooltip styling.
docs/docsite/sphinx_ascender_theme/static/css/ansible.css Adds base copybutton styling plus padding to prevent pre-wrap overlap.
docs/docsite/rst/userguide/job_templates.rst Normalizes a curl example to use $ prompt and consistent indentation.
docs/docsite/rst/administration/kerberos_auth.rst Removes host-specific root prompts and improves step formatting around kinit/klist.
docs/docsite/requirements.txt Pins sphinx-copybutton in the compiled requirements lock.
docs/docsite/requirements.in Adds sphinx-copybutton to the source requirements list with rationale.
docs/docsite/conf.py Enables sphinx_copybutton and configures prompt/continuation behavior.
Review details

Suppressed comments (1)

docs/docsite/sphinx_ascender_theme/static/css/dark.css:219

  • This tooltip override is missing the .rst-content scope used by the base rule in ansible.css (.rst-content .o-tooltip--left:after). Without the scope, any .o-tooltip--left used elsewhere in the page will inherit doc-specific colors in dark mode.
html[data-theme="dark"] .o-tooltip--left:after {
    background: var(--asc-surface-raised);
    color: var(--asc-text-strong);
    border: 1px solid var(--asc-border);
}
  • Files reviewed: 7/7 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread docs/docsite/sphinx_ascender_theme/static/css/dark.css
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants