【Rust日报】txt-fmt: 一个用Rust编写的极快的LaTeX格式化工具

[new lib] hypertext

hypertext是一个Rust HTML模板框架。

特性如下:

  • 检查元素名称/属性的类型

  • 完全可扩展,可用于非标准元素/属性

  • 支持#![no_std]

  • 自动转义

  • 默认情况下采用延迟渲染,以避免多次分配

  • 在嵌套文档的情况下表现出色,其他库可能在这方面表现不佳

示例:

use hypertext::{html_elements, GlobalAttributes, RenderIterator, Renderable};

let shopping_list = ["milk", "eggs", "bread"];

let shopping_list_maud = hypertext::maud! {
    div {
        h1 { "Shopping List" }
        ul {
            @for (&item, i) in shopping_list.iter().zip(1..) {
                li.item {
                    input #{ "item-" (i) } type="checkbox";
                    label for={ "item-" (i) } { (item) }
                }
            }
        }
    }
}
.render();

// or, alternatively:

let shopping_list_rsx = hypertext::rsx! {
    <div>
        <h1>Shopping List</h1>
        <ul>
            { shopping_list.iter().zip(1..).map(|(&item, i)| hypertext::rsx_move! {
                <li class="item">
                    <input id=format!("item-{i}") type="checkbox">
                    <label for=format!("item-{i}")>{ item }</label>
                </li>
            }).render_all() }
        </ul>
    </div>
}
.render();

Demo: https://vidhan.io/

GitHub: https://github.com/vidhanio/hypertext

[new lib] txt-fmt

txt-fmt是一个用Rust编写的极快的LaTeX格式化工具。

输入:

\documentclass{article}

\begin{document}

\begin{itemize}
\item Lists with items
over multiple lines
\end{itemize}

\begin{equation}
E = m c^2
\end{equation}

\end{document}

输出:

\documentclass{article}

\begin{document}

\begin{itemize}
  \item Lists with items
    over multiple lines
\end{itemize}

\begin{equation}
  E = m c^2
\end{equation}

\end{document}

特性如下:

  • ⚡ 极快的运行时性能

  • 🔧 最小配置要求

  • 📟 命令行界面

  • 📜 处理LaTeX文件类型 .tex, .bib, .cls 和 .sty

  • 🦀 完全采用安全的Rust编写

GitHub: https://github.com/WGUNDERWOOD/tex-fmt

[new] lookbook

lookbook是Dioxus的UI预览框架。

示例:

/// To-Do Task.
#[preview]
pub fn TaskPreview(
    /// Label of the task.
    #[lookbook(default = "Ice skating")]
    label: String,

    /// Content of the task.
    #[lookbook(default = "Central Park")]
    content: String,

    /// List of tags.
    #[lookbook(default = vec![String::from("A")])]
    tags: Json<Vec<String>>,
) -> Element {
    rsx!(
        div {
            h4 { "{label}" }
            p { "{content}" }
            div { { tags.0.iter().map(|tag| rsx!(li { "{tag}" })) } }
        }
    )
}

#[component]
fn app() -> Element {
    rsx!(LookBook {
        home: |()| rsx!("Home"),
        previews: [TaskPreview]
    })
}

fn main() {
    dioxus::launch(app)
}

GitHub: https://github.com/dioxus-community/lookbook

[archive] comfy已存档

Comfy是一个使用Rust构建的有趣的2D游戏引擎。它被设计为有主见、高效以及易于使用。

现已存档,主要原因是,由于现实生活环境的原因,作者没有太多时间/精力用于项目。

在放弃Rust用于游戏开发后,Comfy成为了一个小的有趣的副业项目,虽然在一段时间内是有效的,但现在已不再适用,作者没有精力不断赶上Rust生态系统的发展。

GitHub: https://github.com/darthdeus/comfy


From 日报小组 长琴

社区学习交流平台订阅:

  • Rustcc 论坛:支持 rss

  • 微信公众号:Rust 语言中文社区

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值