Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
91 additions
and
74 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
%ol | ||
- all_sections do |s| | ||
%li{:id => s} | ||
:markdown | ||
#{yield} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
inherits 'treate/markdown' | ||
|
||
def init | ||
sections 'main', ['title', 'content', ['what_is', 'but_i_have'], 'copyright'] | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
## But I Already Use Haml / Erubis / Builder and They're Great. | ||
|
||
Repeat after me: Tater is _not_ Haml. | ||
|
||
### Tater is _not_ Haml. | ||
#### Tater is _not_ Haml. | ||
##### Tater is _not_ Haml. | ||
|
||
**Tater** is not a templating engine. It's completely engine-agnostic. In fact, you can use Haml, | ||
Erubis, Builder, Textile, and any other engine you want and still get the benefit of Tater's | ||
_actual_ features. Again, Tater doesn't care about what you're actually displaying in your templates, | ||
just how they're ordered. You can sit a Haml file right next to an ERB file and a Builder file. Tater | ||
doesn't know, or care, that you've done this. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
_Copyright 2008 Loren Segal._ | ||
_All code licensed under the MIT License._ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
def init | ||
sections 'title', 'what_is', 'but_i_have', 'copyright' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Welcome to Tater Tots | ||
## Templates for Ruby: The Object-Oriented Templating System |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
## What is This? | ||
|
||
**Tater Tots** (or _Tater_ for short) is an _object-oriented_ templating system that doesn't care about | ||
what templating engines you like to use. It's kind of like a meta-templating engine, because it really | ||
only cares about where your templates come from-- not what's in them. All you have to give Tater is | ||
a list of "sections" that make up your template. | ||
|
||
#### Wait, Did you say object oriented? _For files?_ | ||
|
||
Yes. I did. **Tater**'s goal is to bring modularity to your templates by introducing this nifty new concept | ||
called _"Object-Oriented Programming"_. It allows you to essentially "subclass" a template from another one, | ||
inheriting all of the parent template's behaviour. It also allows you to solve another problem common to | ||
complex templates: _coupling_. | ||
|
||
Now bear with me here, coupling is considered a common problem in software, but you've probably never heard | ||
someone tell you that your templates files suffer from that problem. Coupling is a necessary dependency from | ||
one module to another, making it impossible to break the two modules apart. So when you directly call a template | ||
from one of your other template files, you are creating exactly that kind of coupling. | ||
|
||
How do we solve template coupling? **Sections**. | ||
|
||
#### Sections? | ||
|
||
You might know these as _partials_. But partials are **ugly**. Partials get lost deep inside your templates | ||
and never get out. Then, when you need to create a derivative template using everything but that one partial, | ||
you have to make yet another partial which includes the first one, or use some fancy if/then/else logic with | ||
crazy local variables to hide it from the original template. This gets messy fast, because it's all done | ||
from _inside_ the template. | ||
|
||
Sections are as simple as a list. In fact, the sections of a template are exactly that-- a list of sub-templates | ||
that make up the whole. You can compound as many of these lists as you want to create your abstracted template | ||
from nothing but a list of filenames-- then let **Tater** sort it out! | ||
|
||
If you need to visualize this concept, just think about all the templates and partials you used to create any | ||
page in your last website. List them in order from top to bottom, add in some heirarchy rules, and there you go, | ||
you've just made a list of all of your template's sections. It's as simple as that. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
## You Should Also Know | ||
|
||
That this `README` was generated by **Treate**. Try it: | ||
|
||
`ruby examples/example2/run.rb readme` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
inherits 'treate/markdown' | ||
|
||
def init | ||
super | ||
sections.insert_before('copyright', 'readme_notice') | ||
end |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.