1 stable release

1.0.0 Mar 6, 2021

#2222 in Embedded development

Custom license

11KB
257 lines

Inline KDL

Crate release version Crate license: Parity 7.0.0 Uses Caretaker Maintainership

KDL is a document language with xml-like semantics that looks like you're invoking a bunch of CLI commands!

Inline KDL (short: i-kdl, extension: ikdl, pronounced: i cuddle) is an extension of KDL where KDL fragments can be embedded in a larger text document.

i-kdl uses < and > to indicate a KDL fragment. An i-kdl document is a list of zero or more Texts interspersed with zero or more Nodes.

Examples

Simple:

Hic voluptatem eum et repudiandae nisi cum qui sed. Voluptatum molestiae recusa
quod<note latin="quī" case="nominative" gender="neuter" number="singular"> quas
suscipit reprehenderit eos commodi. Dolores earum iste tempore culpa ut nostrum.

Can span multiple lines (remembering to use KDL line continuations where appropriate):

Inflection of quī (“who, which”), Proto-Indo-European *kʷod, whence also <etymology \
	word="hwæt" \
	lang="Old English" \
	{
		translation {
			text "what"
			lang "English"
		}
	}
>.

KDL fragment can contain <> in strings etc.

i-kdl uses <code "<"> and <code ">"> to indicate a KDL fragment.

You can escape a < in text with \\:

Escaping \< is possible: <true>.

License

The code in this repository is covered by the Parity License, a strong copyleft license. That means that you can only use this project if you're working on an open source-licensed product (MIT/Apache projects are ok!)

Dependencies

~3.5MB
~67K SLoC