Awesome.

On Thursday, June 22, 2023 at 2:56:13 PM UTC+1 Sebastien Binet wrote:

> hi there,
>
> I've just cut [`o...@v0.1.0`][1], an OpenOffice document parser, 
> "automatically" generated from the RelaxNG specification document.
>
> `odt` also provides `odt2md`, a command that tries its best to convert an 
> ODT file into a CommonMark one.
>
> ```
> $> go install sbinet.org/x/odt/cmd/odt2md@latest
> $> odt2md -h
> odt2md converts an ODT document into a CommonMark one.
>
> Usage: odt2md [OPTIONS] [INPUT.odt]
>
> Example:
>
> $> odt2md input.odt
> $> odt2md input.odt > out.md
> $> odt2md -o out.md input.odt
> $> odt2md < input.odt > out.md
> $> odt2md -o out.md < input.odt
>
> Options:
> -o string
> path to output CommonMark file
>
> $> odt2md ./testdata/simple.odt
>
> # Title
>
> Hello World!
>
> ```
>
> One can find the expected output of a more involved example under
> 'cmd/odt2md/testdata/hello_golden.md'.
>
> The parser isn't complete (yet?) and a more robust solution would be to
> really generate it from the RelaxNG specification document (instead of
> from a simplified one.)
>
> Handling preformatted blocks of text could be improved.
> right now, it just translates it to a sequence of `foo`\n`bar` instead of:
> ```
> foo
> bar
> ```
> but this is coming from an impedance mismatch between how ODT encodes
> this information and how CommonMark expects it.
> some heuristics could fix that.
>
> -s
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/fa62ba5a-762f-4b03-8099-a32ede2111b4n%40googlegroups.com.

Reply via email to