mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-11-23 12:46:43 +00:00
feat: conditionally render code in docs (#824)
* feat: conditionally render code in docs * fix: fmt * fix: config
This commit is contained in:
parent
8b3a0e986a
commit
da1e68ad1f
17 changed files with 226 additions and 71 deletions
|
|
@ -5,6 +5,7 @@ use parking_lot::Mutex;
|
|||
use tinymist_world::base::{EntryState, ShadowApi, TaskInputs};
|
||||
use typlite::scopes::Scopes;
|
||||
use typlite::value::Value;
|
||||
use typlite::TypliteFeat;
|
||||
use typst::foundations::Bytes;
|
||||
use typst::{
|
||||
diag::StrResult,
|
||||
|
|
@ -36,8 +37,13 @@ pub(crate) fn convert_docs(ctx: &SharedContext, content: &str) -> StrResult<EcoS
|
|||
|
||||
let conv = typlite::Typlite::new(Arc::new(w))
|
||||
.with_library(DOCS_LIB.clone())
|
||||
.with_color_theme(ctx.analysis.color_theme)
|
||||
.annotate_elements(true)
|
||||
.with_feature(TypliteFeat {
|
||||
color_theme: Some(ctx.analysis.color_theme),
|
||||
annotate_elem: true,
|
||||
soft_error: true,
|
||||
remove_html: ctx.analysis.remove_html,
|
||||
..Default::default()
|
||||
})
|
||||
.convert()
|
||||
.map_err(|e| eco_format!("failed to convert to markdown: {e}"))?;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue