Glyph is a Rapid Document Authoring Framework.
With Glyph, you can manage your documents tidily in projects and generate deliverables in different formats such as HTML or PDF (through Prince).
Glyph comes with its very own macro system to perform a wide variety of advanced tasks:
- Generate block-level HTML tags not commonly managed by lightweight markups, like
- Create and validate internal and external links.
- Include and validate images and figures.
- Automatically determine header levels based on the document structure.
- Automatically generate a Table of Contents based on the document structure.
- Store common snippets of text in a single YAML file and use them anywhere in your document, as many times as you need.
- Store configuration settings in a YAML file and use them anywhere in your document, as many times as you need.
- Evaluate Ruby code within your document.
- Include content only if certain conditions are satisfied.
- Define macros, snippets and configuration settings directly within your document.
- Highlight source code.
- Call macros from other macros (including snippets), avoiding mutual calls.
- Include text files within other text files.
- Include the value of any configuration setting (like author, title) in the document.
- Filter input explicitly or implicitly (based on file extensions).
- Manage draft comments and todo items.
- Provide a simple, less-verbose syntax to write XML code.
gem install glyph — simple, as always.
Essential Glyph 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 using Prince.
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 macros in a nutshell
Format your documents using Textile or Markdown, and use Glyph Macros to do everything else:
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] Once you have a single, well-formatted HTML file, converting it to PDF is extremely easy with a 3rd-party renderer like =>[http://www.princexml.com|Prince]. ] ]
<div class="section"> <h2 id="h_10">Something about Glyph</h2> <p> You can use Glyph macros in conjunction with <em>Textile</em> or <em>Markdown</em> to produce HTML files effortlessly. </p> <div class="section"> <h3 id="pdf">What about PDFs?</h3> <p> Once you have a single, well-formatted HTML file, converting it to PDF is extremely easy with a 3rd-party renderer like <a href="http://www.princexml.com">Prince</a>. </p> <p> Alternatively, you can just use <em>Glyph itself</em> to generate HTML tags. </p> </div> </div>
- Home Page: http://www.h3rald.com/glyph/
- Repository: http://www.github.com/h3rald/glyph/
- Bug Tracking: http://www.github.com/h3rald/glyph/issues
- Development Wiki http://wiki.github.com/h3rald/glyph
- RubyGem Download http://www.rubygems.org/gems/glyph
- Book (PDF): http://github.com/h3rald/glyph/raw/0.3.0/book/output/pdf/glyph.pdf
- Reference Documentation: http://yardoc.org/docs/h3rald-glyph/
- User Group: http://groups.google.com/group/glyph-framework