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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn main() -> Result<()> { | |
let conn = kls::get_database().unwrap(); | |
kls::migrations::run_migrations(&conn).unwrap(); | |
for date in keyr::list_days()? { | |
let mut file = DayFile::open(&date, OpenOptions::new().read(true).clone())?; | |
file.read_global_count()?; | |
loop { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait Func<A, B> { | |
fn apply(&self, x: A) -> B; | |
} | |
pub struct Curry<A, B>(Box<Fn(A) -> B>); | |
impl<A, B> Func<A, B> for Curry<A, B> { | |
fn apply(&self, x: A) -> B { | |
(self.0)(x) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Require Import Coq.Logic.ProofIrrelevance. | |
Require Import Coq.Program.Tactics. | |
Ltac simpl_exist_eq := | |
match goal with | |
| [ |- exist _ ?x _ = exist _ ?y _] | |
=> let H := fresh "H" | |
in cut (x = y); | |
[ intro H; | |
apply eq_sig with (p:=H); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Require Import Coq.Logic.ProofIrrelevance. | |
Require Import Coq.Program.Tactics. | |
Ltac simpl_exist_eq := | |
match goal with | |
| [ |- exist _ ?x _ = exist _ ?y _] | |
=> let H := fresh "H" | |
in cut (x = y); | |
[ intro H; | |
apply eq_sig with (p:=H); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE sheets ( | |
id SERIAL PRIMARY KEY, | |
character_id INTEGER NOT NULL REFERENCES characters, | |
created TIMESTAMP NOT NULL DEFAULT now(), | |
validated TIMESTAMP, | |
current BOOLEAN, | |
future BOOLEAN, | |
invalidated TIMESTAMP, | |
name VARCHAR(80) NOT NULL, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE entities ( | |
id SERIAL PRIMARY KEY, | |
time INT4RANGE, | |
class SMALLINT NOT NULL | |
); | |
CREATE TABLE documents ( | |
id SERIAL PRIMARY KEY, | |
language INT2 NOT NULL, | |
raw TEXT NOT NULL, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[test] | |
fn test_render() { | |
use typography::ENGLISH; | |
use generator::test::Html; | |
assert_eq!( | |
render_galatian_document(r#"It looks like it is working. | |
+I+ | |
smiled *at |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[test] | |
fn test_document() { | |
assert_eq!( | |
document(r#"She opened the letter, and read it. | |
_____letter____ | |
Dear friend. | |
I love you. | |
_______________"#), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[test] | |
fn test_paragraph() { | |
assert_eq!( | |
paragraph("[Hi stranger, this is me.] Indeed.\n\n[Hi]"), | |
Ok( | |
( | |
"\n\n[Hi]", | |
Paragraph( | |
vec![ | |
Component::Dialogue( |
NewerOlder