Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Affix modeling #108

Open
bdarcus opened this issue Jul 11, 2023 · 1 comment
Open

Affix modeling #108

bdarcus opened this issue Jul 11, 2023 · 1 comment

Comments

@bdarcus
Copy link
Owner

bdarcus commented Jul 11, 2023

I started to work on this, but think I'll defer.

Ideally, should be able to separately format them from main content, per below, though that does add complexity.

#[derive(Debug, Deserialize, Serialize, Clone, JsonSchema, PartialEq)]
pub struct Affix {
    pub content: AffixContent,
    pub wrap: Option<WrapPunctuation>,
    pub rendering: Option<Rendering>,
}

#[derive(Debug, Deserialize, Serialize, Clone, JsonSchema, PartialEq)]
/// A literal string or localized term to be added to the beginning or end of a rendered component.
pub enum AffixContent {
    Literal(String),
    Term(String),
}

A more limited alternative would just be to turn off formatting of the prefix or suffix.

@bdarcus
Copy link
Owner Author

bdarcus commented Jul 26, 2023

See also #118, and note about using djot for field formatting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant