From 37ac5d966ebaf97ac79c507028cd5b742b510b89 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Tue, 1 Nov 2022 16:56:35 +0100 Subject: More dynamic content representation --- src/lib.rs | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index c7e47ffa..caba9707 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -54,8 +54,7 @@ use comemo::{Prehashed, Track}; use crate::diag::{FileResult, SourceResult}; use crate::font::{Font, FontBook}; use crate::frame::Frame; -use crate::model::StyleMap; -use crate::model::{Content, Route, Scope}; +use crate::model::{Content, Route, Scope, StyleMap}; use crate::syntax::{Source, SourceId}; use crate::util::{Buffer, EcoString}; @@ -130,13 +129,18 @@ impl Default for Config { /// Definition of certain standard library items the language is aware of. #[derive(Debug, Clone, Hash)] pub struct LangItems { - pub strong: fn(Content) -> Content, - pub emph: fn(Content) -> Content, - pub raw: fn(EcoString, Option, bool) -> Content, - pub link: fn(EcoString) -> Content, - pub ref_: fn(EcoString) -> Content, - pub heading: fn(NonZeroUsize, Content) -> Content, - pub list_item: fn(Content) -> Content, - pub enum_item: fn(Option, Content) -> Content, - pub desc_item: fn(Content, Content) -> Content, + pub space: fn() -> Content, + pub linebreak: fn(justify: bool) -> Content, + pub text: fn(text: EcoString) -> Content, + pub smart_quote: fn(double: bool) -> Content, + pub parbreak: fn() -> Content, + pub strong: fn(body: Content) -> Content, + pub emph: fn(body: Content) -> Content, + pub raw: fn(text: EcoString, tag: Option, block: bool) -> Content, + pub link: fn(label: EcoString) -> Content, + pub ref_: fn(target: EcoString) -> Content, + pub heading: fn(level: NonZeroUsize, body: Content) -> Content, + pub list_item: fn(body: Content) -> Content, + pub enum_item: fn(number: Option, body: Content) -> Content, + pub desc_item: fn(term: Content, body: Content) -> Content, } -- cgit v1.2.3