FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add multi-language support to snippet update script by Copilot · Pull Request #12 · BlackDadd77/python-sdk · GitHub

Repository navigation

Add multi-language support to snippet update script - #12

Draft
BlackDadd77 with Copilot wants to merge 3 commits into
mainfrom
copilot/add-ssl-support-to-container
Draft

BlackDadd77 with Copilot wants to merge 3 commits into
mainfrom
copilot/add-ssl-support-to-container

Conversation

Copilot AI commented Nov 10, 2025 •
edited
Loading

Copy link
Copy Markdown

The snippet update script was hardcoded to only handle Python files, limiting documentation to a single language.

Changes

scripts/update_readme_snippets.py

  • Added get_language_from_extension() to map file extensions to markdown language identifiers
  • Modified process_snippet_block() to detect and apply language-specific syntax highlighting
  • Supported extensions: .py (python), .sh/.bash (bash), .html/.htm (html), .json (json), .rb (ruby), .yml/.yaml (yaml)

tests/scripts/test_update_readme_snippets.py

  • Added unit tests for all supported file types and edge cases (15 tests)

CONTRIBUTING.md

  • Documented supported languages for snippet embedding

Example

Before:

<!-- snippet-source example.sh -->
```python
#!/bin/bash
echo "Hello"
After:
```markdown
<!-- snippet-source example.sh -->
```bash
#!/bin/bash
echo "Hello"
All existing Python snippets remain unchanged. The script auto-detects language from file extension.

> [!WARNING]
>
> <details>
> <summary>Firewall rules blocked me from connecting to one or more addresses (expand for details)</summary>
>
> #### I tried to connect to the following addresses, but was blocked by firewall rules:
>
> - `astral.sh`
>   - Triggering command: `curl -LsSf REDACTED` (dns block)
>
> If you need me to access, download, or install something from one of these locations, you can either:
>
> - Configure [Actions setup steps](https://gh.io/copilot/actions-setup-steps) to set up my environment, which run before the firewall is enabled
> - Add the appropriate URLs or hosts to the custom allowlist in this repository's [Copilot coding agent settings](https://github.com/BlackDadd77/python-sdk/settings/copilot/coding_agent) (admins only)
>
> </details>

<!-- START COPILOT CODING AGENT SUFFIX -->



<details>

<summary>Original prompt</summary>

> SSL complete Shell container html Jason ruby yml snippet contribute with my master


</details>



<!-- START COPILOT CODING AGENT TIPS -->
---

✨ Let Copilot coding agent [set things up for you](https://github.com/BlackDadd77/python-sdk/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits November 10, 2025 21:50
- Added support for Shell/bash, HTML, JSON, Ruby, and YAML snippets
- Enhanced get_language_from_extension() to detect file types
- Updated process_snippet_block() to use correct language identifiers
- Added comprehensive test coverage for all supported languages
- All existing Python snippets remain compatible

Co-authored-by: BlackDadd77 <179016248+BlackDadd77@users.noreply.github.com>
Co-authored-by: BlackDadd77 <179016248+BlackDadd77@users.noreply.github.com>
Copilot AI changed the title [WIP] Add SSL support to Shell container Add multi-language support to snippet update script Nov 10, 2025
Copilot AI requested a review from BlackDadd77 November 10, 2025 21:55
Repository owner locked and limited conversation to collaborators Nov 11, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL