Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,11 @@ specs as-is; the full Ginger language is at your disposal here.

#### Supported Backend Types

All backend specifications support at least the `type`, `fetch`, and `ordering`
All backend specifications support at least the `type`, `fetch`, and `order`
keys in long-hand mode. `type` determines the backend type, `fetch` is one of
`one`, `all`, or an integer for a fixed maximum number of items. `all` and
numbered return a list of records, `one` returns just one record. For
`ordering`, the following are allowed:
`order`, the following are allowed:

- "arbitrary": do not reorder, use whatever the backend produces
- "random": random-shuffle results
Expand Down
2 changes: 1 addition & 1 deletion doc/guide/010-routes.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ rules:

- # The "User Guide" section is also special, because it has a Table Of
# Contents on every page, and the pages themselves have numbers prefixed so
# that ordering them by filename gives us the right ordering for the TOC. We
# that ordering them by filename gives us the right order for the TOC. We
# don't want the numbering to appear in links / URLs though, so there's a bit
# of magic added to make that possible.
#
Expand Down
4 changes: 2 additions & 2 deletions doc/guide/020-data-backends.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ options.

# Supported Backend Types

All backend specifications support at least the `type`, `fetch`, and `ordering`
All backend specifications support at least the `type`, `fetch`, and `order`
keys in long-hand mode. `type` determines the backend type, `fetch` is one of
`one`, `all`, or an integer for a fixed maximum number of items. `all` and
numbered return a list of records, `one` returns just one record. For
`ordering`, the following are allowed:
`order`, the following are allowed:

- "arbitrary": do not reorder, use whatever the backend produces
- "random": random-shuffle results
Expand Down
12 changes: 6 additions & 6 deletions src/Web/Sprinkles/Backends/Spec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -183,15 +183,15 @@ instance ExpandableM Text BackendSpec where
-- - n (numeric value): Fetch up to n items, as a list
-- "fetch": fetchMode,
--
-- // ordering. One of:
-- // order. One of:
-- // - "arbitrary": do not reorder, use whatever the backend produces
-- // - "random": random-shuffle results
-- // - "shuffle": same as "random"
-- // - "name": order by name
-- // - "mtime": order by modification time
-- // The ordering can be preceded with a "+" or "-" sign to indicate
-- // ascending or descending ordering.
-- "order": ordering,
-- // The order can be preceded with a "+" or "-" sign to indicate
-- // ascending or descending order.
-- "order": order,
--
-- // The rest of the structure depends on the type.
--
Expand Down Expand Up @@ -350,7 +350,7 @@ instance FromJSON FetchMode where
parseJSON _ = fail "Invalid fetch mode (want 'one' or 'all')"

-- | By which field should we order results?
data FetchOrderField = ArbitraryOrder -- ^ Do not impose any ordering at all
data FetchOrderField = ArbitraryOrder -- ^ Do not impose any order at all
| RandomOrder -- ^ Shuffle randomly
| OrderByName -- ^ Order by reported name
| OrderByMTime -- ^ Order by modification time
Expand All @@ -373,7 +373,7 @@ instance Default AscDesc where
data FetchOrder =
FetchOrder
{ fetchField :: FetchOrderField -- ^ By which field?
, fetchAscDesc :: AscDesc -- ^ Reverse ordering?
, fetchAscDesc :: AscDesc -- ^ Reverse order?
}
deriving (Show, Read, Eq, Generic)

Expand Down