Skip to content
This repository has been archived by the owner on Oct 11, 2021. It is now read-only.

Commit

Permalink
Try to further improve github readme rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
markpasc committed May 27, 2010
1 parent fd0d4e0 commit 1ffd723
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
Collect sets of template output to order by a particular datum.


## Installation ##
# Installation #

Unarchive into your Movable Type directory.


## Usage ##
# Usage #

Use the provided template tags to collect and reorder template content. For
example:
Expand Down Expand Up @@ -44,38 +44,38 @@ example:
</mt:Order>


## Template tags ##
# Template tags #

The collection and reordering of content is governed through these provided
template tags:


### mt:Order ###
## mt:Order ##

Provides the context in which content items are reordered. All the
`mt:OrderItem` tags contained within an `mt:Order` tag are sorted as one set
of content based on the value of their `order_by` variables.

`mt:Order` takes the following optional attributes:

#### `sort_order` ####
### `sort_order` ###

If set to `ascend`, reorders the content from first to last (that is, 1 to 9
and A to Z). Otherwise, the items are sorted in descending order (Z to A and 9
to 1).

#### `offset` ####
### `offset` ###

Specifies a number of `mt:OrderItem`s to skip. That is, after reordering all
the `mt:OrderItem` tags, discard this many items from the front of the list.

#### `limit` ####
### `limit` ###

Specifies how many `mt:OrderItem`s to show. That is, after reordering all the
`mt:OrderItem` tags (and discarding items due to `offset`), keep only this
many items from the front of the list.

#### `natural` ####
### `natural` ###

If set to `1`, sorting values that look like numbers will be sorted
numerically. Otherwise, items are sorted "asciibetically."
Expand All @@ -85,15 +85,15 @@ compare strictly character by character, such as timestamps, omit this to save
some computational work. If your content's sorting values are user-provided or
if they're numbers, specify `natural="1"`.

#### `shuffle` ####
### `shuffle` ###

If set to `1`, reorder the items randomly instead of using the sorting values.

When using this attribute, you can safely omit the `natural`, `sort_order`,
and `by` attributes, and you need not set sorting values inside your
`mt:OrderItem` tags. `mt:OrderItem pin` attributes are still honored, however.

#### `by` ####
### `by` ###

Specifies the name of the variable by which to order items. If not given, the
items are sorted by the values of the default variable `order_by`.
Expand All @@ -103,7 +103,7 @@ values in a variable, you can put the name of that variable in the `mt:Order
by` attribute to avoid copying those values into the `order_by` variable.


### `mt:OrderItem` ###
## `mt:OrderItem` ##

Packages a content fragment for reordering against the sibling `mt:OrderItem`
tags in an `mt:Order`.
Expand All @@ -115,7 +115,7 @@ inside the `mt:OrderItem`.

`mt:OrderItem` has one optional attribute:

#### `pin` ####
### `pin` ###

When specified, instead of being sorted against the other items, the content
of the `mt:OrderItem` will be inserted into the ordered set at the point you
Expand All @@ -134,16 +134,16 @@ inserted from left to right (`0` to `-1`), so groups with multiple items may
overlap with groups pinned nearby. For example, if there are four items pinned
at `0` and one item pinned at `1`, in the final reckoning three of the items
pinned at `0` will appear *after* the item at `1`: by the time the item at `1`
is finally pinned, the other items pinned at `0` have already become items #1,
#2, and #3.
is finally pinned, the other items pinned at `0` have already become items 1,
2, and 3.

Pinned items are put in position *before* the `mt:Order` tag's `limit`
attribute is considered. That is, if you order 11 items, pin one to `-1`
(last), and use `limit="10"` on the `mt:Order` tag, the pinned item will *not*
be shown (it was the eleventh of ten items).


### `mt:OrderHeader` ###
## `mt:OrderHeader` ##

Contains template content that is displayed at the front of the `mt:Order`
loop, as long as there are `mt:OrderItem`s to display.
Expand All @@ -152,7 +152,7 @@ Content from an `mt:OrderHeader` is shown before the first `mt:OrderItem`, or
even an `mt:OrderItem` pinned to the front with the `pin="0"` attribute.


### `mt:OrderFooter` ###
## `mt:OrderFooter` ##

Contains template content that is displayed at the end of the `mt:Order` loop,
as long as there are `mt:OrderItem`s to display.
Expand All @@ -161,20 +161,20 @@ Content from an `mt:OrderFooter` is shown after the last `mt:OrderItem`, or
even an `mt:OrderItem` pinned to the end with the `pin="-1"` attribute.


## Changes ##
# Changes #

### 1.1 in development ###
## 1.1 in development ##

* Added `mt:OrderHeader` and `mt:OrderFooter` tags.
* Added `shuffle` ordering option.
* Added `pin` feature.

### 1.0 30 July 2008 ###
## 1.0 30 July 2008 ##

* First release


## License ##
# License #

Copyright 2008-2009 Six Apart, Ltd.
All rights reserved.
Expand Down

0 comments on commit 1ffd723

Please sign in to comment.