Thanks to visit codestin.com
Credit goes to github.com

Skip to content

miestrode/sourcerer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sourcerer

Sourcerer is a Typst package for displaying stylized source code blocks, with some extra features. Main features include:

  • Rendering source code with numbering
  • Rendering only a range of lines from the source code, keeping the original highlighting of the code (For example, block comments are still rendered well, even if cut)
  • Adding in-code line labels which are easily referenceable (via reference)
  • Considerable customization options for the display of the code block
  • Consistent and pretty cutoff between pages
  • Displaying the language used for a code block in a readable manner, in-code-block

Usage

First, import the package via:

#import "@preview/sourcerer:0.2.1": code

Then, display custom code blocks via the code function, like so:

#code(
  lang: "Typst",
  ```typ
  Woah, that's pretty #smallcaps(cool)!
  That's neat too.
  ```
)

This results in:

To view all of the options of the code function, consult the documentation.

About

Typst package for displaying stylized source code blocks, with some extra features.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages