jneug / typst-codelst

A typst package to render sourcecode
MIT License
87 stars 5 forks source link

Request: Show used language in sourcecode block #19

Open Ferrys93de opened 2 months ago

Ferrys93de commented 2 months ago

I thought it would be a handy feature, if the used language is shown in the sourcecode block.

Obsidian for example shows the language used in the top right corner, like in the image below. show_language_in_sourcecode_top_right

9SMTM6 commented 1 month ago

From my understanding any fancy frames are out of scope for this project. You can do that stuff manually by eg. passing the frame argument to codelst::sourcecode and using showybox. Just put that stuff in a function that determines the language used (e.g. if you read from file by getting the file extension) and then adds the appropriate element to the frame.

My final code in #17 does similarish things if you want a reference.