Skip to content

Fix#4706

Open
GniLudio wants to merge 1 commit intoManimCommunity:mainfrom
GniLudio:fix_code_from_file_language_override
Open

Fix#4706
GniLudio wants to merge 1 commit intoManimCommunity:mainfrom
GniLudio:fix_code_from_file_language_override

Conversation

@GniLudio
Copy link
Copy Markdown

@GniLudio GniLudio commented Apr 25, 2026

Overview: What does this pull request change?

Allows the usage of the language parameter in combination with the code_fileparameterwhen creating aCode` object.

from manim import *

class TestScene(Scene):
    def construct(self):
        self.add(
            Code(
                code_file="main.py",
                language="text", # was ignored before
            )
        )

Motivation and Explanation: Why and how do your changes improve the library?

Further Information and Comments

  • Changes nothing for when the language parameter is omitted.
  • Especially useful when pygments can't find a lexer.

Reviewer Checklist

  • The PR title is descriptive enough for the changelog, and the PR is labeled correctly
  • If applicable: newly added non-private functions and classes have a docstring including a short summary and a PARAMETERS section
  • If applicable: newly added functions and classes are tested

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.

1 participant