Skip to content

Conversation

@ftnext
Copy link
Owner

@ftnext ftnext commented Aug 18, 2025

Fix #19

@ftnext ftnext requested a review from Copilot August 18, 2025 15:21
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for Python-related languages in the to_notion_language function by refactoring the language mapping logic and expanding support for additional Pygments language identifiers.

  • Moved the to_notion_language function from writers.py to a dedicated module literal_block.py
  • Added support for Python-related languages like pycon (Python console) and pytb (Python traceback)
  • Introduced comprehensive test coverage for the language mapping functionality

Reviewed Changes

Copilot reviewed 5 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/sphinx_notion/nodes/literal_block.py New module containing refactored to_notion_language function with expanded Python language support
src/sphinx_notion/writers.py Updated to import to_notion_language from the new module location
tests/nodes/test_literal_block.py Added comprehensive test coverage for the language mapping function
tests/roots/test-code/source/index.rst Removed test case for code block without language specification
tests/roots/test-code/expected.json Updated expected output to match the removed test case

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@ftnext ftnext merged commit 1a057c4 into main Aug 20, 2025
5 checks passed
@ftnext ftnext deleted the support-python-related-languages branch August 20, 2025 11:26
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

Successfully merging this pull request may close these issues.

Additional Python-related Language Support

2 participants