Posts tagged “declarative-text-kit”
2024
Logical Ranges and Character Ranges
Text editing is different from text inspection, and I believe I'm on the path towards a more expressive domain.
We don’t think about this as we write: the blinking cursor tells a useful lie about what the text looks like, so we can work on an abstraction that is about the space between characters, and especially the space after the last character.
Declarative Text Kit: Word Ranges
Writing a somewhat language-agnostic detector of word boundaries is no small feat.
Declarative Text Kit: Token-Based Adapters
With a semantic FencedCodeBlock type added to my app, performing changes on existing code blocks is not procedural anymore. It is now a one-liner.
Declarative Text Kit: Reduction in Ugly Code Size
Great news: This week’s v0.3 release of the Package is good enough to implement the feature I wanted to build!
Declarative Text Kit: Expression and Evaluation
To declare changes in the DSL, we need a vocabulary of expressions and sort of a grammar. With Result Builders, this is surprisingly simple.
Declarative Text Kit: Inserting Strings and Lines With a Result Builder
Swift Result Builders make the declarative Text Kit API quite nice to work with once you know what you want to do. Here’s how I got over the initial humps.
Declarative Text Kit: Sketch of an API
I was fed up with writing long procedures to perform markup changes on the fly. This post contains an API that looks like something I would like to use.