taggy
?taggy
is an easy-to-use api for tagging structured text, see example below.
With taggy
you can make good-looking slides in pdf via latex. See example here. Future plans include generation of markdown and html.
taggy
is a zero-dependency Scala 3 library that shows how you can construct a concise and type-safe Scala-embedded DSL using contextual abstraction.
WARNING: taggy
is a proof-of-concept and still under development. It benefits from an experimental feature of the Scala 3.2.nightly compiler called fewerBraces
.
You need to have latexmk
from TexLive on your path. Install it on Ubuntu using sudo apt install texlive-full
taggy
?taggy
below, with scala-cli
that automatically downloads taggy
as a Github dependency. my-slides.scala
in an empty new folder and do scala-cli run .
in that folder.
// Two magic comments used by scala-cli (just copy-paste them):
//> using lib "taggy:taggy:0.0.5,url=https://github.com/bjornregnell/taggy/releases/download/v0.0.5/taggy_3-0.0.5.jar"
//> using scala "3.3.0-RC3"
// run this command in terminal to create slides in target/out.pdf // scala-cli run .
import taggy.*
@main def run = slides.toPdf()
def slides = document("Taggy Slide Example"): frame("Greetings in two languages"): p("Nice greetings:") itemize: p("English: Hello world!") p("Swedish: Hej världen!") p("https://github.com/bjornregnell/taggy")
* Instead of doing the copy-paste-save above you can just run this command and you should get see slides in a pdf viewer when ready:
curl -fL https://github.com/bjornregnell/taggy/releases/download/v0.0.5/init-slides.sh | bash
* See more examples [here](https://github.com/bjornregnell/taggy/tree/main/example.scala).
# How to build `taggy`?
`scala-cli --power package taggy.scala -o taggy_3-0.0.5.jar --library`
# How to publish `taggy`?
* Bump all versions to `x.y.z` in README.md and example.scala by replacing all `x.y.{z - 1}` by `x.y.z`
* Draft a new release on https://github.com/bjornregnell/taggy/releases
* Build and upload jar named `taggy_3-x.y.z.jar`