1 unstable release
Uses old Rust 2015
0.99.0 | May 17, 2020 |
---|
#3 in #writers
115KB
1.5K
SLoC
ogmarkup
What is ogmarkup
?
Typographic rules can be trick to enforce in a consistent manner in a
document. In French, typographic rules for dialogues are arguably
worst. ogmarkup
is part of the so-called ogma-project. It is a minimal
domain-specific markup language, intended to free fiction writers from the pain
to enforce typographic rules within their productions manually.
The Language
Formatting
This is a regular sentence.
<p>This is a regular sentence.</p>
This is a regular sentence.
*This is a sentence with emphasize.*</p>
<p><em>This is a regular sentence.</em></p>
This is a regular sentence.
+This is a sentence with strong emphasize.+</p>
<p><strong>This is a sentence with strong emphasize.</strong></p>
This is a sentence with strong emphasize.
This +is+ a *sentence with +multiple emphasizes+*.
<p>This <strong>is</strong> a <em>sentence with <strong>multiple emphasizes</strong></em>.</p>
This is a sentence with multiple emphasizes.
"This is a +quote+."
<p>“This is a <strong>quote</strong>.”</p>
“This is a quote.”
This +is an "incorrect+" sentence.
<p>This <span class="illformed_inline">+is an "incorrect+" sentence.</span></p>
This +is an "incorrect+"
sentence.
<p>This <span class="illformed_inline">+is an "incorrect+"</span> sentence.</p>
Dialogues
[Hi,| she says.|](Clara)
<p><span class="dialogue by-Clara">“<span class="reply">Hi,</span>” she says.</span></p>
“Hi, she says.
[Hi,| she says.| How are you?](Clara)
<p><span class="dialogue by-Clara">“<span class="reply">Hi,</span> she says. <span class="reply">How are you?</span>”</span></p>
“Hi, she says. How are you?”
[Hi,| she says.| How are you?](Clara) [I'm fine, thanks.]
<p><span class="dialogue by-Clara">“<span class="reply">Hi,</span> she says. <span class="reply">How are you?</span>”</span></p><p><span class="dialogue">“<span class="reply">I’m fine, thanks.</span>”</span></p>
“Hi, she says. How are you?”
“I’m fine, thanks.”
[Hi,| she says.| How are you?](Clara) She was smiling. [I'm fine, thanks.]
<p><span class="dialogue by-Clara">“<span class="reply">Hi,</span> she says. <span class="reply">How are you?</span>”</span> She was smiling. <span class="dialogue">“<span class="reply">I’m fine, thanks.</span>”</span></p>
“Hi, she says. How are you?” She was smiling. “I’m fine, thanks.”
It was a hot day. [Hi!| he said.](Aaron)
His friends smiled.
<div><p>It was a hot day.<span class="illformed_inline">[Hi!| he said.](Aaron)</span> His friends smiled. </p></div>
It was a hot day.[Hi!| he said.](Aaron) His friends smiled.
Paragraphs
This is a first paragraph.
This is a second paragraph.
<div><p>This is a first paragraph.</p><p>This is a second paragraph</p>
This is a first paragraph.
This is a second paragraph
[Ceci est une première ligne de dialogue.]
[Ceci est une autre ligne de dialogue.]
<div><p><span class="dialogue">« <span class="reply">Ceci est une première ligne de dialogue.</span></span></p><p><span class="dialogue">— <span class="reply">Ceci est une autre ligne de dialogue.</span></span></p></div>
« Ceci est une première ligne de dialogue.
— Ceci est une autre ligne de dialogue.
The Implementations
A first implementation of an ogmarkup
parser and compiler has been
written in Haskell, and has been published on hackage
(MIT). This first
project has been deprecated in favor of a rewriting in Rust yet to be
released on crates.io
Dependencies
~1MB
~17K SLoC