A LaTeX alternative in Rust
I recently discovered typst and I was fascinated by it, but I think it has its own problems. For example, HTML export is not already supported and the programming language they use is not Rust. This made me wonder, what if we made a similar language that translates directly to Rust with a preprocessor and then generates the HTML? In this way we could use all the libraries developed for Rust inside documents!
I already made a proof of concept but it is quite a mess. So, before spending a lot of time refactoring it and make it work reliably, I would like to receive some opinions. Would someone be interested in the project? Do you think it would worth it?
An example of the input I currently handle:
= H1
== H2
### H3
==== H4
Lorem ipsum dolor sit, amet _consectetur_ *adipisicing* \
elit. Quas id libero aspernatur? \\
Ipsum asperiores quo vitae provident quod pariatur iste deleniti voluptatibus culpa hic voluptates numquam fugiat, adipisci dolore repudiandae!
#{
fn factorial(n: u64) -> u64 {
if n == 0 {
1
} else {
n * factorial(n - 1)
}
}
}
Factorial of 10 is: #(factorial(10).to_string().as_html())
#(
html! {
table {
((0..=10).map(|i| {
html!{
tr {
td { (i.to_string().as_html()) }
td { (factorial(i).to_string().as_html()) }
}
}
}))
}
}
)