RubyGems Navigation menu

mint 0.7.2

<h2>What is Mint?</h2> <p>Mint transforms your plain text documents into beautiful documents. It makes that process as simple (but customizable) as possible.</p> <p>Why would you want to keep all of your documents as plain text?</p> <ul> <li>To focus on words and structure when you write</li> <li>To be able to apply one style to an entire set of documents with one command</li> <li>To keep your documents under version control</li> <li>To make your documents available for scripting--for example, text analysis</li> </ul> <p>What does Mint create from these source files? Beautiful, styled HTML ready to print, e-mail, and present.</p> <p>In a few words: <em>Mint processes words so you don't have to.</em></p> <h2>The mint command</h2> <p>If you have a plain text document formatted in Markdown or Textile or almost any other templating language, you're ready to go.</p> <p>The easiest Mint command doesn't require configuration. It transforms a document into HTML and links it to the default stylesheet, which I've designed for you.</p> <p>Simply type:</p> <pre><code>mint publish Minimalism.md </code></pre> <p>And voilà, Minimalism.html will show up next to Minimalism.md.</p> <p>Opening Minimalism.html with your favorite web browser--<a href="http://opentype.info/blog/2008/06/14/kerning-and-opentype-features-in-firefox-3/" title="Firefox 3 supports kerning and automatic ligatures">Firefox is best for typography</a>, but Webkit-based browsers (Chrome, Safari) work, too--will show what looks like a word-processed document, complete with big bold headers, italic emphasis, automatically indented and numbered lists, and bullets. If you're in a modern browser, you'll even see ligatures and proper kerning. The page will be on a white canvas that looks like a page, even though you are in a browser.</p> <p>Sending that page to a printer is as easy as clicking "Print" from your browser. What comes out of your printer will have a 12 pt base font, normal margins, and a not-too-cramped baseline. (Ah the wonder of print stylesheets.)</p> <p>You can throw as many files as you'd like in. Any commandline argument <em>not</em> preceded by an option (e.g., <code>--template</code>) or in the <code>mint</code> command vocabulary (more on that in a minute) will be interpreted as a file name:</p> <pre><code>mint publish Minimalism.md Proposal.md Protocol.md </code></pre> <p>This command can be tweaked with options and arguments to be more flexible:</p> <pre><code>mint publish Minimalism.md --template resume # specifies a style template mint publish Minimalism.md --destination final --style-destination=styles </code></pre> <p>For a listing of mint options, take <a href="http://github.com/davejacobs/mint/tree/master/doc/API.md">a look at the API</a>.</p> <h2>A basic Mint document</h2> <p>Mint is loaded with smart defaults, so if you don't want to configure something--say, the basic HTML skeleton of your document or the output directory--you don't have to. You'll probably be surprised at how easy it is to use out of the box, and how configurable it is.</p> <pre><code>document = Document.new "Minimalism.md" document.publish! </code></pre> <p>If you want to customize your document, though--and that's why I built this library--Mint makes that easy.</p> <p>To understand Mint's flexibility, you'll want to <a href="http://github.com/davejacobs/mint/tree/master/doc/API.md">take a look at the API</a>.</p> <h2>Templates</h2> <p>Templates can be written in any format accepted by the Tilt template interface library. (See <a href="http://github.com/rtomayko/tilt/blob/master/TEMPLATES.md" title="A listing of all templates supported by Tilt.">the Tilt TEMPLATES file</a> for more information.)</p> <p>In a template layouts, Ruby calls are sparse but necessary.</p> <p>If you're designing a layout, you need to indicate where Mint should place your content. For that simple reason, raw HTML files cannot be layouts. Instead, if you want to use HTML templates, you should use the ERB format. These files are essentially HTML with the possibility for Ruby calls. You can even use the .html extension for your files. Just code the dynamic portion using ERB syntax.</p> <p>Inside your template, use the <code>content</code> method to place your source's content.</p> <p>You will want to point to your document's stylesheet (via a relative URL) from within your layout, usually in the <code><head/></code> element. Use the <code>stylesheet</code> method.</p> <p>So if you're writing your layout using Haml, the template might look like this:</p> <pre><code>!!! %html %head %link(rel="stylesheet" href=stylesheet) %body #container= content </code></pre> <p>You can build stylesheets using <a href="http://en.wikipedia.org/wiki/Cascading_Style_Sheets">CSS</a>, <a href="http://sass-lang.com/">SASS/SCSS</a> or <a href="http://lesscss.org/">Less</a>. They will always be compiled for you.</p> <p>Mint comes preloaded with several styles and layouts.</p> <ol> <li>Default</li> <li>Zen</li> <li>Resume*</li> <li>Protocol</li> <li>Protocol Flow* - requires Javascript and jQuery</li> </ol> <blockquote> <p>Note: Starred entries are not yet implemented. If you have a killer template you think should be included, send it my way. I'll check it out and see if it should be part of the standard template library. (Of course, you'll get all the credit.)</p> </blockquote> <p>I've included a base stylesheet that is useful for setting sensible typographic defaults.</p> <h2>Plugins: A work in progress</h2> <p>I've designed the beginnings of a plugin system. With this system, you can implement a callback or two and have full control over document creation and sharing. I'll get documentation going soon. For now, look to lib/mint/plugins/epub.rb and bin/mint-epub for an example of how to build one. It's not complete and I'm open to API suggestions. </p> <p>This is going to be useful for things like creating actual office documents or e-books or even bound novels. I'm actually thinking that half the power of this library is its plugin system.</p>

Gemfile:
=

installation:
=

Versions:

  1. 0.7.4 February 12, 2013 (37,5 ko)
  2. 0.7.3 September 21, 2012 (37,5 ko)
  3. 0.7.2 September 21, 2012 (40 ko)
  4. 0.7.1 September 21, 2012 (40 ko)
  5. 0.5.1 December 19, 2011 (33 ko)
Voir toutes les versions (19)

Dépendances de Runtime (14):

erubis >= 0
haml >= 0
hashie >= 0
less >= 0
liquid >= 0
markaby >= 0
nokogiri >= 0
radius >= 0
rdiscount >= 0
rdiscount >= 0
rubyzip >= 0
sass >= 0
tilt >= 0

Dépendances de Development (3):

aruba >= 0
cucumber >= 0
rspec >= 0

Propriétaires:

Auteurs:

  • David Jacobs

Total de contrôle SHA 256:

=

Total de téléchargements 62 142

Pour cette version 3 113

Version publiée:

License:

aucune

Version de Ruby requise: None

Required Rubygems Version: >= 1.3.6

Liens: