mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-08-04 10:18:16 +00:00
dev: fix meta and rename preview crates for publish crates (#1804)
* dev: fix meta and rename preview crates for publish crates * dev: fix meta for publish crates
This commit is contained in:
parent
5a2509327d
commit
25a446cd99
16 changed files with 98 additions and 62 deletions
2
.github/workflows/release-crates.yml
vendored
2
.github/workflows/release-crates.yml
vendored
|
@ -52,7 +52,7 @@ jobs:
|
||||||
cargo publish --no-verify -p tinymist-query || true
|
cargo publish --no-verify -p tinymist-query || true
|
||||||
cargo publish --no-verify -p tinymist-render || true
|
cargo publish --no-verify -p tinymist-render || true
|
||||||
cargo publish --no-verify -p tinymist-core || true
|
cargo publish --no-verify -p tinymist-core || true
|
||||||
cargo publish --no-verify -p typst-preview || true
|
cargo publish --no-verify -p tinymist-preview || true
|
||||||
cargo publish --no-verify -p tinymist || true
|
cargo publish --no-verify -p tinymist || true
|
||||||
- name: Verifies crate health (Optional)
|
- name: Verifies crate health (Optional)
|
||||||
run: |
|
run: |
|
||||||
|
|
54
Cargo.lock
generated
54
Cargo.lock
generated
|
@ -4085,6 +4085,7 @@ dependencies = [
|
||||||
"tinymist-core",
|
"tinymist-core",
|
||||||
"tinymist-debug",
|
"tinymist-debug",
|
||||||
"tinymist-l10n",
|
"tinymist-l10n",
|
||||||
|
"tinymist-preview",
|
||||||
"tinymist-project",
|
"tinymist-project",
|
||||||
"tinymist-query",
|
"tinymist-query",
|
||||||
"tinymist-render",
|
"tinymist-render",
|
||||||
|
@ -4099,7 +4100,6 @@ dependencies = [
|
||||||
"typst-ansi-hl",
|
"typst-ansi-hl",
|
||||||
"typst-html",
|
"typst-html",
|
||||||
"typst-pdf",
|
"typst-pdf",
|
||||||
"typst-preview",
|
|
||||||
"typst-render",
|
"typst-render",
|
||||||
"typst-shim",
|
"typst-shim",
|
||||||
"typst-svg",
|
"typst-svg",
|
||||||
|
@ -4221,7 +4221,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tinymist-l10n"
|
name = "tinymist-l10n"
|
||||||
version = "0.13.14-rc1"
|
version = "0.13.12"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"clap",
|
"clap",
|
||||||
|
@ -4249,7 +4249,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tinymist-package"
|
name = "tinymist-package"
|
||||||
version = "0.13.14-rc1"
|
version = "0.13.12"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64",
|
"base64",
|
||||||
"comemo",
|
"comemo",
|
||||||
|
@ -4274,6 +4274,30 @@ dependencies = [
|
||||||
"web-sys",
|
"web-sys",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "tinymist-preview"
|
||||||
|
version = "0.13.14-rc1"
|
||||||
|
dependencies = [
|
||||||
|
"clap",
|
||||||
|
"comemo",
|
||||||
|
"env_logger",
|
||||||
|
"futures",
|
||||||
|
"indexmap 2.9.0",
|
||||||
|
"log",
|
||||||
|
"parking_lot",
|
||||||
|
"reflexo-typst",
|
||||||
|
"reflexo-vec2svg",
|
||||||
|
"serde",
|
||||||
|
"serde_json",
|
||||||
|
"tinymist-assets 0.13.12",
|
||||||
|
"tinymist-std",
|
||||||
|
"tokio",
|
||||||
|
"typst",
|
||||||
|
"typst-assets",
|
||||||
|
"typst-macros",
|
||||||
|
"typst-timing",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tinymist-project"
|
name = "tinymist-project"
|
||||||
version = "0.13.12"
|
version = "0.13.12"
|
||||||
|
@ -4995,30 +5019,6 @@ dependencies = [
|
||||||
"xmp-writer",
|
"xmp-writer",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "typst-preview"
|
|
||||||
version = "0.13.14-rc1"
|
|
||||||
dependencies = [
|
|
||||||
"clap",
|
|
||||||
"comemo",
|
|
||||||
"env_logger",
|
|
||||||
"futures",
|
|
||||||
"indexmap 2.9.0",
|
|
||||||
"log",
|
|
||||||
"parking_lot",
|
|
||||||
"reflexo-typst",
|
|
||||||
"reflexo-vec2svg",
|
|
||||||
"serde",
|
|
||||||
"serde_json",
|
|
||||||
"tinymist-assets 0.13.12",
|
|
||||||
"tinymist-std",
|
|
||||||
"tokio",
|
|
||||||
"typst",
|
|
||||||
"typst-assets",
|
|
||||||
"typst-macros",
|
|
||||||
"typst-timing",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "typst-realize"
|
name = "typst-realize"
|
||||||
version = "0.13.1"
|
version = "0.13.1"
|
||||||
|
|
12
Cargo.toml
12
Cargo.toml
|
@ -98,7 +98,7 @@ rpds = "1"
|
||||||
# Data/Text Format and Processing
|
# Data/Text Format and Processing
|
||||||
biblatex = "0.10"
|
biblatex = "0.10"
|
||||||
cmark-writer = { version = "0.7.5", features = ["gfm"] }
|
cmark-writer = { version = "0.7.5", features = ["gfm"] }
|
||||||
docx-rs = { git = "https://github.com/Myriad-Dreamin/docx-rs", default-features = false, rev = "db49a729f68dbdb9e8e91857fbb1c3d414209871" }
|
docx-rs = { version = "0.4.18-rc19", git = "https://github.com/Myriad-Dreamin/docx-rs", default-features = false, rev = "db49a729f68dbdb9e8e91857fbb1c3d414209871" }
|
||||||
hayagriva = "0.8"
|
hayagriva = "0.8"
|
||||||
hex = "0.4.3"
|
hex = "0.4.3"
|
||||||
flate2 = "1"
|
flate2 = "1"
|
||||||
|
@ -154,7 +154,7 @@ typst-pdf = "0.13.1"
|
||||||
typst-syntax = "0.13.1"
|
typst-syntax = "0.13.1"
|
||||||
typst-eval = "0.13.1"
|
typst-eval = "0.13.1"
|
||||||
typst-assets = "0.13.1"
|
typst-assets = "0.13.1"
|
||||||
typstfmt = { git = "https://github.com/Myriad-Dreamin/typstfmt", tag = "v0.13.1" }
|
typstfmt = { version = "0", git = "https://github.com/Myriad-Dreamin/typstfmt", tag = "v0.13.1" }
|
||||||
typst-ansi-hl = "0.4.0"
|
typst-ansi-hl = "0.4.0"
|
||||||
typstyle-core = { version = "=0.13.10", default-features = false }
|
typstyle-core = { version = "=0.13.10", default-features = false }
|
||||||
|
|
||||||
|
@ -162,7 +162,6 @@ typstyle-core = { version = "=0.13.10", default-features = false }
|
||||||
crossbeam-channel = "0.5.12"
|
crossbeam-channel = "0.5.12"
|
||||||
lsp-types = { version = "=0.95.0", features = ["proposed"] }
|
lsp-types = { version = "=0.95.0", features = ["proposed"] }
|
||||||
dapts = "0.0.6"
|
dapts = "0.0.6"
|
||||||
sync-ls = { path = "./crates/sync-lsp" }
|
|
||||||
|
|
||||||
# CLI
|
# CLI
|
||||||
clap = { version = "4.5", features = ["derive", "env", "unicode"] }
|
clap = { version = "4.5", features = ["derive", "env", "unicode"] }
|
||||||
|
@ -189,6 +188,8 @@ insta = { version = "1.39", features = ["glob"] }
|
||||||
tinymist-assets = { version = "=0.13.12" }
|
tinymist-assets = { version = "=0.13.12" }
|
||||||
|
|
||||||
tinymist-derive = { path = "./crates/tinymist-derive/", version = "0.13.12" }
|
tinymist-derive = { path = "./crates/tinymist-derive/", version = "0.13.12" }
|
||||||
|
tinymist-l10n = { path = "./crates/tinymist-l10n/", version = "0.13.12" }
|
||||||
|
tinymist-package = { path = "./crates/tinymist-package/", version = "0.13.12" }
|
||||||
tinymist-std = { path = "./crates/tinymist-std/", version = "0.13.12", default-features = false }
|
tinymist-std = { path = "./crates/tinymist-std/", version = "0.13.12", default-features = false }
|
||||||
tinymist-vfs = { path = "./crates/tinymist-vfs/", version = "0.13.12", default-features = false }
|
tinymist-vfs = { path = "./crates/tinymist-vfs/", version = "0.13.12", default-features = false }
|
||||||
tinymist-world = { path = "./crates/tinymist-world/", version = "0.13.12", default-features = false }
|
tinymist-world = { path = "./crates/tinymist-world/", version = "0.13.12", default-features = false }
|
||||||
|
@ -198,17 +199,16 @@ typst-shim = { path = "./crates/typst-shim", version = "0.13.12" }
|
||||||
|
|
||||||
tinymist-tests = { path = "./crates/tinymist-tests/" }
|
tinymist-tests = { path = "./crates/tinymist-tests/" }
|
||||||
|
|
||||||
|
sync-ls = { path = "./crates/sync-lsp", version = "0.13.14-rc1" }
|
||||||
tinymist = { path = "./crates/tinymist/", version = "0.13.14-rc1" }
|
tinymist = { path = "./crates/tinymist/", version = "0.13.14-rc1" }
|
||||||
tinymist-analysis = { path = "./crates/tinymist-analysis/", version = "0.13.14-rc1" }
|
tinymist-analysis = { path = "./crates/tinymist-analysis/", version = "0.13.14-rc1" }
|
||||||
tinymist-core = { path = "./crates/tinymist-core/", version = "0.13.14-rc1", default-features = false }
|
tinymist-core = { path = "./crates/tinymist-core/", version = "0.13.14-rc1", default-features = false }
|
||||||
tinymist-debug = { path = "./crates/tinymist-debug/", version = "0.13.14-rc1" }
|
tinymist-debug = { path = "./crates/tinymist-debug/", version = "0.13.14-rc1" }
|
||||||
tinymist-l10n = { path = "./crates/tinymist-l10n/", version = "0.13.14-rc1" }
|
|
||||||
tinymist-lint = { path = "./crates/tinymist-lint/", version = "0.13.14-rc1" }
|
tinymist-lint = { path = "./crates/tinymist-lint/", version = "0.13.14-rc1" }
|
||||||
tinymist-package = { path = "./crates/tinymist-package/", version = "0.13.14-rc1" }
|
|
||||||
tinymist-query = { path = "./crates/tinymist-query/", version = "0.13.14-rc1" }
|
tinymist-query = { path = "./crates/tinymist-query/", version = "0.13.14-rc1" }
|
||||||
tinymist-render = { path = "./crates/tinymist-render/", version = "0.13.14-rc1" }
|
tinymist-render = { path = "./crates/tinymist-render/", version = "0.13.14-rc1" }
|
||||||
|
tinymist-preview = { path = "./crates/typst-preview", version = "0.13.14-rc1" }
|
||||||
typlite = { path = "./crates/typlite", version = "0.13.14-rc1" }
|
typlite = { path = "./crates/typlite", version = "0.13.14-rc1" }
|
||||||
typst-preview = { path = "./crates/typst-preview", version = "0.13.14-rc1" }
|
|
||||||
|
|
||||||
[profile.dev.package.insta]
|
[profile.dev.package.insta]
|
||||||
opt-level = 3
|
opt-level = 3
|
||||||
|
|
|
@ -3,8 +3,9 @@ name = "tinymist-l10n"
|
||||||
description = "Localization support for tinymist and typst."
|
description = "Localization support for tinymist and typst."
|
||||||
categories = ["compilers", "command-line-utilities"]
|
categories = ["compilers", "command-line-utilities"]
|
||||||
keywords = ["language", "typst"]
|
keywords = ["language", "typst"]
|
||||||
|
# group: world
|
||||||
|
version = "0.13.12"
|
||||||
authors.workspace = true
|
authors.workspace = true
|
||||||
version.workspace = true
|
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
homepage.workspace = true
|
homepage.workspace = true
|
||||||
|
|
|
@ -3,8 +3,9 @@ name = "tinymist-package"
|
||||||
description = "Tinymist package support for Typst."
|
description = "Tinymist package support for Typst."
|
||||||
categories = ["compilers"]
|
categories = ["compilers"]
|
||||||
keywords = ["api", "language", "typst"]
|
keywords = ["api", "language", "typst"]
|
||||||
|
# group: world
|
||||||
|
version = "0.13.12"
|
||||||
authors.workspace = true
|
authors.workspace = true
|
||||||
version.workspace = true
|
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
homepage.workspace = true
|
homepage.workspace = true
|
||||||
|
|
|
@ -73,7 +73,7 @@ typst-render.workspace = true
|
||||||
typst-timing.workspace = true
|
typst-timing.workspace = true
|
||||||
typst-html = { workspace = true, optional = true }
|
typst-html = { workspace = true, optional = true }
|
||||||
typst-shim.workspace = true
|
typst-shim.workspace = true
|
||||||
typst-preview = { workspace = true, optional = true }
|
tinymist-preview = { workspace = true, optional = true }
|
||||||
typst-ansi-hl.workspace = true
|
typst-ansi-hl.workspace = true
|
||||||
tinymist-task.workspace = true
|
tinymist-task.workspace = true
|
||||||
tinymist-debug.workspace = true
|
tinymist-debug.workspace = true
|
||||||
|
@ -119,14 +119,14 @@ pdf = ["tinymist-task/pdf"]
|
||||||
no-content-hint = [
|
no-content-hint = [
|
||||||
"tinymist-task/no-content-hint",
|
"tinymist-task/no-content-hint",
|
||||||
"tinymist-project/no-content-hint",
|
"tinymist-project/no-content-hint",
|
||||||
"typst-preview/no-content-hint",
|
"tinymist-preview/no-content-hint",
|
||||||
"reflexo-typst/no-content-hint",
|
"reflexo-typst/no-content-hint",
|
||||||
"reflexo-vec2svg/no-content-hint",
|
"reflexo-vec2svg/no-content-hint",
|
||||||
]
|
]
|
||||||
|
|
||||||
preview = [
|
preview = [
|
||||||
"typst-preview",
|
"tinymist-preview",
|
||||||
"typst-preview/clap",
|
"tinymist-preview/clap",
|
||||||
"tinymist-assets/typst-preview",
|
"tinymist-assets/typst-preview",
|
||||||
"hyper-tungstenite",
|
"hyper-tungstenite",
|
||||||
]
|
]
|
||||||
|
|
|
@ -4,9 +4,9 @@ use lsp_types::notification::Notification;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use serde_json::Value as JsonValue;
|
use serde_json::Value as JsonValue;
|
||||||
use sync_ls::{internal_error, LspClient, LspResult};
|
use sync_ls::{internal_error, LspClient, LspResult};
|
||||||
|
use tinymist_preview::{ControlPlaneMessage, Previewer};
|
||||||
use tinymist_std::error::IgnoreLogging;
|
use tinymist_std::error::IgnoreLogging;
|
||||||
use tokio::sync::{mpsc, oneshot};
|
use tokio::sync::{mpsc, oneshot};
|
||||||
use typst_preview::{ControlPlaneMessage, Previewer};
|
|
||||||
|
|
||||||
use crate::project::ProjectPreviewState;
|
use crate::project::ProjectPreviewState;
|
||||||
use crate::tool::preview::{HttpServer, ProjectPreviewHandler};
|
use crate::tool::preview::{HttpServer, ProjectPreviewHandler};
|
||||||
|
|
|
@ -369,7 +369,7 @@ impl ServerState {
|
||||||
/// Scroll preview instances.
|
/// Scroll preview instances.
|
||||||
#[cfg(feature = "preview")]
|
#[cfg(feature = "preview")]
|
||||||
pub fn scroll_preview(&mut self, mut args: Vec<JsonValue>) -> AnySchedulableResponse {
|
pub fn scroll_preview(&mut self, mut args: Vec<JsonValue>) -> AnySchedulableResponse {
|
||||||
use typst_preview::ControlPlaneMessage;
|
use tinymist_preview::ControlPlaneMessage;
|
||||||
|
|
||||||
if args.is_empty() {
|
if args.is_empty() {
|
||||||
return self.preview.scroll_all(self.infer_pos()?);
|
return self.preview.scroll_all(self.infer_pos()?);
|
||||||
|
|
|
@ -90,7 +90,7 @@ fn main() -> Result<()> {
|
||||||
|
|
||||||
env_logger::builder()
|
env_logger::builder()
|
||||||
.filter_module("tinymist", base_level)
|
.filter_module("tinymist", base_level)
|
||||||
.filter_module("typst_preview", preview_level)
|
.filter_module("tinymist_preview", preview_level)
|
||||||
.filter_module("typlite", base_level)
|
.filter_module("typlite", base_level)
|
||||||
.filter_module("reflexo", base_level)
|
.filter_module("reflexo", base_level)
|
||||||
.filter_module("sync_ls", base_level)
|
.filter_module("sync_ls", base_level)
|
||||||
|
|
|
@ -353,13 +353,17 @@ impl PeriscopeProvider for TypstPeriscopeProvider {
|
||||||
#[derive(Default, Clone)]
|
#[derive(Default, Clone)]
|
||||||
pub struct ProjectPreviewState {
|
pub struct ProjectPreviewState {
|
||||||
#[cfg(feature = "preview")]
|
#[cfg(feature = "preview")]
|
||||||
pub(crate) inner: Arc<Mutex<FxHashMap<ProjectInsId, Arc<typst_preview::CompileWatcher>>>>,
|
pub(crate) inner: Arc<Mutex<FxHashMap<ProjectInsId, Arc<tinymist_preview::CompileWatcher>>>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "preview")]
|
#[cfg(feature = "preview")]
|
||||||
impl ProjectPreviewState {
|
impl ProjectPreviewState {
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn register(&self, id: &ProjectInsId, handle: &Arc<typst_preview::CompileWatcher>) -> bool {
|
pub fn register(
|
||||||
|
&self,
|
||||||
|
id: &ProjectInsId,
|
||||||
|
handle: &Arc<tinymist_preview::CompileWatcher>,
|
||||||
|
) -> bool {
|
||||||
let mut p = self.inner.lock();
|
let mut p = self.inner.lock();
|
||||||
|
|
||||||
// Don't replace the existing watcher if it exists
|
// Don't replace the existing watcher if it exists
|
||||||
|
@ -377,7 +381,7 @@ impl ProjectPreviewState {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn get(&self, task_id: &ProjectInsId) -> Option<Arc<typst_preview::CompileWatcher>> {
|
pub fn get(&self, task_id: &ProjectInsId) -> Option<Arc<tinymist_preview::CompileWatcher>> {
|
||||||
self.inner.lock().get(task_id).cloned()
|
self.inner.lock().get(task_id).cloned()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -568,8 +572,8 @@ impl CompileHandler<LspCompilerFeat, ProjectInsStateExt> for CompileHandlerImpl
|
||||||
|
|
||||||
#[cfg(feature = "preview")]
|
#[cfg(feature = "preview")]
|
||||||
if let Some(inner) = self.preview.get(&rep.id) {
|
if let Some(inner) = self.preview.get(&rep.id) {
|
||||||
|
use tinymist_preview::CompileStatus;
|
||||||
use tinymist_project::CompileStatusEnum::*;
|
use tinymist_project::CompileStatusEnum::*;
|
||||||
use typst_preview::CompileStatus;
|
|
||||||
|
|
||||||
inner.status(match &rep.status {
|
inner.status(match &rep.status {
|
||||||
Compiling => CompileStatus::Compiling,
|
Compiling => CompileStatus::Compiling,
|
||||||
|
|
|
@ -366,8 +366,8 @@ impl ServerState {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "preview")]
|
#[cfg(feature = "preview")]
|
||||||
pub(crate) fn infer_pos(&self) -> LspResult<typst_preview::ControlPlaneMessage> {
|
pub(crate) fn infer_pos(&self) -> LspResult<tinymist_preview::ControlPlaneMessage> {
|
||||||
use typst_preview::{ControlPlaneMessage, ResolveSourceLocRequest};
|
use tinymist_preview::{ControlPlaneMessage, ResolveSourceLocRequest};
|
||||||
|
|
||||||
let focus_file = self.focusing.as_ref();
|
let focus_file = self.focusing.as_ref();
|
||||||
let focus_file = focus_file.ok_or_else(|| invalid_request("no focusing file"))?;
|
let focus_file = focus_file.ok_or_else(|| invalid_request("no focusing file"))?;
|
||||||
|
|
|
@ -18,13 +18,13 @@ use serde::Serialize;
|
||||||
use serde_json::Value as JsonValue;
|
use serde_json::Value as JsonValue;
|
||||||
use sync_ls::just_ok;
|
use sync_ls::just_ok;
|
||||||
use tinymist_assets::TYPST_PREVIEW_HTML;
|
use tinymist_assets::TYPST_PREVIEW_HTML;
|
||||||
use tinymist_query::{LspPosition, LspRange};
|
use tinymist_preview::{
|
||||||
use tinymist_std::error::IgnoreLogging;
|
|
||||||
use tokio::sync::{mpsc, oneshot};
|
|
||||||
use typst_preview::{
|
|
||||||
frontend_html, ControlPlaneMessage, ControlPlaneRx, ControlPlaneTx, DocToSrcJumpInfo,
|
frontend_html, ControlPlaneMessage, ControlPlaneRx, ControlPlaneTx, DocToSrcJumpInfo,
|
||||||
PreviewArgs, PreviewBuilder, PreviewMode, Previewer, WsMessage,
|
PreviewArgs, PreviewBuilder, PreviewMode, Previewer, WsMessage,
|
||||||
};
|
};
|
||||||
|
use tinymist_query::{LspPosition, LspRange};
|
||||||
|
use tinymist_std::error::IgnoreLogging;
|
||||||
|
use tokio::sync::{mpsc, oneshot};
|
||||||
|
|
||||||
use crate::actor::preview::{PreviewActor, PreviewRequest, PreviewTab};
|
use crate::actor::preview::{PreviewActor, PreviewRequest, PreviewTab};
|
||||||
use crate::project::{ProjectInsId, ProjectPreviewState, WorldProvider};
|
use crate::project::{ProjectInsId, ProjectPreviewState, WorldProvider};
|
||||||
|
@ -191,7 +191,7 @@ impl ServerState {
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
let previewer = typst_preview::PreviewBuilder::new(cli_args.preview.clone());
|
let previewer = tinymist_preview::PreviewBuilder::new(cli_args.preview.clone());
|
||||||
let watcher = previewer.compile_watcher();
|
let watcher = previewer.compile_watcher();
|
||||||
|
|
||||||
let primary = &mut self.project.compiler.primary;
|
let primary = &mut self.project.compiler.primary;
|
||||||
|
@ -334,7 +334,7 @@ impl PreviewState {
|
||||||
self.client.handle.spawn(async move {
|
self.client.handle.spawn(async move {
|
||||||
let mut resp_rx = resp_rx;
|
let mut resp_rx = resp_rx;
|
||||||
while let Some(resp) = resp_rx.recv().await {
|
while let Some(resp) = resp_rx.recv().await {
|
||||||
use typst_preview::ControlPlaneResponse::*;
|
use tinymist_preview::ControlPlaneResponse::*;
|
||||||
|
|
||||||
match resp {
|
match resp {
|
||||||
// ignoring compile status per task.
|
// ignoring compile status per task.
|
||||||
|
@ -609,7 +609,7 @@ impl Notification for ScrollSource {
|
||||||
struct NotifDocumentOutline;
|
struct NotifDocumentOutline;
|
||||||
|
|
||||||
impl Notification for NotifDocumentOutline {
|
impl Notification for NotifDocumentOutline {
|
||||||
type Params = typst_preview::Outline;
|
type Params = tinymist_preview::Outline;
|
||||||
const METHOD: &'static str = "tinymist/documentOutline";
|
const METHOD: &'static str = "tinymist/documentOutline";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,14 +4,14 @@ use std::path::Path;
|
||||||
|
|
||||||
use reflexo::debug_loc::SourceSpanOffset;
|
use reflexo::debug_loc::SourceSpanOffset;
|
||||||
use reflexo_typst::{error::prelude::*, Bytes, Error, TypstDocument};
|
use reflexo_typst::{error::prelude::*, Bytes, Error, TypstDocument};
|
||||||
|
use tinymist_preview::{
|
||||||
|
CompileStatus, DocToSrcJumpInfo, EditorServer, Location, MemoryFiles, MemoryFilesShort,
|
||||||
|
};
|
||||||
use tinymist_project::LspCompiledArtifact;
|
use tinymist_project::LspCompiledArtifact;
|
||||||
use tinymist_query::{jump_from_click, jump_from_cursor};
|
use tinymist_query::{jump_from_click, jump_from_cursor};
|
||||||
use typst::layout::{Abs, Point, Position};
|
use typst::layout::{Abs, Point, Position};
|
||||||
use typst::syntax::{LinkedNode, Source, Span, SyntaxKind};
|
use typst::syntax::{LinkedNode, Source, Span, SyntaxKind};
|
||||||
use typst::World;
|
use typst::World;
|
||||||
use typst_preview::{
|
|
||||||
CompileStatus, DocToSrcJumpInfo, EditorServer, Location, MemoryFiles, MemoryFilesShort,
|
|
||||||
};
|
|
||||||
use typst_shim::syntax::LinkedNodeExt;
|
use typst_shim::syntax::LinkedNodeExt;
|
||||||
|
|
||||||
use crate::project::{LspInterrupt, ProjectClient, ProjectInsId};
|
use crate::project::{LspInterrupt, ProjectClient, ProjectInsId};
|
||||||
|
@ -91,7 +91,7 @@ pub struct PreviewCompileView {
|
||||||
pub art: LspCompiledArtifact,
|
pub art: LspCompiledArtifact,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl typst_preview::CompileView for PreviewCompileView {
|
impl tinymist_preview::CompileView for PreviewCompileView {
|
||||||
fn doc(&self) -> Option<TypstDocument> {
|
fn doc(&self) -> Option<TypstDocument> {
|
||||||
self.art.doc.clone()
|
self.art.doc.clone()
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@ pub struct GenerateScriptArgs {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "preview")]
|
#[cfg(feature = "preview")]
|
||||||
pub use typst_preview::{PreviewArgs, PreviewMode};
|
pub use tinymist_preview::{PreviewArgs, PreviewMode};
|
||||||
|
|
||||||
/// Project task commands.
|
/// Project task commands.
|
||||||
#[derive(Debug, Clone, clap::Subcommand)]
|
#[derive(Debug, Clone, clap::Subcommand)]
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[package]
|
[package]
|
||||||
name = "typst-preview"
|
name = "tinymist-preview"
|
||||||
description = "A previewer for the Typst typesetting system."
|
description = "A previewer for the Typst typesetting system."
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
repository = "https://github.com/Enter-tainer/typst-preview"
|
repository = "https://github.com/Enter-tainer/typst-preview"
|
||||||
|
|
30
crates/typst-preview/README.md
Normal file
30
crates/typst-preview/README.md
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
**This is renamed from `typst-preview` to `tinymist-preview` to publish on `crates.io`.**
|
||||||
|
|
||||||
|
# [Typst Preview](https://github.com/Enter-tainer/typst-preview)
|
||||||
|
|
||||||
|
Preview your Typst files in vscode instantly!
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- Low latency preview: preview your document instantly on type. The incremental rendering technique makes the preview latency as low as possible.
|
||||||
|
- Open in browser: open the preview in browser, so you put it in another monitor. https://github.com/typst/typst/issues/1344
|
||||||
|
- Cross jump between code and preview: We implement SyncTeX-like feature for typst-preview. You can now click on the preview panel to jump to the corresponding code location, and vice versa.
|
||||||
|
|
||||||
|
For more information, please visit documentation at [Typst Preview Book](https://enter-tainer.github.io/typst-preview/).
|
||||||
|
|
||||||
|
## Extension Settings
|
||||||
|
|
||||||
|
See https://enter-tainer.github.io/typst-preview/config.html
|
||||||
|
|
||||||
|
## Bug report
|
||||||
|
|
||||||
|
To achieve high performance instant preview, we use a **different rendering backend** from official typst. We are making our best effort to keep the rendering result consistent with official typst. We have set up comprehensive tests to ensure the consistency of the rendering result. But we cannot guarantee that the rendering result is the same in all cases. There can be unknown corner cases that we haven't covered.
|
||||||
|
|
||||||
|
**Therefore, if you encounter any rendering issue, please report it to this repo other than official typst repo.**
|
||||||
|
## Known Issues
|
||||||
|
|
||||||
|
See [issues](https://github.com/Enter-tainer/typst-preview/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc) on GitHub.
|
||||||
|
|
||||||
|
## Legal
|
||||||
|
|
||||||
|
This project is not affiliated with, created by, or endorsed by Typst the brand.
|
Loading…
Add table
Add a link
Reference in a new issue