Main Features
Command Line Interface
Glyph is 100% command line. Its interface resambles
Git's for its simplicity and power (thanks to the
gli gem). Here are some example commands:
* @glyph init@ -- to initialize a new Glyph project in the current (empty) directory.
* @glyph add introduction.textile@ -- to create a new file called _introduction.textile_.
* @glyph compile@ -- to compile the current document into a single HTML file.
* @glyph compile --auto@ -- to keep recompiling the current document every time a file is changed.
* @glyph compile -f pdf@ -- to compile the current document into HTML and then transform it into PDF.
* @glyph compile readme.glyph@ -- to compile a _readme.glyph_ located in the current directory into a single HTML file.
* @glyph outline -l 2@ -- Display the document outline, up to second-level headers.
* @glyph stats@ -- Display project statistics.
Minimalist Syntax
Glyph syntax rules can be explained using Glyph itself:
section[
@title[Something about Glyph]
txt[
You can use Glyph macros in conjunction
with _Textile_ or _Markdown_ to
produce HTML files effortlessly.
]
p[Alternatively, you can just use em[Glyph itself] to generate HTML tags.]
section[
@title[What about PDFs?]
@id[pdf]
p[
Once you have a single, well-formatted HTML
file, converting it to PDF is
extremely easy with a free 3rd-party
renderer like =>[http://www.princexml.com|Prince]
or =>[http://code.google.com/p/wkhtmltopdf/|wkhtmltopdf].
]
]
]
The Glyph code above corresponds to the following HTML code:
Something about Glyph
You can use Glyph macros in conjunction with
Textile or Markdown to
produce HTML files effortlessly.
Alternatively, you can just use Glyph itself
to generate HTML tags.
What about PDFs?
Once you have a single, well-formatted HTML
file, converting it to PDF is
extremely easy with a free 3rd-party renderer
like Prince
or wkhtmltopdf.
Content Reuse
Finding yourself repeating the same sentence over an over? Glyph allows you to create snippets. Within snippets. Within other snippets (and so on, for a long long time...) as long as you don't define a snippet by defining itself, which would be kinda nasty (and Glyph would complain!):
snippet:[entities|snippets and macros]
snippet:[custom_definitions|
p[Glyph allows you to define your own &[entities].]
]
&[custom_definitions]
...which results in:
Glyph allows you to define your own snippets and macros.
If yourself dreaming about _parametric_ snippets, just create your own macros (see the
source of Glyph's changelog, just to have an idea).
Automation of Common Tasks
If you're writing a book, you shouldn't have to worry about pagination, headers, footers, table of contents, section numbering or similar. Glyph understands you, and will take care of everything for you (with a little help from CSS3, sometimes).
Reference Validation
Feel free to add plenty of links, snippets, bookmarks, ... if Glyph doesn't find something, it will definitely complain. Broken references are a thing on the past, and you don't need to worry about it.
Extreme Extensibility
* You miss a !!!
macro to format really, _really_ important things? Create it. In under 3 seconds, in Ruby or Glyph itself. And yes, you can use special characters, too.
* You want your own, very special special @glyph create --everything@ command to create all _you_ need in a Glyph project? You can do it. Using your own Rake tasks, too.
* You want Glyph to output ODF files? You can do it, and you'll be able to run @glyph generate -f odf@. This would probably require a little more time, but it's trivial, from a technical point of view.
Convention over Configuration
Put your text files in @/text@, your images in @/images@, add custom macros in a @macro@ folder within your @/lib@ folder... you get the picture: Glyph has its special places.
Nonetheless, you also have 1 (_one_) configuration file to customize to your heart's content (with smart defaults).
Free and Open Source
Glyph is 100% Open Source Software, developed using the Ruby Programming Language and licensed under the very permissive terms of the
MIT License.
If you have Ruby installed, just run @gem install glyph@. That's all it takes.