charmbracelet / freeze

Generate images of code and terminal output 📸
MIT License
2.98k stars 50 forks source link

support multi language #79

Open Delta456 opened 3 months ago

Delta456 commented 3 months ago

Implements https://github.com/charmbracelet/freeze/issues/70

Delta456 commented 3 months ago

This is not complete but I have made a draft for other people to help me figure out implement this.

To run this ./freeze --lannguage py,go main.py

main.py

def main():
   print('Hello world')

fmt.Println("Hello world")

EDIT: Read the below comment.

Delta456 commented 3 months ago

I need more test cases. My implementation works.

image

image

image

Delta456 commented 3 months ago

As discussed in https://github.com/alecthomas/chroma/issues/960#issuecomment-2061041222, lexers.DelegatingLexer only supports syntaxes which have indeed have something in common. The implementing is working and finalised.