tinymist/
lib.rs

1//! # tinymist
2//!
3//! This crate provides a CLI that starts services for [Typst](https://typst.app/). It provides:
4//! + `tinymist lsp`: A language server following the [Language Server Protocol](https://microsoft.github.io/language-server-protocol/).
5//! + `tinymist preview`: A preview server for Typst.
6//!
7//! ## Usage
8//!
9//! See [Features: Command Line Interface](https://myriad-dreamin.github.io/tinymist/feature/cli.html).
10//!
11//! ## Documentation
12//!
13//! See [Crate Docs](https://myriad-dreamin.github.io/tinymist/rs/tinymist/index.html).
14//!
15//! Also see [Developer Guide: Tinymist LSP](https://myriad-dreamin.github.io/tinymist/module/lsp.html).
16//!
17//! ## Contributing
18//!
19//! See [CONTRIBUTING.md](https://github.com/Myriad-Dreamin/tinymist/blob/main/CONTRIBUTING.md).
20
21pub use config::*;
22pub use log_::*;
23pub use lsp::init::*;
24pub use server::*;
25pub use sync_ls::LspClient;
26pub use tinymist_project::world;
27pub use tinymist_query as query;
28pub use world::{CompileFontArgs, CompileOnceArgs, CompilePackageArgs};
29
30#[cfg(feature = "export")]
31pub use task::export2 as export;
32#[cfg(feature = "export")]
33pub use task::ExportTask;
34#[cfg(feature = "trace")]
35pub use task::UserActionTask;
36
37#[cfg(feature = "dap")]
38pub use dap::RegularInit as DapRegularInit;
39#[cfg(feature = "dap")]
40pub use dap::SuperInit as DapSuperInit;
41
42pub mod project;
43pub mod tool;
44
45#[cfg(feature = "web")]
46pub mod web;
47
48mod actor;
49mod cmd;
50mod config;
51mod input;
52#[path = "log.rs"]
53mod log_;
54mod lsp;
55mod resource;
56mod server;
57mod stats;
58mod task;
59mod utils;
60
61#[cfg(feature = "dap")]
62mod dap;
63#[cfg(feature = "lock")]
64mod route;
65
66use std::sync::LazyLock;
67
68use lsp::query::QueryFuture;
69use serde_json::from_value;
70use sync_ls::*;
71use utils::*;
72use world::*;
73
74/// The long version description of the library
75pub static LONG_VERSION: LazyLock<String> = LazyLock::new(|| {
76    format!(
77        "
78Build Timestamp:     {}
79Build Git Describe:  {}
80Commit SHA:          {}
81Commit Date:         {}
82Commit Branch:       {}
83Cargo Target Triple: {}
84Typst Version:       {}
85Typst Source:        {}
86",
87        env!("VERGEN_BUILD_TIMESTAMP"),
88        env!("VERGEN_GIT_DESCRIBE"),
89        option_env!("VERGEN_GIT_SHA").unwrap_or("None"),
90        option_env!("VERGEN_GIT_COMMIT_TIMESTAMP").unwrap_or("None"),
91        option_env!("VERGEN_GIT_BRANCH").unwrap_or("None"),
92        env!("VERGEN_CARGO_TARGET_TRIPLE"),
93        env!("TYPST_VERSION"),
94        env!("TYPST_SOURCE"),
95    )
96});