commit | 1707a7125eef6cf208ea17f1887b6e669ce5f8eb | [log] [tgz] |
---|---|---|
author | Peter Kelly <peter@uxproductivity.com> | Fri Jul 17 15:09:34 2015 +0700 |
committer | Peter Kelly <peter@uxproductivity.com> | Fri Jul 17 15:14:16 2015 +0700 |
tree | 1007fcc4010c61b5031d272b3afdfae61868c8c9 | |
parent | c6a23ee023657a18384c30ddf5454e4cf43e1bb8 [diff] |
Flat: Build Grammar object from parsed PEG file Introduce the ability to construct a new Grammar object from the results of parsing a grammar file in the PEG syntax. This allows us to write custom grammars to support arbitrary text-based file formats. The grammar building process works by traversing a tree of Term objects produced as a result of a parse. As each instance of the Definition production is constructed, an Expression object is created for its body based corresponding portion of the parse tree, and a new definition is added to the Grammar object being built. The resulting grammar can then be used to parse a file in the syntax defined by that grammar - though this is not yet supported as a command-line option. Currently, a large number of assert statements are used when processing the Term tree. These sanity checks ensure that the terms match what we expect from the grammar. It is anticipated that in the future it will be possible to write processing code in a more type-safe manner, both to a limited extent in C, and using a dedicated tree-transformation language to be integrated with the parsing process. The current parser is essentially an interpreter which we can extend with additional language constructs to support this transformation.
Corinthia is a library for converting between different word-processing file formats. Initially, it supports .docx (part of the OOXML specification), HTML, and LaTeX (export-only). The Corinthia project also provides convenience executables. The library has shipped as part of UX Write since February 2013.
On December 8, 2014, Corinthia entered the Apache Software Foundation incubator. The accepted proposal and incubation status provide incubation background and progress information.
The communication hub of the project is the development mailing list,
dev @ corinthia.incubator.apache.org
To receive list postings and interact on the list, simply send a message to
dev-subscribe @ corinthia.incubator.apache.org
from the email address to receive list messages at. The reply from the list robot to that address provides confirmation instructions and information on managing the subscription.
There are a Corinthia incubator web site, a project wiki, and a JIRA issue tracker.
The sites and documentation for this project are at a preliminary stage. Content will be moved to Apache and improved as incubation moves along.
Meanwhile, there is a Facebook page and a Twitter account, @ApacheCorinthia.
Corinthia is licensed under the Apache License version 2.0; see LICENSE.txt for details.
There are three major components, in their respective directories:
DocFormats
- the library itselfdfutil
- a driver program used for running [...]Run dfutil without any command-line arguments to see a list of operations. Here is an example of converting a .docx file to HTML, modifying it, and then updating the original .docx. Note that it is important, due to how internal mapping works, that the .docx file being written is the same file as the original; using a new file won't work.
dfutil filename.docx filename.html vi filename.html # Make some changes dfutil filename.html filename.docx
If you examine the convertFile function in dfutil/Commands.c
, you will see the main entry points to perform these conversions, which you can call from your own program.
Corinthia builds and runs on iOS, OS X, and Linux. Windows support is in the works.
To build DocFormats, you will need to have the following installed:
Corinthia currently builds on Linux and OS X (mac). See the build instructions.
Contributors are welcome and prized. Details on how to participate on the project will be posted soon.
Meanwhile, the easiest way to contribute is by subscribing to the development list and asking your questions and offering suggestions there.