all repos — h3rald @ dc32c85f519a3d285d18b99f89fe1958740d9cd6

The sources of https://h3rald.com

content/glyph.textile

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
 100
 101
 102
 103
----- 
permalink: glyph
filters_pre: 
- erb
- redcloth
title: "Project: Glyph"
type: project
github: glyph
links:
- "Repository": http://www.github.com/h3rald/glyph/
- "Bug Tracking": http://www.github.com/h3rald/glyph/issues
- "Book (PDF)": http://github.com/h3rald/glyph/blob/master/book/output/pdf/glyph.pdf
- "Reference Documentation": http://yardoc.org/docs/h3rald-glyph/
- "User Group": http://groups.google.com/group/glyph-framework
status: Active
version: 0.2.0
-----

<%= render 'project_data', :tag => 'glyph' %>

Glyph is a _Rapid Document Authoring Framework_. 

Think of it like a sort of "Ruby On Rails":http://www.rubyonrails.org but for creating text documents instead of web sites. With Glyph, you can manage your documents tidily in _projects_ that can be used to generate deliverables in different formats such as HTML or PDF (through "Prince":http://www.princexml.com).

<br style="clear:both" />

h3. Main Features

!>/img/pictures/glyph.png!

Glyph uses a simple macro system to perform a wide variety of advanced tasks:
* Generate block-level HTML tags not commonly managed by lightweight markups, like @head@, @body@, @div@ and @table@.
* 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), carefully avoiding mutual calls.
* Include text files in other text files.
* Include the contents of configuration settings (author, title) in the document.
* Filter input explicitly or implicitly, based on file extensions when including files. 
* Manage comments and todo items.

h3. Installation

@gem install glyph@ -- simple, as always.

h3. Essential Glyph Commands

Glyph is 100% command line. Its interface "Git's":http://git-scm.com/ for its simplicity and power (thanks to the "Gli":http://github.com/davetron5000/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 using "Prince":http://www.princexml.com.
* @glyph compile readme.glyph@ — to compile _readme.glyph_ located in the current directory into a single HTML file

h3. Glyph macros in a nutshell

Format your documents using Textile or Markdown, and use Glyph Macros to do everything else:

**Glyph Source:**

<pre><code>
section[header[Something about Glyph]
You can use Glyph macros in conjunction
 with _Textile_ or _Markdown_ to
produce HTML files effortlessly.
  section[header[What about PDFs?|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].
  ]   
]
</code></pre>

**HTML Output:**

<pre><code>
<div class="section">
  <h2 id="h_1">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>
  </div>
</div>
</code></pre>

<%= render 'project_updates', :tag => 'glyph' %>