Required dependencies when installing Dali are not checked on all OS
Dali (Dalí) - Powerful rendering of your source code.
It can render any* source code into an image.
Image: httpie source code (Dali v1.0.0-beta1)
arguments:
window_controls=True
,background='#576574'
Dali is writen in Python language and has a high speed enough. Requires no network connection or specific operation system (Microsoft Windows has not been tested 🙃).
Dali uses Pygments for syntax highlighter and Pillow-SIMD for rendering. Pygments is used in GitHub on Jupyter Notebook pages & GitHub API pages.
You can use it in your project and create a great image of your code.
At the moment Dali is actively developed.
from file
from dali_renderer import Dali
instance = Dali("<path to save image>/image.png", window_controls=True, background='#576574')
instance.from_file("<path to source code file>")
from string
from dali_renderer import Dali
instance = Dali("<path to save image>/image.png", window_controls=True, background='#576574')
with open("<path to source code file>", 'r') as file:
code = file.read()
instance.from_string(code)
pip install dali_renderer
pip uninstall pillow
CC="cc -mavx2" pip install -U --force-reinstall pillow-simd
- Change styles:
- Change fonts:
- Adding window decorations (as in the screenshot)
- Adding additional background (as in the screenshot)
- And also use it in your source code as a python module 😉
- ...
pip install hatch
git clone git@github.com:foozzi/Dali.git && cd ./Dali
hatch run test
hatch run lint:typing # mypy
hatch run lint:fmt # black, ruff
hatch clean && hatch build