mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-11-24 13:10:07 +00:00
feat: bump typst to v0.13.0-rc1 (#1342)
* dev: use range type from lsp-types * feat: add html document variant * feat: use new-style bytes constructors * fix: broken span usages * fix: syntax kind is changed * fix: label use pico str * fix: bib element is changed * fix: raw element is changed * fix: typst use codex * fix: package fn is removed from world trait * feat: reflexo accept typst document * docs: update changelog * dev: cargo patch * fix: typst pdf timestamp is changed * fix: pattern is renamed to tiling * dev: make eval compat * test: update snapshots * build: bump version to nightly 0.12.19-rc4 * build: bump version to 0.12.19-rc1 (#1164) * build update changelog * build: bump version to 0.12.19-rc1 * build: bump version to nightly 0.12.19-rc2 (#1221) * feat: update typst to `85d1778` * deps: lock git deps version * build: bump version to 0.12.19-rc2 * docs: remove rc in changelog * fix: mathtext formatting of typstyle * fix: completion related to mathtext * build: update cargo.lock * build: bump version to nightly 0.12.19-rc3 (#1232) * build: bump version to nightly 0.12.19-rc4 (#1239) * feat: add typst-html * feat: add typst-html * cargo patch * fix: features doesn't take effect * fix: casting * fix: broken no-content-hint * fix: snapshot * fix: remove unnecessary `fs` feature * fix: move system features feature * feat: remove nightly shim * test: update snapshot * dev: nightly v0.12.21 (#1279) * feat: update typst to `0ea6680` feat: update typst to `0ea6680` build: bump version to nightly 0.12.19 (#1261) * fix: fix lint errors * styl: fotmat * fix: build web ci * build: update cargo.toml * build: bump version to nightly 0.12.21-rc1 (#1280) * build: update typstyle & reflexo (#1336) * build: update typstyle & reflexo * dev: remove useless patches --------- Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com> * build: update version * fix: pdf gate were broken (#1285) * fix: panic on convert_datetime (#1286) * feat: run language sever with targeting html (#1284) * dev: add some debug logging * feat: html compilation * fix: revert changes * feat: adjust html interfaces * feat: lock reflexo * feat: provide exportTarget configuration * feat: export html actions when target is html * build: bump reflexo * fix: system feature gate * fix: feature gate 2 * fix: feature gate 3 * feat: make tinymist-world featured by lsp * feat: text export over typst's HTML export (#1289) * feat: add more doc, world, and task apis (#1290) * feat: add num of pages method * feat: add from_snapshot_inner method * feat: add clear_dedicates method * feat: more convertion traits * feat: add doc_get_as_value method * feat: add doc_get_as_value method * feat: add cast_run method * fix: set is compiling flag (#1293) * feat: publish {tinymist-{derive,analysis,std,vfs,world,project},typlite,crityp} crates (#1310) * build: bump version to 0.12.21-pre-rc1 * fix: deps * build: set nightly in nightly branch * docs: add readmes for publish * feat: add release crates action * dev: remove publish of sync-lsp * dev: remove useless setup * fix: remove readme * fix: publish ignore errors * fix: specify version for publish * fix: specify version for publish * feat: update tinymist-web version * test: update snapshot * fix: diverged deps --------- Co-authored-by: ParaN3xus <136563585+ParaN3xus@users.noreply.github.com>
This commit is contained in:
parent
0260bfb527
commit
d21ebc38dc
137 changed files with 1722 additions and 1156 deletions
|
|
@ -12,7 +12,11 @@ pub(crate) mod well_known {
|
|||
|
||||
pub use typst::layout::Abs as TypstAbs;
|
||||
|
||||
pub use typst::model::Document as TypstPagedDocument;
|
||||
pub use typst::Document as TypstDocumentTrait;
|
||||
|
||||
pub use typst::layout::PagedDocument as TypstPagedDocument;
|
||||
|
||||
pub use typst::html::HtmlDocument as TypstHtmlDocument;
|
||||
|
||||
pub use typst::text::Font as TypstFont;
|
||||
|
||||
|
|
@ -28,13 +32,24 @@ pub(crate) mod well_known {
|
|||
pub enum TypstDocument {
|
||||
/// The document compiled with `paged` target.
|
||||
Paged(Arc<well_known::TypstPagedDocument>),
|
||||
/// The document compiled with `html` target.
|
||||
Html(Arc<well_known::TypstHtmlDocument>),
|
||||
}
|
||||
|
||||
impl TypstDocument {
|
||||
/// Gets the number of pages in the document.
|
||||
pub fn num_of_pages(&self) -> u32 {
|
||||
match self {
|
||||
Self::Paged(doc) => doc.pages.len() as u32,
|
||||
Self::Html(_doc) => 1u32,
|
||||
}
|
||||
}
|
||||
|
||||
/// Gets details about the document.
|
||||
pub fn info(&self) -> &typst::model::DocumentInfo {
|
||||
match self {
|
||||
Self::Paged(doc) => &doc.info,
|
||||
Self::Html(doc) => &doc.info,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -43,6 +58,45 @@ impl TypstDocument {
|
|||
pub fn introspector(&self) -> &typst::introspection::Introspector {
|
||||
match self {
|
||||
Self::Paged(doc) => &doc.introspector,
|
||||
Self::Html(doc) => &doc.introspector,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Arc<well_known::TypstPagedDocument>> for TypstDocument {
|
||||
fn from(doc: Arc<well_known::TypstPagedDocument>) -> Self {
|
||||
Self::Paged(doc)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Arc<well_known::TypstHtmlDocument>> for TypstDocument {
|
||||
fn from(doc: Arc<well_known::TypstHtmlDocument>) -> Self {
|
||||
Self::Html(doc)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> TryFrom<&'a TypstDocument> for &'a Arc<well_known::TypstPagedDocument> {
|
||||
type Error = crate::Error;
|
||||
|
||||
fn try_from(doc: &'a TypstDocument) -> Result<Self, Self::Error> {
|
||||
match doc {
|
||||
TypstDocument::Paged(doc) => Ok(doc),
|
||||
TypstDocument::Html(_doc) => {
|
||||
crate::bail!("The document is compiled with `html` target, not `paged`.")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> TryFrom<&'a TypstDocument> for &'a Arc<well_known::TypstHtmlDocument> {
|
||||
type Error = crate::Error;
|
||||
|
||||
fn try_from(doc: &'a TypstDocument) -> Result<Self, Self::Error> {
|
||||
match doc {
|
||||
TypstDocument::Paged(_doc) => {
|
||||
crate::bail!("The document is compiled with `paged` target, not `html`.")
|
||||
}
|
||||
TypstDocument::Html(doc) => Ok(doc),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue