Flat: Adjust syntax for grammar definitions

Change the syntax used for specifying grammar definitions as follows:

- Definitions contain a colon after the identifier instead of "<-", and
  must now end with a semicolon, e.g.:

    Grammar    : Spacing Definition+ EndOfFile;
    Definition : Identifier COLON Expression SEMI;

- Use | instead of / to delimit choices. The former is what is normally
  used for BNF-style grammar syntax and is likely to be more familiar to
  people. The original PEG grammar indicated that / was to denote
  ordered choice, but in Flat we'll just say that | is implicitly
  ordered choice.

- As a matter of style, use double quotes instead of single quotes for
  representing literals in the built-in grammar file, and when printing
  out grammars. This is not a change in the language, but just in the
  default representation.

The built-in grammar file, in experiments/flat/grammars, is now called
flat.flat instead of peg.peg, to reflect the fact that we're now moving
towards our own syntax, and adding new constructs that are not in pure
PEGs.
8 files changed
tree: 1a5168dbdfee27a74439fa1d662171ec431f612d
  1. consumers/
  2. DocFormats/
  3. Editor/
  4. experiments/
  5. sample/
  6. schemas/
  7. scripts/
  8. .gitattributes
  9. .gitignore
  10. CMakeLists.txt
  11. CorinthiaDirectoryTree.html
  12. LICENSE.txt
  13. NOTICE.txt
  14. README.md
README.md

About Apache Corinthia (incubating)

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.

License

Corinthia is licensed under the Apache License version 2.0; see LICENSE.txt for details.

What the library can do

  1. Create new HTML files from a .docx source
  2. Create new .docx files from a HTML source
  3. Update existing .docx files based on a modified HTML file produced in (1)
  4. Convert .docx or HTML files to LaTeX
  5. Provide access to document structure, in terms of a DOM-like API for manipulating XML trees, and an object model for working with CSS stylesheets

Components

There are three major components, in their respective directories:

  • DocFormats - the library itself
  • dfutil - a driver program used for running [...]
  • automated tests (located in the tests directory)

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.

Platforms and dependencies

Corinthia builds and runs on iOS, OS X, Linux and Windows.

To build DocFormats, you will need to have the following installed:

Build instructions

Corinthia currently builds on Linux, OS X (mac) and Windows. See the build instructions.

Contributing

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.