├── .github ├── FUNDING.yml ├── ISSUE_TEMPLATE │ ├── bug.yml │ ├── documentation.yml │ └── feature_request.yml ├── dependabot.yml ├── pull_request_template.md ├── scripts │ └── check_github_issues.py └── workflows │ ├── clearcache.yml │ ├── codeql-analysis.yml │ ├── draft-pdf.yml │ ├── languagetool.yml │ ├── latest_tag.yml │ ├── publish.yml │ └── tests.yml ├── .gitignore ├── .mdlc.json ├── .pre-commit-config.yaml ├── .python-version ├── .readthedocs.yaml ├── CHANGELOG.md ├── CITATION.cff ├── LICENSE.md ├── README.md ├── custom_config.yml ├── docker ├── Dockerfile ├── README.md └── texlive-profile.txt ├── docs ├── Makefile ├── make.bat └── source │ ├── _static │ ├── favicon.png │ ├── logo.png │ ├── logo_dark_docs.png │ ├── logo_dark_github.png │ ├── logo_dark_transparent.png │ ├── logo_light_transparent.png │ ├── template.diff │ ├── template.html │ ├── wizard_dark.png │ └── wizard_light.png │ ├── changelog.md │ ├── conf.py │ ├── contributing │ ├── index.md │ ├── internals.md │ └── workflow.md │ ├── docutils.conf │ ├── faq.md │ ├── features_table.md │ ├── gallery.md │ ├── index.md │ ├── installation.md │ ├── license.md │ ├── manim_or_manimgl.md │ ├── quickstart.md │ └── reference │ ├── api.md │ ├── cli.md │ ├── customize_html.md │ ├── examples.md │ ├── gui.md │ ├── html.md │ ├── index.md │ ├── ipython_magic.md │ ├── magic_example.ipynb │ ├── sharing.md │ └── sphinx_extension.md ├── example.py ├── manim-slides.qrc ├── manim_slides ├── __init__.py ├── __main__.py ├── __version__.py ├── checkhealth.py ├── commons.py ├── config.py ├── convert.py ├── defaults.py ├── docs │ ├── __init__.py │ └── manim_slides_directive.py ├── ipython │ └── ipython_magic.py ├── logger.py ├── present │ ├── __init__.py │ └── player.py ├── qt_utils.py ├── render.py ├── resources.py ├── slide │ ├── __init__.py │ ├── animation.py │ ├── base.py │ ├── manim.py │ └── manimlib.py ├── templates │ ├── __init__.py │ └── revealjs.html ├── utils.py └── wizard │ ├── __init__.py │ └── wizard.py ├── paper ├── docs.png ├── paper.bib └── paper.md ├── pyproject.toml ├── static ├── docs.png ├── example.gif ├── favicon.png ├── icon.png ├── logo.png ├── logo.py ├── logo_dark_docs.png ├── logo_dark_github.png ├── logo_dark_transparent.png ├── logo_light_transparent.png ├── make_favicon.sh ├── make_logo.sh ├── windows_quality_fix.png ├── wizard_dark.png └── wizard_light.png ├── tests ├── conftest.py ├── data │ ├── slides.py │ ├── slides │ │ ├── BasicSlide.json │ │ └── files │ │ │ └── BasicSlide │ │ │ ├── 28bf32c4df2711b07b765a647667059683133b3c45291f34692be0c845f75511.mp4 │ │ │ ├── 28bf32c4df2711b07b765a647667059683133b3c45291f34692be0c845f75511_reversed.mp4 │ │ │ ├── 5060f74bee3cb2e40a399a023e0120b3f91d348a9867c7f401db54ea337de97c.mp4 │ │ │ ├── 5060f74bee3cb2e40a399a023e0120b3f91d348a9867c7f401db54ea337de97c_reversed.mp4 │ │ │ ├── 7a5de547a0b5de2230ff3451dd680425cf0a7ea065b31e8f92b5e93527694077.mp4 │ │ │ ├── 7a5de547a0b5de2230ff3451dd680425cf0a7ea065b31e8f92b5e93527694077_reversed.mp4 │ │ │ ├── c7d0d9ccbf764d32bf316451f2d00607b8f12893e64afe215041a8aedceeb368.mp4 │ │ │ └── c7d0d9ccbf764d32bf316451f2d00607b8f12893e64afe215041a8aedceeb368_reversed.mp4 │ ├── video.mp4 │ └── video_data_uri.txt ├── test_base_slide.py ├── test_checkhealth.py ├── test_commons.py ├── test_config.py ├── test_convert.py ├── test_defaults.py ├── test_main.py ├── test_manim.py ├── test_player.py ├── test_present.py ├── test_qt_utils.py ├── test_slide.py ├── test_utils.py └── test_wizard.py └── uv.lock /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: [jeertmans] 4 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug.yml: -------------------------------------------------------------------------------- 1 | name: Bug 2 | description: Report an issue to help improve the project. 3 | title: '[BUG] ' 4 | labels: [bug] 5 | 6 | body: 7 | - type: markdown 8 | id: preamble 9 | attributes: 10 | value: | 11 | **Thank you for reporting a problem about Manim Slides!** 12 | 13 | If you know how to solve your problem, feel free to submit a PR too! 14 | 15 | > [!WARNING] 16 | > Before reporting your bug, please make sure to: 17 | > 18 | > 1. create and activate virtual environment (venv); 19 | > 2. install `manim-slides` and the necessary dependencies; 20 | > 3. and reduce your Python to a minimal working example (MWE). 21 | > 22 | > You can skip the last step if your issue occurs during installation. 23 | 24 | - type: checkboxes 25 | id: terms 26 | attributes: 27 | label: Terms 28 | description: 'By submitting this issue, I have:' 29 | options: 30 | - label: Checked the [existing issues](https://github.com/jeertmans/manim-slides/issues?q=is%3Aissue+label%3Abug+) and [discussions](https://github.com/jeertmans/manim-slides/discussions) to see if my issue had not already been reported; 31 | required: true 32 | - label: Checked the [frequently asked questions](https://manim-slides.eertmans.be/latest/faq.html); 33 | required: true 34 | - label: Read the [installation instructions](https://manim-slides.eertmans.be/latest/installation.html); 35 | required: true 36 | - label: Created a virtual environment in which I can reproduce my bug; 37 | 38 | - type: textarea 39 | id: description 40 | attributes: 41 | label: Describe the issue 42 | description: A description of the issue, also include what you tried and what didn't work. 43 | validations: 44 | required: true 45 | 46 | - type: input 47 | id: command 48 | attributes: 49 | label: Command 50 | description: | 51 | Enter the command that failed. 52 | This will be automatically formatted into code, so no need for backticks. 53 | placeholder: manim-slides render mwe.py MWE 54 | validations: 55 | required: true 56 | 57 | - type: dropdown 58 | id: issue-type 59 | attributes: 60 | label: Issue Type 61 | description: > 62 | Please select the option in the drop-down. 63 | options: 64 | - Installation issue 65 | - Visual bug when presenting (`manim-slides present`) 66 | - Bug when presenting with HTML/PowerPoint/... format (`manim-slides convert`) 67 | - Other 68 | validations: 69 | required: true 70 | 71 | - type: input 72 | id: py-version 73 | attributes: 74 | label: Python version 75 | description: | 76 | Please copy and paste the output of `python --version`. 77 | Make sure to activate your virtual environment first (if any). 78 | placeholder: Python 3.11.8 79 | validations: 80 | required: true 81 | 82 | - type: textarea 83 | id: venv 84 | attributes: 85 | label: Python environment 86 | description: | 87 | Please copy and paste the output of `manim-slides checkhealth`. 88 | Make sure to activate your virtual environment first (if any). 89 | This will be automatically formatted into code, so no need for backticks. 90 | If Manim Slides installation failed, enter 'N/A' instead. 91 | render: shell 92 | validations: 93 | required: true 94 | 95 | - type: dropdown 96 | id: platform 97 | attributes: 98 | label: What is your platform? 99 | multiple: true 100 | options: 101 | - Linux 102 | - macOS 103 | - Windows 104 | - Other (please precise below) 105 | validations: 106 | required: true 107 | 108 | - type: input 109 | id: platform-other 110 | attributes: 111 | label: Other platform 112 | description: Please answer if you have replied *Other* above. 113 | validations: 114 | required: false 115 | 116 | - type: textarea 117 | id: code 118 | attributes: 119 | label: Manim Slides Python code 120 | description: | 121 | Please copy and paste a minimal working example (MWE) of your Python code that can reproduce your bug. 122 | This will be automatically formatted into code, so no need for backticks. 123 | placeholder: | 124 | from manim import * 125 | from manim_slides import Slide 126 | 127 | 128 | class MWE(Slide): 129 | def construct(self): 130 | circle = Circle(radius=2, color=RED) 131 | dot = Dot() 132 | 133 | self.play(GrowFromCenter(circle)) 134 | 135 | self.next_slide(loop=True) 136 | self.play(MoveAlongPath(dot, circle), run_time=0.5) 137 | self.next_slide() 138 | 139 | self.play(dot.animate.move_to(ORIGIN)) 140 | render: python 141 | validations: 142 | required: false 143 | 144 | - type: textarea 145 | id: logs 146 | attributes: 147 | label: Relevant log output 148 | description: | 149 | Please copy and paste any relevant log output. 150 | This will be automatically formatted into code, so no need for backticks. 151 | render: shell 152 | validations: 153 | required: false 154 | 155 | - type: textarea 156 | id: screenshots 157 | attributes: 158 | label: Screenshots 159 | description: Please add screenshots if applicable. 160 | validations: 161 | required: false 162 | 163 | - type: textarea 164 | id: extra-info 165 | attributes: 166 | label: Additional information 167 | description: Is there anything else we should know about this bug? 168 | validations: 169 | required: false 170 | 171 | - type: textarea 172 | id: suggested-fix 173 | attributes: 174 | label: Recommended fix or suggestions 175 | description: A clear and concise description of how you want to update it. 176 | validations: 177 | required: false 178 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/documentation.yml: -------------------------------------------------------------------------------- 1 | name: Documentation 2 | description: Ask / Report an issue related to the documentation. 3 | title: '[DOC] ' 4 | labels: [documentation] 5 | 6 | body: 7 | - type: markdown 8 | id: preamble 9 | attributes: 10 | value: | 11 | **Thank you for reporting a problem about Manim Slides' documentation!** 12 | 13 | If you know how to solve your problem, feel free to submit a PR too! 14 | 15 | - type: checkboxes 16 | id: terms 17 | attributes: 18 | label: Terms 19 | description: 'By submitting this issue, I have:' 20 | options: 21 | - label: Checked the [existing issues](https://github.com/jeertmans/manim-slides/issues?q=is%3Aissue+label%3Adocumentation+) and [discussions](https://github.com/jeertmans/manim-slides/discussions) to see if my issue had not already been reported; 22 | required: true 23 | 24 | - type: textarea 25 | id: description 26 | attributes: 27 | label: Describe the issue 28 | description: A clear and concise description of the issue you encountered. 29 | validations: 30 | required: true 31 | 32 | - type: textarea 33 | id: pages 34 | attributes: 35 | label: Affected page(s) 36 | description: Link to page(s) with the problem. 37 | placeholder: | 38 | + https://manim-slides.eertmans.be/latest/installation.html 39 | + https://manim-slides.eertmans.be/latest/features_table.html 40 | validations: 41 | required: true 42 | 43 | - type: dropdown 44 | id: issue-type 45 | attributes: 46 | label: Issue type 47 | description: > 48 | Please select the option in the drop-down. 49 | options: 50 | - Typo, spelling mistake, broken link, etc. 51 | - Something is missing 52 | - Documentation enhancement 53 | - Other 54 | validations: 55 | required: true 56 | 57 | - type: textarea 58 | id: suggested-fix 59 | attributes: 60 | label: Recommended fix or suggestions 61 | description: A clear and concise description of how you want to update it. 62 | validations: 63 | required: false 64 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.yml: -------------------------------------------------------------------------------- 1 | name: Feature request 2 | description: Have a new idea/feature? Please suggest! 3 | title: '[FEATURE] ' 4 | labels: [enhancement] 5 | 6 | body: 7 | - type: markdown 8 | id: preamble 9 | attributes: 10 | value: | 11 | **Thank you for suggesting a new feature!** 12 | 13 | If you know how to implement it, feel free to submit a PR too! 14 | 15 | - type: checkboxes 16 | id: terms 17 | attributes: 18 | label: Terms 19 | description: 'By submitting this issue, I have:' 20 | options: 21 | - label: Checked the [existing issues](https://github.com/jeertmans/manim-slides/issues?q=is%3Aissue+label%3Aenhancement+) and [discussions](https://github.com/jeertmans/manim-slides/discussions) to see if my issue had not already been reported; 22 | required: true 23 | 24 | - type: textarea 25 | id: description 26 | attributes: 27 | label: Description 28 | description: A brief description of the enhancement you propose, also include what you tried and what worked. 29 | validations: 30 | required: true 31 | 32 | - type: textarea 33 | id: screenshots 34 | attributes: 35 | label: Screenshots 36 | description: Please add screenshots if applicable 37 | validations: 38 | required: false 39 | 40 | - type: textarea 41 | id: extrainfo 42 | attributes: 43 | label: Additional information 44 | description: Is there anything else we should know about this idea? 45 | validations: 46 | required: false 47 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: github-actions 9 | directory: / 10 | schedule: 11 | interval: daily 12 | labels: 13 | - dependencies 14 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## Fixes Issue 4 | 5 | 6 | 7 | 8 | 9 | ## Description 10 | 11 | 12 | 13 | ## Check List 14 | 15 | Check all the applicable boxes: 16 | 17 | - [ ] I understand that my contributions needs to pass the checks; 18 | - [ ] If I created new functions / methods, I documented them and add type hints; 19 | - [ ] If I modified already existing code, I updated the documentation accordingly; 20 | - [ ] The title of my pull request is a short description of the requested changes. 21 | 22 | ## Screenshots 23 | 24 | 25 | 26 | ## Note to reviewers 27 | 28 | 29 | -------------------------------------------------------------------------------- /.github/scripts/check_github_issues.py: -------------------------------------------------------------------------------- 1 | """Check that GitHub issues (and PR) links match the number in Markdown link.""" 2 | 3 | import glob 4 | import re 5 | import sys 6 | 7 | if __name__ == "__main__": 8 | p = re.compile( 9 | r"\[#(?P[0-9]+)\]" 10 | r"\(https://github\.com/" 11 | r"(?:[a-zA-Z0-9_-]+)/(?:[a-zA-Z0-9_-]+)/" 12 | r"(?:(?:issues)|(?:pull))/(?P[0-9]+)\)" 13 | ) 14 | 15 | ret_code = 0 16 | 17 | for glob_pattern in sys.argv[1:]: 18 | for file in glob.glob(glob_pattern, recursive=True): 19 | with open(file) as f: 20 | for i, line in enumerate(f): 21 | for m in p.finditer(line): 22 | if m.group("number1") != m.group("number2"): 23 | start, end = m.span() 24 | print(f"{file}:{i}: ", line[start:end], file=sys.stderr) # noqa: T201 25 | ret_code = 1 26 | 27 | sys.exit(ret_code) 28 | -------------------------------------------------------------------------------- /.github/workflows/clearcache.yml: -------------------------------------------------------------------------------- 1 | # From: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#force-deleting-cache-entries 2 | name: Cleanup caches by a branch 3 | on: 4 | pull_request: 5 | types: 6 | - closed 7 | 8 | jobs: 9 | cleanup: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Check out code 13 | uses: actions/checkout@v4 14 | 15 | - name: Cleanup 16 | run: | 17 | gh extension install actions/gh-actions-cache 18 | 19 | REPO=${{ github.repository }} 20 | BRANCH="refs/pull/${{ github.event.pull_request.number }}/merge" 21 | 22 | echo "Fetching list of cache key" 23 | cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH | cut -f 1 ) 24 | 25 | ## Setting this to not fail the workflow while deleting cache keys. 26 | set +e 27 | echo "Deleting caches..." 28 | for cacheKey in $cacheKeysForPR 29 | do 30 | gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm 31 | done 32 | echo "Done" 33 | env: 34 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 35 | -------------------------------------------------------------------------------- /.github/workflows/codeql-analysis.yml: -------------------------------------------------------------------------------- 1 | # For most projects, this workflow file will not need changing; you simply need 2 | # to commit it to your repository. 3 | # 4 | # You may wish to alter this file to override the set of languages analyzed, 5 | # or to provide custom queries or build logic. 6 | # 7 | # ******** NOTE ******** 8 | # We have attempted to detect the languages in your repository. Please check 9 | # the `language` matrix defined below to confirm you have the correct set of 10 | # supported CodeQL languages. 11 | # 12 | name: CodeQL 13 | 14 | on: 15 | push: 16 | branches: [main] 17 | pull_request: 18 | # The branches below must be a subset of the branches above 19 | branches: [main] 20 | schedule: 21 | - cron: 45 3 * * 2 22 | 23 | jobs: 24 | analyze: 25 | name: Analyze 26 | runs-on: ubuntu-latest 27 | permissions: 28 | actions: read 29 | contents: read 30 | security-events: write 31 | 32 | strategy: 33 | fail-fast: false 34 | matrix: 35 | language: [python] 36 | # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] 37 | # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support 38 | 39 | steps: 40 | - name: Checkout repository 41 | uses: actions/checkout@v4 42 | 43 | # Initializes the CodeQL tools for scanning. 44 | - name: Initialize CodeQL 45 | uses: github/codeql-action/init@v3 46 | with: 47 | languages: ${{ matrix.language }} 48 | # If you wish to specify custom queries, you can do so here or in a config file. 49 | # By default, queries listed here will override any specified in a config file. 50 | # Prefix the list here with "+" to use these queries and those in the config file. 51 | 52 | # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs 53 | # queries: security-extended,security-and-quality 54 | 55 | 56 | # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). 57 | # If this step fails, then you should remove it and run the build manually (see below) 58 | - name: Autobuild 59 | uses: github/codeql-action/autobuild@v3 60 | 61 | # ℹ️ Command-line programs to run using the OS shell. 62 | # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun 63 | 64 | # If the Autobuild fails above, remove it and uncomment the following three lines. 65 | # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. 66 | 67 | # - run: | 68 | # echo "Run, Build Application using script" 69 | # ./location_of_script_within_repo/buildscript.sh 70 | 71 | - name: Perform CodeQL Analysis 72 | uses: github/codeql-action/analyze@v3 73 | -------------------------------------------------------------------------------- /.github/workflows/draft-pdf.yml: -------------------------------------------------------------------------------- 1 | # Simple workflow for deploying static content to GitHub Pages 2 | name: Create JOSE Paper 3 | 4 | on: 5 | # Runs on pushes targeting the default branch 6 | push: 7 | paths: 8 | - paper/* 9 | 10 | # Allows you to run this workflow manually from the Actions tab 11 | workflow_dispatch: 12 | 13 | jobs: 14 | paper: 15 | runs-on: ubuntu-latest 16 | name: Paper Draft 17 | steps: 18 | - name: Checkout 19 | uses: actions/checkout@v4 20 | - name: Build draft PDF 21 | uses: openjournals/openjournals-draft-action@master 22 | with: 23 | journal: jose 24 | # This should be the path to the paper within your repo. 25 | paper-path: paper/paper.md 26 | - name: Upload 27 | uses: actions/upload-artifact@v4 28 | with: 29 | name: paper 30 | # This is the output path where Pandoc will write the compiled 31 | # PDF. Note, this should be the same directory as the input 32 | # paper.md 33 | path: paper/paper.pdf 34 | -------------------------------------------------------------------------------- /.github/workflows/languagetool.yml: -------------------------------------------------------------------------------- 1 | on: 2 | pull_request: 3 | workflow_dispatch: 4 | 5 | name: LanguageTool check 6 | 7 | jobs: 8 | languagetool_check: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@v4 12 | - uses: reviewdog/action-languagetool@v1 13 | with: 14 | reporter: github-pr-review 15 | level: warning 16 | -------------------------------------------------------------------------------- /.github/workflows/latest_tag.yml: -------------------------------------------------------------------------------- 1 | name: Keep the versions up-to-date 2 | 3 | on: 4 | release: 5 | types: [published, edited] 6 | 7 | jobs: 8 | actions-tagger: 9 | runs-on: windows-latest 10 | steps: 11 | - uses: Actions-R-Us/actions-tagger@latest 12 | with: 13 | publish_latest_tag: true 14 | -------------------------------------------------------------------------------- /.github/workflows/publish.yml: -------------------------------------------------------------------------------- 1 | name: Upload Packages 2 | 3 | on: 4 | push: 5 | 6 | release: 7 | types: [published] 8 | 9 | jobs: 10 | publish-python: 11 | name: Publish Python package 12 | runs-on: ubuntu-latest 13 | environment: release 14 | permissions: 15 | # IMPORTANT: this permission is mandatory for trusted publishing 16 | id-token: write 17 | steps: 18 | - name: Checkout repository 19 | uses: actions/checkout@v4 20 | 21 | - name: Setup uv 22 | uses: astral-sh/setup-uv@v4 23 | with: 24 | enable-cache: true 25 | 26 | - name: Build package 27 | run: uv build 28 | 29 | - name: Publish to PyPI 30 | if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') 31 | uses: pypa/gh-action-pypi-publish@release/v1 32 | 33 | publish-docker: 34 | name: Publish Docker image 35 | runs-on: ubuntu-latest 36 | env: 37 | REGISTRY: ghcr.io 38 | IMAGE_NAME: ${{ github.repository }} 39 | steps: 40 | - name: Checkout 41 | uses: actions/checkout@v4 42 | 43 | - name: Set up Docker Buildx 44 | uses: docker/setup-buildx-action@v3 45 | 46 | - name: Login to Docker Hub 47 | uses: docker/login-action@v3 48 | with: 49 | registry: ${{ env.REGISTRY }} 50 | username: ${{ github.actor }} 51 | password: ${{ secrets.GITHUB_TOKEN }} 52 | 53 | - name: Get Version 54 | id: create_release 55 | shell: python 56 | env: 57 | tag_act: ${{ github.ref }} 58 | run: | 59 | import os 60 | ref_tag = os.getenv('tag_act').split('/')[-1] 61 | with open(os.getenv('GITHUB_OUTPUT'), 'w') as f: 62 | print(f"tag_name={ref_tag}", file=f) 63 | 64 | - name: Build and push 65 | uses: docker/build-push-action@v6 66 | with: 67 | platforms: linux/arm64,linux/amd64 68 | file: docker/Dockerfile 69 | push: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags') }} 70 | tags: | 71 | ghcr.io/jeertmans/manim-slides:latest 72 | ghcr.io/jeertmans/manim-slides:${{ steps.create_release.outputs.tag_name }} 73 | -------------------------------------------------------------------------------- /.github/workflows/tests.yml: -------------------------------------------------------------------------------- 1 | on: 2 | push: 3 | branches: 4 | - main 5 | pull_request: 6 | workflow_dispatch: 7 | 8 | name: Tests 9 | 10 | concurrency: 11 | group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} 12 | cancel-in-progress: true 13 | 14 | jobs: 15 | pip-install: 16 | strategy: 17 | fail-fast: false 18 | matrix: 19 | os: [macos-13, ubuntu-latest, windows-latest] 20 | pyversion: ['3.9', '3.10', '3.11', '3.12'] 21 | extras: [pyside6-full, manimgl] 22 | exclude: 23 | - pyversion: '3.12' 24 | extras: manimgl 25 | runs-on: ${{ matrix.os }} 26 | steps: 27 | - name: Checkout repository 28 | uses: actions/checkout@v4 29 | 30 | - name: Install Python 31 | uses: actions/setup-python@v5 32 | with: 33 | python-version: ${{ matrix.pyversion }} 34 | cache: pip 35 | 36 | - name: Install manim dependencies on MacOS 37 | if: matrix.os == 'macos-latest' 38 | run: brew install ffmpeg py3cairo pango pkg-config scipy 39 | 40 | - name: Install manim dependencies on Ubuntu 41 | if: matrix.os == 'ubuntu-latest' 42 | run: | 43 | sudo apt-get update 44 | sudo apt install software-properties-common 45 | sudo add-apt-repository ppa:deadsnakes/ppa 46 | sudo apt-get install build-essential python${{ matrix.pyversion }}-dev libcairo2-dev libpango1.0-dev ffmpeg freeglut3-dev xvfb 47 | nohup Xvfb $DISPLAY & 48 | 49 | - name: Install Windows dependencies 50 | if: matrix.os == 'windows-latest' 51 | run: choco install ffmpeg 52 | 53 | - name: Install package 54 | shell: bash 55 | env: 56 | extras: ${{ matrix.extras }} 57 | run: pip install ".[$extras]" 58 | pytest: 59 | strategy: 60 | fail-fast: false 61 | matrix: 62 | os: [macos-latest, ubuntu-latest, windows-latest] 63 | pyversion: ['3.9', '3.10', '3.11', '3.12'] 64 | runs-on: ${{ matrix.os }} 65 | env: 66 | QT_QPA_PLATFORM: offscreen 67 | MANIM_SLIDES_VERBOSITY: error 68 | DISPLAY: :99 69 | GITHUB_WORKFLOWS: 1 70 | steps: 71 | - name: Checkout repository 72 | uses: actions/checkout@v4 73 | 74 | - name: Setup uv 75 | uses: astral-sh/setup-uv@v4 76 | with: 77 | enable-cache: true 78 | 79 | - name: Install manim dependencies on MacOS 80 | if: matrix.os == 'macos-latest' 81 | run: brew install ffmpeg py3cairo pango pkg-config scipy 82 | 83 | - name: Install manim dependencies on Ubuntu 84 | if: matrix.os == 'ubuntu-latest' 85 | run: | 86 | sudo apt-get update 87 | sudo apt-get install build-essential python3-dev libcairo2-dev libpango1.0-dev ffmpeg freeglut3-dev xvfb 88 | nohup Xvfb $DISPLAY & 89 | 90 | - name: Install Windows dependencies 91 | if: matrix.os == 'windows-latest' 92 | run: choco install ffmpeg 93 | 94 | - name: Install Mesa 95 | if: matrix.os == 'windows-latest' 96 | uses: ssciwr/setup-mesa-dist-win@v2 97 | 98 | - name: Run pytest 99 | run: uv run --python ${{ matrix.pyversion }} --frozen --group tests --no-dev pytest 100 | 101 | - name: Upload to codecov.io 102 | uses: codecov/codecov-action@v5 103 | env: 104 | CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} 105 | with: 106 | fail_ci_if_error: true 107 | 108 | markdown-link-check: 109 | runs-on: ubuntu-latest 110 | steps: 111 | - name: Checkout repository 112 | uses: actions/checkout@v4 113 | 114 | - name: Check links 115 | uses: gaurav-nelson/github-action-markdown-link-check@v1 116 | with: 117 | use-quiet-mode: yes 118 | use-verbose-mode: yes 119 | config-file: .mdlc.json 120 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Python files 2 | __pycache__/ 3 | /env 4 | /build 5 | /dist 6 | *.egg-info/ 7 | 8 | # Manim files 9 | images/ 10 | /media 11 | tests/data/media/ 12 | docs/source/media/ 13 | 14 | # ManimGL files 15 | videos/ 16 | 17 | # Manim Slides files 18 | .manim-slides.toml 19 | 20 | slides/ 21 | !tests/data/slides/ 22 | 23 | slides_assets/ 24 | 25 | # Docs 26 | docs/build/ 27 | 28 | slides.html 29 | 30 | docs/source/reference/.ipynb_checkpoints/ 31 | 32 | docs/source/_static/basic_example_assets/ 33 | 34 | docs/source/_static/basic_example.html 35 | 36 | docs/source/_static/three_d_example.html 37 | 38 | docs/source/_static/three_d_example_assets/ 39 | 40 | docs/source/reference/media/ 41 | 42 | # JOSE Paper 43 | paper/paper.pdf 44 | paper/media/ 45 | 46 | # Others 47 | .coverage* 48 | coverage.xml 49 | 50 | rendering_times.csv 51 | -------------------------------------------------------------------------------- /.mdlc.json: -------------------------------------------------------------------------------- 1 | { 2 | "replacementPatterns": [ 3 | { 4 | "pattern": "^/(?.*)$", 5 | "replacement": "https://eertmans.be/manim-slides/latest/$.html" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | ci: 2 | autofix_commit_msg: | 3 | chore(fmt): auto fixes from pre-commit.com hooks 4 | 5 | for more information, see https://pre-commit.ci 6 | autoupdate_commit_msg: 'chore(deps): pre-commit autoupdate' 7 | repos: 8 | - repo: https://github.com/pre-commit/pre-commit-hooks 9 | rev: v5.0.0 10 | hooks: 11 | - id: check-yaml 12 | - id: check-toml 13 | - id: end-of-file-fixer 14 | - id: trailing-whitespace 15 | - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks 16 | rev: v2.14.0 17 | hooks: 18 | - id: pretty-format-yaml 19 | args: [--autofix] 20 | - id: pretty-format-toml 21 | exclude: poetry.lock 22 | args: [--autofix, --trailing-commas] 23 | - repo: https://github.com/astral-sh/ruff-pre-commit 24 | rev: v0.11.7 25 | hooks: 26 | - id: ruff 27 | args: [--fix] 28 | - id: ruff-format 29 | - repo: https://github.com/pre-commit/mirrors-mypy 30 | rev: v1.15.0 31 | hooks: 32 | - id: mypy 33 | additional_dependencies: [types-requests, types-setuptools] 34 | - repo: https://github.com/codespell-project/codespell 35 | rev: v2.4.1 36 | hooks: 37 | - id: codespell 38 | additional_dependencies: 39 | - tomli 40 | - repo: local 41 | hooks: 42 | - id: github-issues 43 | name: GitHub issues link check 44 | description: Check issues (and PR) links are matching number. 45 | entry: python .github/scripts/check_github_issues.py 46 | language: system 47 | types: [markdown] 48 | -------------------------------------------------------------------------------- /.python-version: -------------------------------------------------------------------------------- 1 | 3.11 2 | -------------------------------------------------------------------------------- /.readthedocs.yaml: -------------------------------------------------------------------------------- 1 | version: 2 2 | build: 3 | os: ubuntu-22.04 4 | tools: 5 | python: '3.11' 6 | apt_packages: 7 | - libpango1.0-dev 8 | - ffmpeg 9 | jobs: 10 | post_create_environment: 11 | - asdf plugin add uv 12 | - asdf install uv latest 13 | - asdf global uv latest 14 | - UV_PROJECT_ENVIRONMENT=$READTHEDOCS_VIRTUALENV_PATH uv sync --group docs --no-dev --no-cache 15 | sphinx: 16 | builder: html 17 | configuration: docs/source/conf.py 18 | fail_on_warning: true 19 | -------------------------------------------------------------------------------- /CITATION.cff: -------------------------------------------------------------------------------- 1 | # This CITATION.cff file was generated with cffinit. 2 | # Visit https://bit.ly/cffinit to generate yours today! 3 | 4 | cff-version: 1.2.0 5 | title: Manim Slides 6 | message: >- 7 | If you use this software, please cite it using our article 8 | in the Journal of Open Source Education. 9 | type: software 10 | authors: 11 | - name: Jérome Eertmans 12 | orcid: 'https://orcid.org/0000-0002-5579-5360' 13 | website: 'https://eertmans.be' 14 | doi: 10.5281/zenodo.7971360 15 | repository-code: 'https://github.com/jeertmans/manim-slides' 16 | url: 'https://eertmans.be/manim-slides' 17 | abstract: >- 18 | Manim Slides is a Python package that makes presenting 19 | Manim animations straightforward. With minimal changes 20 | required to pre-existing code, one can slide through 21 | animations in a PowerPoint-like manner, or share its 22 | slides online using ReavealJS' power. 23 | keywords: 24 | - Education 25 | - Math Animations 26 | - Presentation Tool 27 | - PowerPoint 28 | - Python 29 | license: MIT 30 | version: v5.5.1 31 | preferred-citation: 32 | publisher: 33 | name: The Open Journal 34 | type: article 35 | authors: 36 | - name: Jérome Eertmans 37 | orcid: 'https://orcid.org/0000-0002-5579-5360' 38 | doi: 10.21105/jose.00206 39 | journal: Journal of Open Source Education 40 | month: 8 41 | year: 2023 42 | title: 'Manim Slides: A Python package for presenting Manim content anywhere' 43 | volume: 6 44 | number: 66 45 | pages: 206 46 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022-2024 Jérome Eertmans 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /custom_config.yml: -------------------------------------------------------------------------------- 1 | camera: 2 | background_color: '#000000' 3 | -------------------------------------------------------------------------------- /docker/Dockerfile: -------------------------------------------------------------------------------- 1 | # Mostly a copy from https://github.com/ManimCommunity/manim/blob/v0.18.1/docker/Dockerfile 2 | FROM python:3.11-slim 3 | 4 | RUN apt-get update -qq \ 5 | && apt-get install --no-install-recommends -y \ 6 | build-essential \ 7 | gcc \ 8 | cmake \ 9 | libcairo2-dev \ 10 | libffi-dev \ 11 | libpango1.0-dev \ 12 | freeglut3-dev \ 13 | pkg-config \ 14 | make \ 15 | wget \ 16 | ghostscript 17 | 18 | # setup a minimal texlive installation 19 | COPY docker/texlive-profile.txt /tmp/ 20 | ENV PATH=/usr/local/texlive/bin/armhf-linux:/usr/local/texlive/bin/aarch64-linux:/usr/local/texlive/bin/x86_64-linux:$PATH 21 | RUN wget -O /tmp/install-tl-unx.tar.gz http://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz && \ 22 | mkdir /tmp/install-tl && \ 23 | tar -xzf /tmp/install-tl-unx.tar.gz -C /tmp/install-tl --strip-components=1 && \ 24 | /tmp/install-tl/install-tl --profile=/tmp/texlive-profile.txt \ 25 | && tlmgr install \ 26 | amsmath babel-english cbfonts-fd cm-super count1to ctex doublestroke dvisvgm everysel \ 27 | fontspec frcursive fundus-calligra gnu-freefont jknapltx latex-bin \ 28 | mathastext microtype multitoc physics prelim2e preview ragged2e relsize rsfs \ 29 | setspace standalone tipa wasy wasysym xcolor xetex xkeyval 30 | 31 | # clone and build manim-slides 32 | COPY . /opt/manim-slides 33 | WORKDIR /opt/manim-slides 34 | 35 | RUN pip install --no-cache-dir manim[jupyterlab] .[sphinx-directive] 36 | 37 | ARG NB_USER=manimslidesuser 38 | ARG NB_UID=1000 39 | ENV USER=${NB_USER} 40 | ENV NB_UID=${NB_UID} 41 | ENV HOME=/manim-slides 42 | 43 | RUN adduser --disabled-password \ 44 | --gecos "Default user" \ 45 | --uid ${NB_UID} \ 46 | ${NB_USER} 47 | 48 | # create working directory for user to mount local directory into 49 | WORKDIR ${HOME} 50 | USER root 51 | RUN chown -R ${NB_USER}:${NB_USER} ${HOME} 52 | RUN chmod 777 ${HOME} 53 | USER ${NB_USER} 54 | 55 | CMD [ "/bin/bash" ] 56 | -------------------------------------------------------------------------------- /docker/README.md: -------------------------------------------------------------------------------- 1 | # Docker Image 2 | 3 | Manim Slides Docker image, highly inspired from the Manim Community Docker image. 4 | 5 | Building the image can be done with: 6 | 7 | ```bash 8 | docker build -t manim-slide/manin-slide:TAG -f docker/Dockerfile . 9 | ``` 10 | 11 | from the root directory of the repository. 12 | 13 | > [!WARNING] 14 | > If you run the command above from another place, 15 | > Docker will not be able to find expected files. 16 | -------------------------------------------------------------------------------- /docker/texlive-profile.txt: -------------------------------------------------------------------------------- 1 | selected_scheme scheme-minimal 2 | TEXDIR /usr/local/texlive 3 | TEXMFCONFIG ~/.texlive/texmf-config 4 | TEXMFHOME ~/texmf 5 | TEXMFLOCAL /usr/local/texlive/texmf-local 6 | TEXMFSYSCONFIG /usr/local/texlive/texmf-config 7 | TEXMFSYSVAR /usr/local/texlive/texmf-var 8 | TEXMFVAR ~/.texlive/texmf-var 9 | option_doc 0 10 | option_src 0 11 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line, and also 5 | # from the environment for the first two. 6 | SPHINXOPTS ?= 7 | SPHINXBUILD ?= sphinx-build 8 | SOURCEDIR = source 9 | BUILDDIR = build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 21 | -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=sphinx-build 9 | ) 10 | set SOURCEDIR=source 11 | set BUILDDIR=build 12 | 13 | %SPHINXBUILD% >NUL 2>NUL 14 | if errorlevel 9009 ( 15 | echo. 16 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 17 | echo.installed, then set the SPHINXBUILD environment variable to point 18 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 19 | echo.may add the Sphinx directory to PATH. 20 | echo. 21 | echo.If you don't have Sphinx installed, grab it from 22 | echo.https://www.sphinx-doc.org/ 23 | exit /b 1 24 | ) 25 | 26 | if "%1" == "" goto help 27 | 28 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 29 | goto end 30 | 31 | :help 32 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 33 | 34 | :end 35 | popd 36 | -------------------------------------------------------------------------------- /docs/source/_static/favicon.png: -------------------------------------------------------------------------------- 1 | ../../../static/favicon.png -------------------------------------------------------------------------------- /docs/source/_static/logo.png: -------------------------------------------------------------------------------- 1 | ../../../static/logo.png -------------------------------------------------------------------------------- /docs/source/_static/logo_dark_docs.png: -------------------------------------------------------------------------------- 1 | ../../../static/logo_dark_docs.png -------------------------------------------------------------------------------- /docs/source/_static/logo_dark_github.png: -------------------------------------------------------------------------------- 1 | ../../../static/logo_dark_github.png -------------------------------------------------------------------------------- /docs/source/_static/logo_dark_transparent.png: -------------------------------------------------------------------------------- 1 | ../../../static/logo_dark_transparent.png -------------------------------------------------------------------------------- /docs/source/_static/logo_light_transparent.png: -------------------------------------------------------------------------------- 1 | ../../../static/logo_light_transparent.png -------------------------------------------------------------------------------- /docs/source/_static/template.diff: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 13 | 14 | 15 | 64 | 65 | 66 | 99 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /docs/source/_static/wizard_dark.png: -------------------------------------------------------------------------------- 1 | ../../../static/wizard_dark.png -------------------------------------------------------------------------------- /docs/source/_static/wizard_light.png: -------------------------------------------------------------------------------- 1 | ../../../static/wizard_light.png -------------------------------------------------------------------------------- /docs/source/changelog.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ```{include} ../../CHANGELOG.md 4 | :start-after: 5 | :end-before: 6 | ``` 7 | -------------------------------------------------------------------------------- /docs/source/conf.py: -------------------------------------------------------------------------------- 1 | # type: ignore 2 | # Configuration file for the Sphinx documentation builder. 3 | # 4 | # For the full list of built-in configuration values, see the documentation: 5 | # https://www.sphinx-doc.org/en/master/usage/configuration.html 6 | 7 | import os 8 | import sys 9 | from datetime import date 10 | 11 | from manim_slides import __version__ 12 | 13 | assert sys.version_info >= (3, 10), "Building docs requires Python 3.10" 14 | 15 | # -- Project information ----------------------------------------------------- 16 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information 17 | 18 | project = "Manim Slides" 19 | copyright = f"2024-{date.today().year}, Jérome Eertmans" 20 | author = "Jérome Eertmans" 21 | version = __version__ 22 | 23 | # -- General configuration --------------------------------------------------- 24 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration 25 | 26 | extensions = [ 27 | # Built-in 28 | "sphinx.ext.autodoc", 29 | "sphinx.ext.intersphinx", 30 | "sphinx.ext.viewcode", 31 | # Additional 32 | "nbsphinx", 33 | "myst_parser", 34 | "sphinxcontrib.programoutput", 35 | "sphinxext.opengraph", 36 | "sphinx_click", 37 | "sphinx_copybutton", 38 | "sphinx_design", 39 | # Custom 40 | "manim_slides.docs.manim_slides_directive", 41 | ] 42 | 43 | autodoc_typehints = "both" 44 | 45 | myst_enable_extensions = [ 46 | "colon_fence", 47 | "html_admonition", 48 | ] 49 | 50 | templates_path = ["_templates"] 51 | exclude_patterns = [] 52 | 53 | # Removes the 'package.module' part from package.module.Class 54 | add_module_names = False 55 | 56 | # -- Options for HTML output ------------------------------------------------- 57 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output 58 | 59 | html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "/") 60 | html_theme = "furo" 61 | html_static_path = ["_static"] 62 | html_favicon = "_static/favicon.png" 63 | 64 | html_theme_options = { 65 | "light_logo": "logo_light_transparent.png", 66 | "dark_logo": "logo_dark_transparent.png", 67 | "footer_icons": [ 68 | { 69 | "name": "GitHub", 70 | "url": "https://github.com/jeertmans/manim-slides", 71 | "html": """ 72 | 73 | 74 | 75 | """, 76 | "class": "", 77 | }, 78 | ], 79 | "source_repository": "https://github.com/jeertmans/manim-slides/", 80 | "source_branch": "main", 81 | "source_directory": "docs/source/", 82 | } 83 | 84 | # -- Intersphinx mapping 85 | 86 | intersphinx_mapping = { 87 | "python": ("https://docs.python.org/3", None), 88 | "manim": ("https://docs.manim.community/en/stable/", None), 89 | "manimlib": ("https://3b1b.github.io/manim/", None), 90 | "numpy": ("https://numpy.org/doc/stable/", None), 91 | } 92 | 93 | # -- OpenGraph settings 94 | 95 | ogp_site_url = "https://eertmans.be/manim-slides/" 96 | ogp_use_first_image = True 97 | -------------------------------------------------------------------------------- /docs/source/contributing/index.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Thank you for your interest in Manim Slides! ✨ 4 | 5 | Manim Slides is an open source project, first created as a fork of 6 | [manim-presentation](https://github.com/galatolofederico/manim-presentation) 7 | (now deprecated in favor to Manim Slides), 8 | and we welcome contributions of all forms. 9 | 10 | This section is here to help fist-time contributors know how they can help this 11 | project grow. Whether you are already familiar with Manim or GitHub, 12 | it is worth taking a few minutes to read those documents! 13 | 14 | ```{toctree} 15 | :hidden: 16 | 17 | workflow 18 | internals 19 | ``` 20 | 21 | [Workflow](/contributing/workflow) 22 | : how to work on this project. Start here if you're a new contributor. 23 | 24 | [Internals](/contributing/internals) 25 | : how Manim Slides is built and how the various parts of it work. 26 | 27 | ## Reporting an Issue 28 | 29 | ```{include} ../../../README.md 30 | :start-after: 31 | :end-before: 32 | ``` 33 | 34 | ## Seeking for Help 35 | 36 | ```{include} ../../../README.md 37 | :start-after: 38 | :end-before: 39 | ``` 40 | 41 | ## Contact 42 | 43 | ```{include} ../../../README.md 44 | :start-after: 45 | :end-before: 46 | ``` 47 | -------------------------------------------------------------------------------- /docs/source/contributing/internals.md: -------------------------------------------------------------------------------- 1 | # Internals 2 | 3 | Manim-Slides' work in split in two steps: first, when rendering animation, and, second, when converting multiple animations into one slides presentation. 4 | 5 | ## Rendering 6 | 7 | To render animations, Manim Slides simply uses Manim or ManimGL, and creates some additional output files that it needs for the presentation. 8 | 9 | ## Slides presentation 10 | 11 | Manim Slides searches for the local artifacts it generated previously, and concatenates them into one presentation. For the graphical interface, it uses `PySide6`. 12 | -------------------------------------------------------------------------------- /docs/source/contributing/workflow.md: -------------------------------------------------------------------------------- 1 | # Workflow 2 | 3 | This document is there to help you recreate a working environment for Manim Slides. 4 | 5 | ## Dependencies 6 | 7 | ```{include} ../installation.md 8 | :start-after: 9 | :end-before: 10 | ``` 11 | 12 | ## Forking the repository and cloning it locally 13 | 14 | We use GitHub to host Manim Slides' repository, and we encourage contributors to use git. 15 | 16 | Useful links: 17 | 18 | * [GitHub's Hello World](https://docs.github.com/en/get-started/quickstart/hello-world). 19 | * [GitHub Pull Request in 100 Seconds](https://www.youtube.com/watch?v=8lGpZkjnkt4&ab_channel=Fireship). 20 | 21 | Once you feel comfortable with git and GitHub, 22 | [fork](https://github.com/jeertmans/manim-slides/fork) 23 | the repository, and clone it locally. 24 | 25 | As for every Python project, using virtual environment is recommended to avoid 26 | conflicts between modules. 27 | For this project, we use [uv](https://github.com/astral-sh/uv) to easily manage project 28 | and development dependencies. If not already, please install this tool. 29 | 30 | ## Installing Python modules 31 | 32 | With uv, installation becomes straightforward: 33 | 34 | ```bash 35 | uv sync 36 | ``` 37 | 38 | :::{note} 39 | You still need the same dependencies as to install Manim and ManimGL, 40 | so please check their respective installation guides. 41 | ::: 42 | 43 | ## Running commands 44 | 45 | Because modules are installed in a new Python environment, 46 | you cannot use them directly in the shell. 47 | Instead, you either need to prepend `uv run` to any command, e.g.: 48 | 49 | ```bash 50 | uv run manim-slides wizard 51 | ``` 52 | 53 | ## Testing your code 54 | 55 | Most of the tests are done with GitHub actions, thus not on your computer. 56 | The only command you should run locally is: 57 | 58 | ```bash 59 | uv run pre-commit run --all-files 60 | ``` 61 | 62 | This runs a few linter and formatter to make sure the code quality and style stay 63 | constant across time. 64 | If a warning or an error is displayed, please fix it before going to next step. 65 | 66 | For testing your code, simply run: 67 | 68 | ```bash 69 | uv run pytest 70 | ``` 71 | 72 | ## Building the documentation 73 | 74 | The documentation is generated using Sphinx, based on the content 75 | in `docs/source` and in the `manim_slides` Python package. 76 | 77 | To generate the documentation, run the following: 78 | 79 | ```bash 80 | cd docs 81 | uv run make html 82 | ``` 83 | 84 | Then, the output index file is located at `docs/build/html/index.html` and 85 | can be opened with any modern browser. 86 | 87 | :::{warning} 88 | Building the documentation can take quite some time, especially 89 | the first time as it needs to render all the animations. 90 | 91 | Further builds should run faster. 92 | ::: 93 | 94 | ## Proposing changes 95 | 96 | Once you feel ready and think your contribution is ready to be reviewed, 97 | create a [pull request](https://github.com/jeertmans/manim-slides/pulls) 98 | and wait for a reviewer to check your work! 99 | 100 | Many thanks to you! 101 | -------------------------------------------------------------------------------- /docs/source/docutils.conf: -------------------------------------------------------------------------------- 1 | [restructuredtext parser] 2 | syntax_highlight = short 3 | -------------------------------------------------------------------------------- /docs/source/faq.md: -------------------------------------------------------------------------------- 1 | # Frequently Asked Questions 2 | 3 | This page summarizes a few of the most frequently asked questions 4 | when using Manim Slides. 5 | 6 | They are organized by topic. 7 | 8 | If your question is not here, please first look through the 9 | [open **and closed** issues on GitHub](https://github.com/jeertmans/manim-slides/issues?q=is%3Aissue) 10 | or within the [discussions](https://github.com/jeertmans/manim-slides/discussions). 11 | 12 | If you still cannot find help after that, do not hesitate to create 13 | your own issue or discussion on GitHub! 14 | 15 | ## Installing 16 | 17 | Everything related to installing Manim-Slides. 18 | 19 | Please do not forget the carefully read through 20 | the [installation](/installation) page! 21 | 22 | ## Rendering 23 | 24 | Questions related to `manim-slides render [SCENES]...`, 25 | 26 | ### I cannot render with ManimGL 27 | 28 | ManimGL support is only guaranteed to work 29 | on a very minimal set of versions, because it differs quite a lot from ManimCE, 30 | and its development is not very active. 31 | 32 | The typical issue is that ManimGL `<1.7.1` needs an outdated NumPy version, but 33 | can be resolved by manually downgrading NumPy, or upgrading ManimGL (**recommended**). 34 | 35 | ### Presenting 36 | 37 | Questions related to `manim-slides present [SCENES]...`, 38 | or `manim-slides [SCENES]...` for short. 39 | 40 | ### Can I have interactive slides 41 | 42 | No. Slides are pre-rendered static videos files 43 | and cannot be modified on the fly. 44 | 45 | If you need new to have some kind of interactive, look 46 | at the preview feature coupled with the OpenGL renderer 47 | with ManimCE or ManimGL. 48 | 49 | ### Slides go black when video finishes 50 | 51 | This is an issue with Qt, 52 | which cannot be solved on all platforms and Python versions, 53 | see [#293](https://github.com/jeertmans/manim-slides/issues/293). 54 | 55 | Recent version of Manim Slides, i.e., `manim-slides>5.1.7`, come 56 | with a fix that should work fine. 57 | 58 | ### How to increase quality on Windows 59 | 60 | On Windows platform, one may encounter a lower image resolution than expected. 61 | Usually, this is observed because Windows rescales every application to 62 | fit the screen. 63 | As found by [@arashash](https://github.com/arashash), 64 | in [#20](https://github.com/jeertmans/manim-slides/issues/20), 65 | the problem can be addressed by changing the scaling factor to 100%: 66 | 67 |

68 | Windows Fix Scaling 72 |

73 | 74 | in *Settings*->*Display*. 75 | 76 | ## Converting to any format 77 | 78 | Questions that apply to all output formats when using 79 | `manim-slides convert [SCENES]...`. 80 | 81 | ### What are all possible configuration options 82 | 83 | Configuration options can be specified with the syntax 84 | `-c=`. 85 | 86 | To list all accepted options, use `manim-slides convert --to=FORMAT --show-config`, 87 | where `FORMAT` is one of the supported formats. 88 | This will also show the default value for each option. 89 | 90 | ### How to retrieve the current template 91 | 92 | If you want to create your own template, the best is to start from the default one. 93 | 94 | You can either download it from the 95 | [template folder](https://github.com/jeertmans/manim-slides/tree/main/manim_slides/templates) 96 | or use the `manim-slides convert --to=FORMAT --show-template` command, 97 | where `FORMAT` is one of the supported formats. 98 | 99 | ## Converting to HTML 100 | 101 | Questions related to `manim-slides convert [SCENES]... output.html`. 102 | 103 | ### I moved my `.html` file and it stopped working 104 | 105 | If you did not specify `--one-file` (or `-cone_file=true`) when converting, 106 | then Manim Slides generated a folder containing all 107 | the video files, in the same folder as the HTML 108 | output. As the path to video files is a relative path, 109 | you need to move the HTML **and its assets** altogether. 110 | 111 | ## Converting to PPTX 112 | 113 | Questions related to `manim-slides convert [SCENES]... output.pptx`. 114 | 115 | ### My media stop playing after a few slides 116 | 117 | This issue is (probably) caused by PowerPoint never freeing 118 | memory, causing memory allocation errors, and can be partially 119 | solved by reducing the video quality or the number of slides, 120 | see [#392](https://github.com/jeertmans/manim-slides/issues/392). 121 | 122 | Another solution, suggested by [@Azercoco](https://github.com/Azercoco) in 123 | [#392 (comment)](https://github.com/jeertmans/manim-slides/issues/392#issuecomment-2368198106), 124 | is to disable hardware/GPU acceleration. 125 | -------------------------------------------------------------------------------- /docs/source/features_table.md: -------------------------------------------------------------------------------- 1 | # Features Table 2 | 3 | The following summarizes the different presentation features Manim Slides offers. 4 | 5 | :::{table} Comparison of the different presentation methods. 6 | :widths: auto 7 | :align: center 8 | 9 | | Feature / Constraint | [`present`](reference/cli.md) | [`convert --to=html`](reference/cli.md) | [`convert --to=pptx`](reference/cli.md) | [`convert --to=pdf`](reference/cli.md) 10 | | :--- | :---: | :---: | :---: | :---: | 11 | | Basic navigation through slides | Yes | Yes | Yes | Yes (static image) | 12 | | Replay slide | Yes | No | No | N/A | 13 | | Pause animation | Yes | Yes | No | N/A | 14 | | Play slide in reverse | Yes | No | No | N/A | 15 | | Slide count | Yes | Yes (optional) | Yes (optional) | N/A | 16 | | Needs Python with Manim Slides installed | Yes | No | No | No 17 | | Requires internet access | No | Depends[^1] | No | No | 18 | | Auto. play slides | Yes | Yes | Yes | N/A | 19 | | Loops support | Yes | Yes | Yes | N/A | 20 | | Fully customizable | No | Yes (`--use-template` option) | No | No | 21 | | Other dependencies | None | A modern web browser | PowerPoint or LibreOffice Impress[^2] | None | 22 | | Works cross-platforms | Yes | Yes | Partly[^2][^3] | Yes | 23 | ::: 24 | 25 | [^1]: By default, HTML assets are loaded from the internet, but they can be 26 | pre-downloaded and embedded in the HTML file at conversion time. 27 | [^2]: If you encounter a problem where slides do not automatically play or loops do not work, 28 | please 29 | [file an issue on GitHub](https://github.com/jeertmans/manim-slides/issues/new/choose). 30 | [^3]: PowerPoint online does not seem to support automatic playing of videos, 31 | so you need LibreOffice Impress on Linux platforms. 32 | -------------------------------------------------------------------------------- /docs/source/gallery.md: -------------------------------------------------------------------------------- 1 | # Examples Gallery 2 | 3 | With Manim, the only limit to what you can create is your imagination! 4 | *This also applies to Manim Slides.* 5 | 6 | As the field of possibilities is infinitely vast, 7 | it's often useful to **learn** how to use Manim Slides **based on examples**. 8 | 9 | The aim of this page is to share with you the creations of some 10 | Manim Slides users, to hopefully inspire you! 11 | Most of them use HTML conversion to make them accessible via a website. 12 | 13 | If you too have created content with Manim Slides that is available online 14 | (e.g., a YouTube video or website), 15 | don't hesitate to contact us so that we can share your content on this page! 16 | 17 | ## Scientif Research 18 | 19 | Below are people that dissimenate their research results 20 | using Manim Slides presentations. 21 | 22 | ### Daniel Panizo Pérez 23 | 24 | Daniel publishes his presentations on *Cosmology, String Theory and related* 25 | topics on his 26 | [personal website](https://panopepino.github.io/web_page/main_page/slides.html). https://panopepino.github.io/web_page/main_page/slides.html 27 | 28 | For example, below are the slides of a seminar he gave titled 29 | [Our Universe on a (Dark) Bubble](https://panopepino.github.io/web_page/main_page/presentations/2023_11_long/LS.html). 30 | 31 |
32 | 42 |
43 | 44 | He also shares his code on a public 45 | [GitHub repository](https://github.com/PanoPepino/mtheoretical). 46 | 47 | ### Jérome Eertmans 48 | 49 | Jérome, the author of Manim Slides, publishes his presentations 50 | on the topic of *Ray Tracing applied to Radio Propagations* on his 51 | [personal website](https://eertmans.be). He also uses Manim Slides 52 | for presenting at conferences using the *PowerPoint* or HTML conversion. 53 | 54 | For example, below are the slides of his 55 | [PhD confirmation](https://eertmans.be/posts/confirmation2023-presentation/). 56 | 57 |
58 | 68 |
69 | 70 | ## School Work 71 | 72 | Below are people that used Manim Slides for school presentations. 73 | 74 | *This list is currently empty. Please reach out to us if you have examples 75 | to share!* 76 | -------------------------------------------------------------------------------- /docs/source/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | hide-toc: true 3 | og:description: Manim Slides makes creating slides with Manim super easy! 4 | --- 5 | 6 | ```{eval-rst} 7 | .. image:: _static/logo_light_transparent.png 8 | :width: 600px 9 | :align: center 10 | :class: only-light 11 | :alt: Manim Slide logo 12 | ``` 13 | 14 | ```{eval-rst} 15 | .. image:: _static/logo_dark_transparent.png 16 | :width: 600px 17 | :align: center 18 | :class: only-dark 19 | :alt: Manim Slide logo 20 | ``` 21 | 22 | # Welcome to Manim Slide's documentation 23 | 24 | Manim Slides makes creating slides with Manim super easy! 25 | 26 | In a [very few steps](/quickstart), 27 | you can create slides and present them either using the GUI, or your browser. 28 | 29 | Slide through the demo below to get a quick glimpse on what you can do with 30 | Manim Slides. 31 | 32 | ```{eval-rst} 33 | .. manim-slides:: ../../example.py:ConvertExample 34 | :hide_source: 35 | :quality: high 36 | ``` 37 | 38 | ```{toctree} 39 | :hidden: 40 | 41 | quickstart 42 | installation 43 | reference/index 44 | features_table 45 | manim_or_manimgl 46 | gallery 47 | faq 48 | ``` 49 | 50 | ```{toctree} 51 | :caption: Development 52 | :hidden: 53 | 54 | contributing/index 55 | changelog 56 | license 57 | ``` 58 | -------------------------------------------------------------------------------- /docs/source/installation.md: -------------------------------------------------------------------------------- 1 | # Installation 2 | 3 | While installing Manim Slides and its dependencies on your global Python is fine, 4 | we recommend using a virtual environment 5 | (e.g., [venv](https://docs.python.org/3/tutorial/venv.html)) for a local installation. 6 | 7 | Therefore, the following documentation will install Manim Slides using 8 | [pipx](https://pipx.pypa.io/). This tool is a drop-in replacement 9 | for installing Python packages that ship with one or more executable. 10 | 11 | The benefit of using pipx is that it will automatically create a new virtual 12 | environment for every package you install. 13 | 14 | :::{note} 15 | Every time you read `pipx install`, you can use `pip install` instead, 16 | if you are working in a virtual environment or else. 17 | ::: 18 | 19 | ## Dependencies 20 | 21 | 22 | 23 | Manim Slides requires either Manim or ManimGL to be installed, along 24 | with their dependencies. 25 | Having both packages installed is fine too. 26 | 27 | If none of those packages are installed, 28 | please refer to their specific installation guidelines: 29 | - [Manim](https://docs.manim.community/en/stable/installation.html) 30 | - [ManimGL](https://3b1b.github.io/manim/getting_started/installation.html) 31 | 32 | 33 | 34 | ## Pip Install 35 | 36 | The recommended way to install the latest release 37 | with all features is to use pipx: 38 | 39 | ```bash 40 | pipx install -U "manim-slides[pyside6-full]" 41 | ``` 42 | 43 | :::{tip} 44 | While not necessary, the `-U` indicates that we would 45 | like to upgrade to the latest version available, 46 | if Manim Slides is already installed. 47 | ::: 48 | 49 | :::{note} 50 | The quotes `"` are added because not all shell support unquoted 51 | brackets (e.g., zsh) or commas (e.g., Windows). 52 | ::: 53 | 54 | You can check that Manim Slides was correctly installed with: 55 | 56 | ```bash 57 | manim-slides --version 58 | ``` 59 | 60 | ## Custom install 61 | 62 | If you want more control on what dependencies are installed, 63 | you can always install the bare minimal dependencies with: 64 | 65 | ```bash 66 | pipx install -U manim-slides 67 | ``` 68 | 69 | And install additional dependencies later. 70 | 71 | Optionally, you can also install Manim or ManimGL using extras[^1]: 72 | 73 | ```bash 74 | pipx install -U "manim-slides[manim]" # For Manim 75 | # or 76 | pipx install -U "manim-slides[manimgl]" # For ManimGL 77 | ``` 78 | 79 | For optional dependencies documentation, see 80 | [next section](#optional-dependencies). 81 | 82 | :::{warning} 83 | If you are installing with pipx, this is mandatory to at least include 84 | either `manim` or `manimgl`. 85 | ::: 86 | 87 | [^1]: You still need to have Manim or ManimGL platform-specific dependencies 88 | installed on your computer. 89 | 90 | ## Optional dependencies 91 | 92 | Along with the optional dependencies for Manim and ManimGL, 93 | Manim Slides offers additional *extras*, that can be activated 94 | using optional dependencies: 95 | 96 | - `full`, to include `magic`, `manim`, and 97 | `sphinx-directive` extras (see below); 98 | - `magic`, to include a Jupyter magic to render 99 | animations inside notebooks. This automatically installs `manim`, 100 | and does not work with ManimGL; 101 | - `manim` and `manimgl`, for installing the corresponding 102 | dependencies; 103 | - `pyqt6` to include PyQt6 Qt bindings; 104 | - `pyqt6-full` to include `full` and `pyqt6`; 105 | - `pyside6` to include PySide6 Qt bindings. Those bindings are available 106 | on most platforms and Python version, except on Python 3.12[^2]; 107 | - `pyside6-full` to include `full` and `pyside6`; 108 | - `sphinx-directive`, to generate presentation inside your Sphinx 109 | documentation. This automatically installs `manim`, 110 | and does not work with ManimGL. 111 | 112 | Installing those extras can be done with the following syntax: 113 | 114 | ```bash 115 | pipx install -U "manim-slides[extra1,extra2]" 116 | ``` 117 | 118 | [^2]: Actually, PySide6 can be installed on Python 3.12, but you will then 119 | observe the same visual bug as with PyQt6. 120 | 121 | ## Nixpkgs installation 122 | 123 | Manim Slides is distributed under Nixpkgs >=24.05. 124 | If you are using Nix or NixOS, you can find Manim Slides under: 125 | 126 | - `nixpkgs.manim-slides`, which is meant to be a stand alone application and 127 | includes PyQt6 (see above); 128 | - `nixpkgs.python3Packages.manim-slides`, which is meant to be used as a 129 | module (for notebook magics), and includes IPython but does not include 130 | any Qt binding. 131 | 132 | You can try out the Manim Slides package with: 133 | 134 | ```sh 135 | nix-shell -p manim ffmpeg manim-slides 136 | ``` 137 | 138 | or by adding it to your 139 | [configuration file](https://nixos.org/manual/nixos/stable/#sec-package-management). 140 | 141 | Alternatively, you can try Manim Slides in a Python environment with: 142 | 143 | ```sh 144 | nix-shell -p manim ffmpeg "python3.withPackages(ps: with ps; [ manim-slides, ...])" 145 | ``` 146 | 147 | or bundle this into [your Nix environment](https://wiki.nixos.org/wiki/Python). 148 | 149 | :::{note} 150 | Nix does not currently support `manimgl`. 151 | ::: 152 | 153 | ## When you need a Qt backend 154 | 155 | Before `v5.1`, Manim Slides automatically included PySide6 as 156 | a Qt backend. As only `manim-slides present` and `manim-slides wizard` 157 | command need a graphical library, and installing PySide6 on all platforms 158 | and Python version can be sometimes complicated, Manim Slides chooses 159 | **not to include** any Qt backend. 160 | 161 | The use can choose between PySide6 (best) and PyQt6, depending on their 162 | availability and licensing rules. 163 | 164 | As of `v5.1`, you **need** to have Qt bindings installed to use 165 | `manim-slides present` or `manim-slides wizard`. The recommended way to 166 | install those are via optional dependencies, as explained above. 167 | 168 | ## Install from source 169 | 170 | An alternative way to install Manim Slides is to clone the git repository, 171 | and build the package from source. Read the 172 | [contributing guide](/contributing/workflow) 173 | to know how to process. 174 | -------------------------------------------------------------------------------- /docs/source/license.md: -------------------------------------------------------------------------------- 1 | # License 2 | 3 | 4 | ```{include} ../../LICENSE.md 5 | ``` 6 | -------------------------------------------------------------------------------- /docs/source/manim_or_manimgl.md: -------------------------------------------------------------------------------- 1 | # Manim or ManimGL 2 | 3 | Manim Slides supports both Manim (Community Edition) and ManimGL (by 3b1b). 4 | 5 | Because both modules have slightly different APIs, Manim Slides needs to know 6 | which Manim API you are using, to import the correct module. 7 | 8 | ## Default Behavior 9 | 10 | By default, Manim Slides looks at {py:data}`sys.modules` and chooses the first 11 | Manim package that is already imported: `manim` for Manim, 12 | `manimlib` for ManimGL. This works pretty well when rendering 13 | the slides. 14 | 15 | If both modules are present in {py:data}`sys.modules`, then Manim Slides will 16 | prefer using `manim`. 17 | 18 | ### Usage 19 | 20 | The simplest way to use Manim Slides with the correct Manim API is to: 21 | 22 | 1. first import the Manim API; 23 | 2. and, then, import `manim_slides`. 24 | 25 | Example for `manim`: 26 | 27 | ```python 28 | from manim import * 29 | from manim_slides import Slide 30 | ``` 31 | 32 | Example for `manimlib`: 33 | 34 | ```python 35 | from manimlib import * 36 | from manim_slides import Slide 37 | ``` 38 | 39 | ### Example of Default Import 40 | 41 | The following code shows how Manim Slides detected that `manimlib` 42 | was imported, so the {py:class}`Slide` 43 | automatically subclasses the class from ManimGL, not Manim. 44 | 45 | ```python 46 | from manimlib import Scene 47 | from manim_slides import Slide 48 | 49 | assert issubclass(Slide, Scene) # Slide subclasses Scene from ManimGL 50 | 51 | from manim import Scene 52 | 53 | assert not issubclass(Slide, Scene) # but not Scene from Manim 54 | ``` 55 | 56 | ## Custom Manim API 57 | 58 | If you want to override the default Manim API, you can set the `MANIM_API` 59 | environment variable to: 60 | 61 | - `manim` or `manimce` to import `manim`; 62 | - `manimlib` or `manimgl` to import `manimlib`; 63 | 64 | prior to importing `manim_slides`. 65 | 66 | Note that Manim Slides will still first look at {py:data}`sys.modules` to check 67 | if any of the two modules is already imported. 68 | 69 | If you want to force Manim Slides to obey the `MANIM_API` environment variable, 70 | you must also set `FORCE_MANIM_API=1`. 71 | -------------------------------------------------------------------------------- /docs/source/quickstart.md: -------------------------------------------------------------------------------- 1 | # Quickstart 2 | 3 | If not already, install Manim Slides, along with either Manim or ManimGL, 4 | see [installation](/installation). 5 | 6 | ## Creating your first slides 7 | 8 | ```{include} ../../README.md 9 | :start-after: 10 | :end-before: 11 | ``` 12 | 13 | :::{note} 14 | Using `manim-slides render` makes sure to use the `manim` 15 | (or `manimlib`) library that was installed in the same Python environment. 16 | Put simply, this is a wrapper around 17 | `manim render [ARGS]...` (or `manimgl [ARGS]...`). 18 | ::: 19 | 20 | 21 | ```{include} ../../README.md 22 | :start-after: 23 | :end-before: 24 | ``` 25 | 26 | The output slides should look this this: 27 | 28 | ```{eval-rst} 29 | .. manim-slides:: ../../example.py:BasicExample 30 | :hide_source: 31 | :quality: high 32 | ``` 33 | 34 | For more advanced examples, 35 | see the [Examples](/reference/examples) section. 36 | -------------------------------------------------------------------------------- /docs/source/reference/api.md: -------------------------------------------------------------------------------- 1 | # Application Programming Interface 2 | 3 | Manim Slides' API is very limited: it simply consists of two classes, `Slide` 4 | and `ThreeDSlide`, which are subclasses of `Scene` and `ThreeDScene` from Manim. 5 | 6 | Therefore, we only document here the methods we think the end-user will ever 7 | use, not the methods used internally when rendering. 8 | 9 | ## Slide 10 | 11 | ```{eval-rst} 12 | .. autoclass:: manim_slides.slide.Slide 13 | :members: 14 | add_to_canvas, 15 | canvas, 16 | canvas_mobjects, 17 | mobjects_without_canvas, 18 | next_section, 19 | next_slide, 20 | remove_from_canvas, 21 | start_skip_animations, 22 | stop_skip_animations, 23 | wait_time_between_slides, 24 | wipe, 25 | zoom, 26 | ``` 27 | 28 | ## 3D Slide 29 | 30 | ```{eval-rst} 31 | .. autoclass:: manim_slides.slide.ThreeDSlide 32 | :members: 33 | ``` 34 | 35 | ## Animations 36 | 37 | ```{eval-rst} 38 | .. automodule:: manim_slides.slide.animation 39 | :members: 40 | Wipe, 41 | Zoom, 42 | ``` 43 | -------------------------------------------------------------------------------- /docs/source/reference/cli.md: -------------------------------------------------------------------------------- 1 | # Command Line Interface 2 | 3 | This page contains an exhaustive list of all the commands available with `manim-slides`. 4 | 5 | 6 | ```{eval-rst} 7 | .. click:: manim_slides.__main__:cli 8 | :prog: manim-slides 9 | :nested: full 10 | ``` 11 | 12 | ## All config options 13 | 14 | Each converter has its own configuration options, which are listed below. 15 | 16 | ::::{dropdown} HTML 17 | ```{program-output} manim-slides convert --to=html --show-config 18 | ``` 19 | :::: 20 | 21 | ::::{dropdown} Zip 22 | :::{note} 23 | The Zip converter inherits from the HTML converter. 24 | ::: 25 | ```{program-output} manim-slides convert --to=zip --show-config 26 | ``` 27 | :::: 28 | 29 | ::::{dropdown} PDF 30 | ```{program-output} manim-slides convert --to=pdf --show-config 31 | ``` 32 | :::: 33 | 34 | ::::{dropdown} HTML 35 | ```{program-output} manim-slides convert --to=pdf --show-config 36 | ``` 37 | :::: 38 | -------------------------------------------------------------------------------- /docs/source/reference/customize_html.md: -------------------------------------------------------------------------------- 1 | # Customize your RevealJS slides 2 | 3 | One of the benefits of the `convert` command is the use of template files. 4 | 5 | Currently, only the HTML export uses one. If not specified, the template 6 | will be the one shipped with Manim Slides, see 7 | [`manim_slides/templates/revealjs.html`](https://github.com/jeertmans/manim-slides/blob/main/manim_slides/templates/revealjs.html). 8 | 9 | Because you can actually use your own template with the `--use-template` 10 | option, possibilities are infinite! 11 | 12 | :::{warning} 13 | Currently, the `PresentationConfig` class and its components 14 | are not part of the public API. You can still use them, e.g., 15 | in the templates, but you may expect breaking changes between 16 | releases. 17 | 18 | Eventually, this will become part of the public API too, 19 | and we will document its usage. 20 | ::: 21 | 22 | ## Adding a clock to each slide 23 | 24 | In this example, we show how to add a self-updating clock 25 | to the bottom left corner of every slide. 26 | 27 | :::{note} 28 | This example is inspired from 29 | [@gsong-math's comment](https://github.com/jeertmans/manim-slides/issues/356#issuecomment-1902626943) 30 | on Manim Slides' repository. 31 | ::: 32 | 33 | ### What to add 34 | 35 | Whenever you want to create a template, it is best practice 36 | to start from the default one (see link above). 37 | 38 | Modifying it needs very basic HTML/JavaScript/CSS skills. 39 | To add a clock, you can simply add the following to the 40 | default template file: 41 | 42 | ```{eval-rst} 43 | .. literalinclude:: ../_static/template.diff 44 | :language: html 45 | ``` 46 | 47 | :::{tip} 48 | Because we use RevealJS to generate HTML slides, 49 | we recommend you to take a look at 50 | [RevealJS' documentation](https://revealjs.com/). 51 | ::: 52 | 53 | ### How it renders 54 | 55 | Then, using the `:template: ` 56 | option, the basic example renders as follows: 57 | 58 | ```{eval-rst} 59 | .. manim-slides:: ../../../example.py:BasicExample 60 | :hide_source: 61 | :template: ../_static/template.html 62 | ``` 63 | 64 | ### Full code 65 | 66 | Below, you can read the full content of the template file. 67 | 68 | ```{eval-rst} 69 | .. literalinclude:: ../_static/template.html 70 | :language: html+jinja 71 | ``` 72 | -------------------------------------------------------------------------------- /docs/source/reference/examples.md: -------------------------------------------------------------------------------- 1 | # Examples 2 | 3 | Contents of `example.py`. 4 | 5 | Do not forget to import Manim Slides and Manim or ManimGL: 6 | 7 | ```python 8 | from manim import * 9 | from manim_slides import Slide, ThreeDSlide 10 | ``` 11 | 12 | or 13 | 14 | ```python 15 | from manimlib import * 16 | from manim_slides import Slide, ThreeDSlide 17 | ``` 18 | 19 | Then, each presentation, named `SCENE`, was generated with those two commands: 20 | 21 | ```bash 22 | manim example.py SCENE # or manimgl example SCENE 23 | manim-slides convert SCENE scene.html -ccontrols=true 24 | ``` 25 | 26 | where `-ccontrols=true` indicates that we want to display the blue navigation arrows. 27 | 28 | ## Basic Example 29 | 30 | Basic example from quickstart. 31 | 32 | ```{eval-rst} 33 | .. manim-slides:: ../../../example.py:BasicExample 34 | :hide_source: 35 | :quality: high 36 | 37 | .. literalinclude:: ../../../example.py 38 | :language: python 39 | :linenos: 40 | :pyobject: BasicExample 41 | ``` 42 | 43 | ## 3D Example 44 | 45 | Example using 3D camera. As Manim and ManimGL handle 3D differently, 46 | definitions are slightly different. 47 | 48 | ### With Manim 49 | 50 | ```{eval-rst} 51 | .. manim-slides:: ../../../example.py:ThreeDExample 52 | :hide_source: 53 | :quality: high 54 | 55 | .. literalinclude:: ../../../example.py 56 | :language: python 57 | :linenos: 58 | :dedent: 4 59 | :start-after: [manim-3d] 60 | :end-before: [manim-3d] 61 | ``` 62 | 63 | ### With ManimGL 64 | 65 | ```{eval-rst} 66 | .. literalinclude:: ../../../example.py 67 | :language: python 68 | :linenos: 69 | :dedent: 4 70 | :start-after: [manimgl-3d] 71 | :end-before: [manimgl-3d] 72 | ``` 73 | 74 | ## Subclass Custom Scenes 75 | 76 | For compatibility reasons, Manim Slides only provides subclasses for 77 | `Scene` and `ThreeDScene`. 78 | However, subclassing other scene classes is totally possible, 79 | and very simple to do actually! 80 | 81 | [For example](https://github.com/jeertmans/manim-slides/discussions/185), 82 | you can subclass the `MovingCameraScene` class from `manim` 83 | with the following code: 84 | 85 | ```{code-block} python 86 | :linenos: 87 | 88 | from manim import * 89 | from manim_slides import Slide 90 | 91 | 92 | class MovingCameraSlide(Slide, MovingCameraScene): 93 | pass 94 | ``` 95 | 96 | And later use this class anywhere in your code: 97 | 98 | 99 | ```{code-block} python 100 | :linenos: 101 | 102 | class SubclassExample(MovingCameraSlide): 103 | """Example taken from ManimCE's docs.""" 104 | 105 | def construct(self): 106 | self.camera.frame.save_state() 107 | 108 | ax = Axes(x_range=[-1, 10], y_range=[-1, 10]) 109 | graph = ax.plot(lambda x: np.sin(x), color=WHITE, x_range=[0, 3 * PI]) 110 | 111 | dot_1 = Dot(ax.i2gp(graph.t_min, graph)) 112 | dot_2 = Dot(ax.i2gp(graph.t_max, graph)) 113 | self.add(ax, graph, dot_1, dot_2) 114 | 115 | self.play(self.camera.frame.animate.scale(0.5).move_to(dot_1)) 116 | self.next_slide() 117 | self.play(self.camera.frame.animate.move_to(dot_2)) 118 | self.next_slide() 119 | self.play(Restore(self.camera.frame)) 120 | self.wait() 121 | ``` 122 | 123 | :::{note} 124 | If you do not plan to reuse `MovingCameraSlide` more than once, then you can 125 | directly write the `construct` method in the body of `MovingCameraSlide`. 126 | ::: 127 | 128 | ```{eval-rst} 129 | .. manim-slides:: SubclassExample 130 | :hide_source: 131 | :quality: high 132 | 133 | from manim import * 134 | from manim_slides import Slide 135 | 136 | 137 | class MovingCameraSlide(Slide, MovingCameraScene): 138 | pass 139 | 140 | class SubclassExample(MovingCameraSlide): 141 | def construct(self): 142 | self.camera.frame.save_state() 143 | 144 | ax = Axes(x_range=[-1, 10], y_range=[-1, 10]) 145 | graph = ax.plot(lambda x: np.sin(x), color=WHITE, x_range=[0, 3 * PI]) 146 | 147 | dot_1 = Dot(ax.i2gp(graph.t_min, graph)) 148 | dot_2 = Dot(ax.i2gp(graph.t_max, graph)) 149 | self.add(ax, graph, dot_1, dot_2) 150 | 151 | self.play(self.camera.frame.animate.scale(0.5).move_to(dot_1)) 152 | self.next_slide() 153 | self.play(self.camera.frame.animate.move_to(dot_2)) 154 | self.next_slide() 155 | self.play(Restore(self.camera.frame)) 156 | self.wait() 157 | ``` 158 | 159 | ## Advanced Example 160 | 161 | A more advanced example is `ConvertExample`, which is used as demo slide and tutorial. 162 | 163 | ```{eval-rst} 164 | .. manim-slides:: ../../../example.py:ConvertExample 165 | :hide_source: 166 | :quality: high 167 | 168 | .. literalinclude:: ../../../example.py 169 | :language: python 170 | :linenos: 171 | :pyobject: ConvertExample 172 | ``` 173 | -------------------------------------------------------------------------------- /docs/source/reference/gui.md: -------------------------------------------------------------------------------- 1 | # Graphical User Interface 2 | 3 | Manim Slides' graphical user interface (GUI) is the *de facto* way to present slides. 4 | 5 | If you do not specify one of the commands listed in the 6 | [CLI reference](/reference/cli), 7 | Manim Slides will use **present** by default, which launches a GUI window, 8 | playing your scene(s) like so: 9 | 10 | ```bash 11 | manim-slides [present] [SCENES]... 12 | ``` 13 | 14 | Some optional parameters can be specified and can be listed with: 15 | 16 | ```bash 17 | manim-slides present --help 18 | ``` 19 | 20 | :::{note} 21 | All the `SCENES` must be in the same folder (`--folder DIRECTORY`), which 22 | defaults to `./slides`. If you rendered your animations without changing 23 | directory, you should not worry about that :-) 24 | ::: 25 | 26 | ## Configuration File 27 | 28 | It is possible to configure Manim Slides via a configuration file, even though 29 | this feature is currently limited. You may initialize the default configuration 30 | file with: 31 | 32 | ```bash 33 | manim-slides init 34 | ``` 35 | 36 | :::{warning} 37 | Note that, by default, Manim Slides will use default key bindings that are 38 | platform-dependent. If you decide to overwrite those with a config file, you may 39 | encounter some problems from platform to platform. 40 | ::: 41 | 42 | ## Configuring Key Bindings 43 | 44 | If you wish to use other key bindings than the defaults, you can run the 45 | configuration wizard with: 46 | 47 | ```bash 48 | manim-slides wizard 49 | ``` 50 | 51 | A similar window to the image below will pop up and prompt to change keys. 52 | 53 | ```{eval-rst} 54 | .. image:: ../_static/wizard_light.png 55 | :width: 300px 56 | :align: center 57 | :class: only-light 58 | :alt: Manim Slide Wizard 59 | ``` 60 | 61 | ```{eval-rst} 62 | .. image:: ../_static/wizard_dark.png 63 | :width: 300px 64 | :align: center 65 | :class: only-dark 66 | :alt: Manim Slide Wizard 67 | ``` 68 | 69 | :::{note} 70 | Even though it is not currently supported through the GUI, you can select 71 | multiple key binding for the same action by modifying the config file. 72 | ::: 73 | -------------------------------------------------------------------------------- /docs/source/reference/html.md: -------------------------------------------------------------------------------- 1 | # HTML Presentations 2 | 3 | Manim Slides allows you to convert presentations into one HTML file, with 4 | [RevealJS](https://revealjs.com/). This file can then be opened with any modern 5 | web browser, allowing for a nice portability of your presentations. 6 | 7 | As with every command with Manim Slides, converting slides' fragments into one 8 | HTML file (and its assets) can be done in one command: 9 | 10 | ```bash 11 | manim-slides convert [SCENES]... DEST 12 | ``` 13 | 14 | where `DEST` is the `.html` destination file. 15 | 16 | ## Configuring the Template 17 | 18 | Many configuration options are available through the `-c