~lthms/ogmarkup

bbdc1751 — Thomas Letan 3 years ago master
fix: Compile ogmarkup documents with a typography of unknown size
feaf8d0c — Thomas Letan 3 years ago
refactor: Drop the [Renderer] trait in favor of [Output]

The rational behind this choice is to try use less allocation. Rather
than aggregating small pieces of output together, we use the same
variable that we pass as a mutable reference during the generation.

The key insight here is that it shall be more efficient.
a7323e5c — Thomas Letan 3 years ago
fix: Remove the lifetime parameter of the [Renderer] trait

This lifetime was causing some trouble when the output of
[ogmarkup::render] outlived the input buffer.  In such a case, the
borrow checker was confused.
20346a1b — Thomas Letan 3 years ago
deps: Update to nom-5.0.0

This new version of nom introduces several breaking changes that
required some rewriting. The overall performance is basically
equivalent, which is good news.
66cc6e90 — Thomas Letan 3 years ago
fix: Accept documents with incomplete aside markers

Before this patch, the following snippet wouldn’t be accepted:

    _________________

Now, the parser behaves as expected, by returning an ill-formed
section.
158b13fe — Thomas Letan 3 years ago
fix: Support empty documents and documents with leading spaces

Before this patch, empty documents were parsed as a document with only
one empty ill-formed section. In addition, documents with leading
spaces also had their own issues.

Even though the solution implemented in this patch is not as clean as
one would have hoped, it improves the situation, and both classes of
documents are now parsed as users would expect.
3adbbc42 — Thomas Letan 3 years ago
feature: Support special typography when a character speaks twice

Consider the following ogmarkup snipput:

    [Bonjour,| dit-il.|](foo)

    [Je suis venu.](foo)

Both dialogue lines are from the character `foo'. Before this patch,
this would have been rendered as:

    « Bonjour, dit-il.

    — Je suis venu. »

This is clearly misleading.

At least in French, there is a special typographic approach to deal
with dialogue written as several paragraphs, and that is to use the
closing quotes in place of the long hyphen. With this patch, the
ogmarkup snippet is now rendered as:

    « Bonjour, dit-il.

    » Je suis venu. »

The English typography does not introduce any particular character, so
an equivalent text would be rendered as:

    “ Hi, he says.

    I came.”
b892cc48 — Thomas Letan 3 years ago
chore: Make [join] an inner function of the module [stats]
c98d685f — Thomas Letan 3 years ago
chore: Fix clippy warnings

Clippy is a linter for rust code. The following patch applies the fix
suggestion for various warning we had in the codebase.
731a3eab — Thomas Letan 3 years ago
doc: Add a first draft of README
ecdc3bde — Thomas Letan 3 years ago
chore: Use sourcehut continuous integration system
eb8ab039 — Thomas Letan 3 years ago
chore: Apply rustfmt with no configuration
a60c02fd — Thomas Letan 3 years ago
deps: Update nom to 4.2
19979b67 — Thomas Letan 3 years ago
deps: Update maud to 0.20
34d0cd8f — Thomas Letan 4 years ago
deps: Update maud to 0.19

This update is necessary for maud to work with latest nightly (which
is 1.31 at the time of this commit). Fortunately, the change is really
straightforward, as the diff shows.
3321dd5f — Thomas Letan 4 years ago
fix: Do not insert a closing dialogue tag if not necessary

The commit 326b6e7c0 was not fixing properly the bug mentioned in the
patch description. The empty paragraph was gone indeed, but it was
erroneously inserting a closing dialogue tag (e.g. » in French) in
some situation.

For instance, the following ogmarkup document

    [Hi]

    [Hi?]

was affected.
326b6e7c — Thomas Letan 4 years ago
fix: Do not insert a between_dialogue tag at the end of a paragraph

In the previous version of the code, typically with the html
generator, the result was an empty paragraph because the code was
inserting </p><p> at the end of the paragraph.
bd40184d — Thomas Letan 4 years ago
fix: Add a proper class to story HTML template

The previous version was hard to select from a CSS perspective. It was
possible, but not “obvious.” This alternative implementation makes
more sense from that perspective.
1e6b74d9 — Thomas Letan 4 years ago
refactor: Add the author of a reply to its template

If we consider the HTML use case, it makes sense not to propagate the
author of a dialogue or thought reply to the actual content of this
reply, thanks to how CSS works.

Other use case, including BBCode and LaTeX, makes it less easy to
style a reply based on its author.
a702b6c2 — Thomas Letan 4 years ago
chore: Give the crate its due name
Next