all repos — h3rald @ b5555060ecf07f71d1482dff01243e44fe4e175f

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
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
----- 
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
- "Development Wiki": http://wiki.github.com/h3rald/glyph
- "Download": http://www.rubygems.org/gems/glyph
- "Book (PDF)": http://github.com/h3rald/glyph/blob/master/book/output/pdf/glyph.pdf
- "Docs": http://yardoc.org/docs/h3rald-glyph/
- "User Group": http://groups.google.com/group/glyph-framework
status: Active
version: 0.3.0
-----

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

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 <a href="http://www.princexml.com/">Prince</a>).

<br style="clear:both" />

<div class="section">
<h3 id="h_1">Main Features</h3>
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 @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), 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.

</div>

<div class="section">
<h3 id="h_2">Installation</h3>
@gem install glyph@ -- simple, as always.

</div>

<div class="section">
<h3 id="h_3">Essential Glyph commands</h3>
Glyph is 100% command line. Its interface resambles <a href="http://git-scm.com/">Git's</a> for its simplicity and power (thanks to the <a href="http://github.com/davetron5000/gli">gli</a> 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 <a href="http://www.princexml.com/">Prince</a>.
* @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.

</div>

<div class="section">
<h3 id="macros_nutshell">Glyph macros in a nutshell</h3>
Format your documents using Textile or Markdown, and use Glyph Macros to do everything else:

**Glyph Source:**

<div class="code">
<pre>
<code>
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].
  ]   
]
</code>
</pre>
</div>

**HTML Output:**

<div class="code">
<pre>
<code>
<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>
</code>
</pre>
</div>

</div>

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