Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

textigniter

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

textigniter

  • 0.0.36
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

h1. Textigniter

Follow us on twitter "@textigniter":http://twitter.com/textigniter

Textigniter uses the power of "Textile":http://redcloth.org/ ("Markdown":http://kramdown.rubyforge.org/ is optional...), "Liquid":http://liquidmarkup.org/, "LESS CSS":http://lesscss.org/, and "Coffee Script":http://jashkenas.github.com/coffee-script/ to create static websites.

h2. Installation

It's easy

@gem install textigniter@

The default parser gem's will be downloaded as well.

h2. Usage

@textigniter init (directory)@

Passing the init option initializes a new textigniter environment in your current directory. You can pass a second option to specify a directory that you want to install textigniter in. The textigniter environment is found under a hidden directory named .textigniter.

@textigniter build (directory)@

Passing the build option will make textigniter parse the .textigniter directory and output the static html alongside the .textigniter directory.

Passing the build option also creates a manifest (.textigniter/manifest/) for the system to key off of in the future. The manifest tells textigniter only to rebuild modified or new files.

@textigniter list (directory)@

This will print out a list all textigniter files unless you specify a directory. Passing the directory option will list only that directory (Duh?) This is the only textigniter command that requires you to be in the textigniter environment to work.

@textignier scrub (directory)@

WARNING: essentially an rm -r unix command at this point. If you run it with directory specified, it will remove the entire directory and not just textigniter content

When you pass the scrub option, all textigniter related files and folders will be removed (I'm rethinking the use of this. It will probably "scrub" the base folder of anything not found in the textigniter environment instead).

@textigniter help@

Passing help on the command line will print out usage of textigniter.

h2. Configuration

You can add any key:value pair to ./textigniter/config.yml as long as it follows YAML format. Anything added to the config file is available as a variable in your templates.

If you have @site_name: Textigniter@ in the config file, it would be available in your templates as @{{ site_name }}@

h2. Content

Content is stored in text files instead of a database. You can find a default index.textile and about.textile under the .textigniter/content folder. Your folder structure will determine your site structure. If you wanted a link that was yoursite.com/articles/textigniter, your folder and file structure would be .textigniter/content/articles/textigniter.textile. If you decide to use markdown instead of textile, make sure to update config.yml with the correct text_parser and change your file extensions from .textile to .markdown.

These text files are broken down into a meta section and sections delimited by @-- content@, @-- variable_name@. The meta section is parsed with YAML and all other sections are parsed with Textile. You can use any variable name you want for the text section and they'll be available to the template parser. This is true for the meta section as well. An example file could look something like this:

title: Textigniter slug: textigniter tags: static, content, html5 author: Kaleb Heitzman -- content h1. This is textigniter powered -- sidebar h3. This is some sidebar content

The following variables would be available in the template according to the code above: {{ title }}, {{ slug }}, {{ tags }}, {{ author }}, {{ content }}, {{ sidebar }}.

h2. Plugins

Textigniter supports meta section plugins. You can add custom plugin code to .textigniter/plugins. Plugins are named after their meta keys found in .textile files.

For example, if you had a meta key named twitter, you would create a twitter.rb file inside of the plugins directory with a class declaration of @class Textigniter::Plugins::Twitter@. The plugin must have a @parse(h)@ method and must return the parsed value, i.e @return value.@ h is the entire text hash with things like title, handle, slug and etc. This allows you combine other meta key:value combinations. We use this functionality for our breadcrumbs plugin. We take the slug and the Title to create an html string that we store in @h['breadcrumbs']@

Here is a sample template:

class Textigniter::Plugins::Twitter def parse(h) value = h['twitter'] return twitter end end

h2. Templates

Textigniter uses liquid templates. Anything that goes in liquid can go in textigniter. Checkout the "liquid documentation.":https://github.com/Shopify/liquid/wiki/Liquid-for-Designers

Anything in .textigniter/config.yml and the textile(markdown) file is available to the template. For example, site_name is declared in the config file and is available in the template file as {{ site_name }}

h2. Styles

Styles are parsed via less. You can create .less files under .textigniter/styles with a .less extension and they will automatically be parsed.

See the "LESS usage documentation":http://lesscss.org/#synopsis for more information.

h2. Scripts

Scripts are parsed via coffeescript. You can create .coffeescript files under .textigniter/scripts with a .coffeescript extension and they will automatically be parsed.

See the "CoffeeScript homepage":http://jashkenas.github.com/coffee-script/ for more information.

h2. Philosophy

HTML5 is the rising up-comer and with it come many advantages that in my opinion make databases overused for a majority of websites (Bloggers/Brochure Sites). Most dynamic content doesn't need pulled from a database anymore because it can processed with Javascript and XML, i.e Twitter feeds. Static Site Generators can really excel in this area. Static content mixed with the power of Javascript and HTML5 is more than enough for a majority of users who want easily maintainable websites.

FAQs

Package last updated on 25 Nov 2011

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc