@@ -1,3 +1,14 @@ | |||
target | |||
.idea/ | |||
test_site/public | |||
components/site/test_site/public | |||
small-blog | |||
medium-blog | |||
big-blog | |||
huge-blog | |||
small-kb | |||
medium-kb | |||
huge-kb | |||
current.bench | |||
now.bench |
@@ -1,5 +1,18 @@ | |||
# Changelog | |||
## 0.1.0 (unreleased) | |||
- Parallelize all the things | |||
- Add weight sorting | |||
- Remove `section` from the `page` rendering context: this is too expensive. Use | |||
the global function `get_section` if you need to get it | |||
- Put back a 20 page limit on rss feed by default (configurable) | |||
- Remove index page getting all sections: use the `get_section` global fn instead to | |||
only get the ones you need | |||
- Remove pages from pagers in pagination: they were not supposed to be there | |||
- Add built-in Sass compilation support (*nix only for now) | |||
## 0.0.7 (2017-06-19) | |||
- Sort individual tag/category pages by date | |||
@@ -13,24 +13,10 @@ keywords = ["static", "site", "generator", "blog"] | |||
name = "gutenberg" | |||
[dependencies] | |||
error-chain = "0.10" | |||
clap = "2" | |||
walkdir = "1" | |||
pulldown-cmark = "0" | |||
regex = "0.2" | |||
lazy_static = "0.2" | |||
glob = "0.2" | |||
serde = "1.0" | |||
serde_derive = "1.0" | |||
# tera = { path = "../tera" } | |||
# tera = { git = "https://github.com/Keats/tera" } | |||
tera = "0.10" | |||
slug = "0.1" | |||
syntect = { version = "1", features = ["static-onig"] } | |||
chrono = "0.3" | |||
chrono = "0.4" | |||
toml = "0.4" | |||
term-painter = "0.2" | |||
base64 = "0.6" | |||
# Below is for the serve cmd | |||
staticfile = "0.4" | |||
@@ -39,5 +25,22 @@ mount = "0.3" | |||
notify = "4" | |||
ws = "0.7" | |||
[dev-dependencies] | |||
tempdir = "0.3" | |||
site = { path = "components/site" } | |||
errors = { path = "components/errors" } | |||
content = { path = "components/content" } | |||
front_matter = { path = "components/front_matter" } | |||
utils = { path = "components/utils" } | |||
[workspace] | |||
members = [ | |||
"components/config", | |||
"components/content", | |||
"components/errors", | |||
"components/front_matter", | |||
"components/pagination", | |||
"components/rendering", | |||
"components/site", | |||
"components/taxonomies", | |||
"components/templates", | |||
"components/utils", | |||
] |
@@ -52,7 +52,7 @@ Each kind of page get their own variables: | |||
// TODO: detail the schema of the variables | |||
- index.html: gets `section` representing the index section and all `sections` | |||
- index.html: gets `section` representing the index section | |||
- page.html: gets `page` that contains the data for that page | |||
- section.html: gets `section` that contains the data for pages in it and its subsections | |||
- tags.html: gets `tags` | |||
@@ -65,6 +65,30 @@ the absolute URL of the current page and `current_path` that represents the path | |||
If you want to know all the data present in a template content, simply put `{{ __tera_context }}` | |||
in the templates and it will print it. | |||
Gutenberg also ships with 3 Tera global functions: | |||
#### `get_page` | |||
Takes a path to a `.md` file and returns the associated page | |||
```jinja2 | |||
{% set page = get_page(path="blog/page2.md") %} | |||
``` | |||
#### `get_section` | |||
Takes a path to a `_index.md` file and returns the associated section | |||
```jinja2 | |||
{% set section = get_page(path="blog/_index.md") %} | |||
``` | |||
####` get_url` | |||
Gets the permalink for a local file following the same convention as internal | |||
link in markdown. | |||
```jinja2 | |||
{% set url = get_url(link="./blog/_index.md") %} | |||
``` | |||
### Static files | |||
Everything in the `static` folder will be copied into the output directory as-is. | |||
@@ -125,7 +149,7 @@ You can also set the `template` variable to change which template will be used t | |||
Sections will also automatically pick up their subsections, allowing you to make some complex pages layout and | |||
table of contents. | |||
You can define how a section pages are sorted using the `sort_by` key in the front-matter. The choices are `date`, `order` | |||
You can define how a section pages are sorted using the `sort_by` key in the front-matter. The choices are `date`, `order`, `weight` (opposite of order) | |||
and `none` (default). Pages that can't be sorted will currently be silently dropped: the final page will be rendered but it will not appear in | |||
the `pages` variable in the section template. | |||
@@ -1,6 +1,8 @@ | |||
# Based on the "trust" template v0.1.1 | |||
# https://github.com/japaric/trust/tree/v0.1.1 | |||
os: Visual Studio 2015 | |||
environment: | |||
global: | |||
# TODO This is the Rust channel that build jobs will use by default but can be | |||
@@ -13,15 +15,12 @@ environment: | |||
matrix: | |||
# GNU | |||
- channel: stable | |||
target: x86_64-pc-windows-gnu | |||
TOOLCHAIN: msys | |||
MSYS_BITS: 64 | |||
target: x86_64-pc-windows-msvc | |||
TOOLCHAIN: msvc | |||
PLATFORM: x86_64 | |||
install: | |||
- ps: >- | |||
If ($Env:TARGET -eq 'x86_64-pc-windows-gnu') { | |||
$Env:PATH += ';C:\msys64\mingw64\bin;C:\Program Files\Git\mingw64\bin' | |||
} | |||
- if "%TOOLCHAIN%" == "msvc" if "%PLATFORM%" == "i686" call "%VS140COMNTOOLS%\..\..\VC\vcvarsall.bat" | |||
- if "%TOOLCHAIN%" == "msvc" if "%PLATFORM%" == "x86_64" "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64 | |||
- if "%TOOLCHAIN%" == "msvc" if "%PLATFORM%" == "x86_64" call "%VS140COMNTOOLS%\..\..\VC\vcvarsall.bat" x86_amd64 | |||
- if "%TOOLCHAIN%" == "msys" set PATH=C:\msys64\mingw%MSYS_BITS%\bin;C:\msys64\usr\bin;%PATH% | |||
@@ -35,7 +34,7 @@ install: | |||
test_script: | |||
# we don't run the "test phase" when doing deploys | |||
- if [%APPVEYOR_REPO_TAG%]==[false] ( | |||
cargo test --target %TARGET% | |||
cargo test --all --target %TARGET% | |||
) | |||
before_deploy: | |||
@@ -1,47 +0,0 @@ | |||
#![feature(test)] | |||
extern crate test; | |||
extern crate gutenberg; | |||
extern crate tempdir; | |||
use std::env; | |||
use tempdir::TempDir; | |||
use gutenberg::{Site, populate_previous_and_next_pages}; | |||
// TODO: add bench with ~1000 pages for all cases | |||
#[bench] | |||
fn bench_loading_test_site(b: &mut test::Bencher) { | |||
let mut path = env::current_dir().unwrap().to_path_buf(); | |||
path.push("test_site"); | |||
let mut site = Site::new(&path, "config.toml").unwrap(); | |||
b.iter(|| site.load().unwrap()); | |||
} | |||
#[bench] | |||
fn bench_building_test_site(b: &mut test::Bencher) { | |||
let mut path = env::current_dir().unwrap().to_path_buf(); | |||
path.push("test_site"); | |||
let mut site = Site::new(&path, "config.toml").unwrap(); | |||
site.load().unwrap(); | |||
let tmp_dir = TempDir::new("example").expect("create temp dir"); | |||
let public = &tmp_dir.path().join("public"); | |||
site.set_output_path(&public); | |||
b.iter(|| site.build().unwrap()); | |||
} | |||
#[bench] | |||
fn bench_populate_previous_and_next_pages(b: &mut test::Bencher) { | |||
let mut path = env::current_dir().unwrap().to_path_buf(); | |||
path.push("test_site"); | |||
let mut site = Site::new(&path, "config.toml").unwrap(); | |||
site.load().unwrap(); | |||
let pages = site.pages.values().cloned().collect::<Vec<_>>(); | |||
b.iter(|| populate_previous_and_next_pages(pages.as_slice())); | |||
} |
@@ -11,8 +11,8 @@ main() { | |||
return | |||
fi | |||
cross test --target $TARGET | |||
cross test --target $TARGET --release | |||
cross test --all --target $TARGET | |||
cross test --all --target $TARGET --release | |||
} | |||
# we don't run the "test phase" when doing deploys | |||
@@ -0,0 +1,674 @@ | |||
[root] | |||
name = "config" | |||
version = "0.1.0" | |||
dependencies = [ | |||
"errors 0.1.0", | |||
"rendering 0.1.0", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"toml 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "aho-corasick" | |||
version = "0.6.3" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "backtrace" | |||
version = "0.3.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"backtrace-sys 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"cfg-if 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"dbghelp-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"rustc-demangle 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "backtrace-sys" | |||
version = "0.1.11" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "base64" | |||
version = "0.5.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "bincode" | |||
version = "0.8.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "bitflags" | |||
version = "0.7.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "bitflags" | |||
version = "0.8.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "bitflags" | |||
version = "0.9.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "byteorder" | |||
version = "1.0.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "cfg-if" | |||
version = "0.1.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "chrono" | |||
version = "0.3.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"num 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "chrono" | |||
version = "0.4.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"num 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "cmake" | |||
version = "0.1.24" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "dbghelp-sys" | |||
version = "0.2.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "dtoa" | |||
version = "0.4.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "error-chain" | |||
version = "0.10.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"backtrace 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "errors" | |||
version = "0.1.0" | |||
dependencies = [ | |||
"error-chain 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"tera 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"toml 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "flate2" | |||
version = "0.2.19" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"miniz-sys 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "fnv" | |||
version = "1.0.5" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "front_matter" | |||
version = "0.1.0" | |||
dependencies = [ | |||
"chrono 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"errors 0.1.0", | |||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"tera 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"toml 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "gcc" | |||
version = "0.3.51" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "getopts" | |||
version = "0.2.14" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "glob" | |||
version = "0.2.11" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "humansize" | |||
version = "1.0.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "idna" | |||
version = "0.1.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"unicode-bidi 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"unicode-normalization 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "itoa" | |||
version = "0.3.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "kernel32-sys" | |||
version = "0.2.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "lazy_static" | |||
version = "0.2.8" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "libc" | |||
version = "0.2.24" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "matches" | |||
version = "0.1.6" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "memchr" | |||
version = "1.0.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "miniz-sys" | |||
version = "0.1.9" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "num" | |||
version = "0.1.39" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"num-integer 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"num-iter 0.1.33 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "num-integer" | |||
version = "0.1.34" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "num-iter" | |||
version = "0.1.33" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"num-integer 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "num-traits" | |||
version = "0.1.39" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "onig" | |||
version = "1.3.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"onig_sys 63.0.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "onig_sys" | |||
version = "63.0.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"cmake 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "percent-encoding" | |||
version = "1.0.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "pest" | |||
version = "0.4.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "pkg-config" | |||
version = "0.3.9" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "plist" | |||
version = "0.2.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"base64 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"chrono 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"xml-rs 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "pulldown-cmark" | |||
version = "0.0.15" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "quote" | |||
version = "0.3.15" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "redox_syscall" | |||
version = "0.1.19" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "regex" | |||
version = "0.2.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"aho-corasick 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"regex-syntax 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"thread_local 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "regex-syntax" | |||
version = "0.4.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "rendering" | |||
version = "0.1.0" | |||
dependencies = [ | |||
"errors 0.1.0", | |||
"front_matter 0.1.0", | |||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"pulldown-cmark 0.0.15 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"slug 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"syntect 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"tera 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "rustc-demangle" | |||
version = "0.1.4" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "same-file" | |||
version = "0.1.3" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "serde" | |||
version = "1.0.9" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "serde_derive" | |||
version = "1.0.9" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_derive_internals 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "serde_derive_internals" | |||
version = "0.15.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "serde_json" | |||
version = "1.0.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"dtoa 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"itoa 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "slug" | |||
version = "0.1.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"unidecode 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "syn" | |||
version = "0.11.11" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "synom" | |||
version = "0.11.3" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "syntect" | |||
version = "1.7.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"bincode 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"bitflags 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"flate2 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"onig 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"plist 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"regex-syntax 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"walkdir 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"yaml-rust 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "tera" | |||
version = "0.10.8" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"chrono 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"error-chain 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"humansize 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"pest 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"slug 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"url 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "thread_local" | |||
version = "0.3.4" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "time" | |||
version = "0.1.37" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"redox_syscall 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "toml" | |||
version = "0.4.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "unicode-bidi" | |||
version = "0.3.3" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "unicode-normalization" | |||
version = "0.1.5" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "unicode-xid" | |||
version = "0.0.4" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "unidecode" | |||
version = "0.2.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "unreachable" | |||
version = "1.0.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "url" | |||
version = "1.5.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"idna 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"percent-encoding 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "utf8-ranges" | |||
version = "1.0.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "void" | |||
version = "1.0.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "walkdir" | |||
version = "1.0.7" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"same-file 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "winapi" | |||
version = "0.2.8" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "winapi-build" | |||
version = "0.1.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "xml-rs" | |||
version = "0.4.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "yaml-rust" | |||
version = "0.3.5" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[metadata] | |||
"checksum aho-corasick 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "500909c4f87a9e52355b26626d890833e9e1d53ac566db76c36faa984b889699" | |||
"checksum backtrace 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "72f9b4182546f4b04ebc4ab7f84948953a118bd6021a1b6a6c909e3e94f6be76" | |||
"checksum backtrace-sys 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "3a0d842ea781ce92be2bf78a9b38883948542749640b8378b3b2f03d1fd9f1ff" | |||
"checksum base64 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "30e93c03064e7590d0466209155251b90c22e37fab1daf2771582598b5827557" | |||
"checksum bincode 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e103c8b299b28a9c6990458b7013dc4a8356a9b854c51b9883241f5866fac36e" | |||
"checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d" | |||
"checksum bitflags 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1370e9fc2a6ae53aea8b7a5110edbd08836ed87c88736dfabccade1c2b44bff4" | |||
"checksum bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5" | |||
"checksum byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c40977b0ee6b9885c9013cd41d9feffdd22deb3bb4dc3a71d901cc7a77de18c8" | |||
"checksum cfg-if 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d0c47d456a36ebf0536a6705c83c1cbbcb9255fbc1d905a6ded104f479268a29" | |||
"checksum chrono 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "158b0bd7d75cbb6bf9c25967a48a2e9f77da95876b858eadfabaa99cd069de6e" | |||
"checksum chrono 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7c20ebe0b2b08b0aeddba49c609fe7957ba2e33449882cb186a180bc60682fa9" | |||
"checksum cmake 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)" = "b8ebbb35d3dc9cd09497168f33de1acb79b265d350ab0ac34133b98f8509af1f" | |||
"checksum dbghelp-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "97590ba53bcb8ac28279161ca943a924d1fd4a8fb3fa63302591647c4fc5b850" | |||
"checksum dtoa 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "80c8b71fd71146990a9742fc06dcbbde19161a267e0ad4e572c35162f4578c90" | |||
"checksum error-chain 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d9435d864e017c3c6afeac1654189b06cdb491cf2ff73dbf0d73b0f292f42ff8" | |||
"checksum flate2 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)" = "36df0166e856739905cd3d7e0b210fe818592211a008862599845e012d8d304c" | |||
"checksum fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6cc484842f1e2884faf56f529f960cc12ad8c71ce96cc7abba0a067c98fee344" | |||
"checksum gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)" = "120d07f202dcc3f72859422563522b66fe6463a4c513df062874daad05f85f0a" | |||
"checksum getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9047cfbd08a437050b363d35ef160452c5fe8ea5187ae0a624708c91581d685" | |||
"checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb" | |||
"checksum humansize 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "92d211e6e70b05749dce515b47684f29a3c8c38bbbb21c50b30aff9eca1b0bd3" | |||
"checksum idna 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2233d4940b1f19f0418c158509cd7396b8d70a5db5705ce410914dc8fa603b37" | |||
"checksum itoa 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "eb2f404fbc66fd9aac13e998248505e7ecb2ad8e44ab6388684c5fb11c6c251c" | |||
"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" | |||
"checksum lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3b37545ab726dd833ec6420aaba8231c5b320814b9029ad585555d2a03e94fbf" | |||
"checksum libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)" = "38f5c2b18a287cf78b4097db62e20f43cace381dc76ae5c0a3073067f78b7ddc" | |||
"checksum matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "100aabe6b8ff4e4a7e32c1c13523379802df0772b82466207ac25b013f193376" | |||
"checksum memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1dbccc0e46f1ea47b9f17e6d67c5a96bd27030519c519c9c91327e31275a47b4" | |||
"checksum miniz-sys 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "28eaee17666671fa872e567547e8428e83308ebe5808cdf6a0e28397dbe2c726" | |||
"checksum num 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "2c3a3dc9f30bf824141521b30c908a859ab190b76e20435fcd89f35eb6583887" | |||
"checksum num-integer 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)" = "ef1a4bf6f9174aa5783a9b4cc892cacd11aebad6c69ad027a0b65c6ca5f8aa37" | |||
"checksum num-iter 0.1.33 (registry+https://github.com/rust-lang/crates.io-index)" = "f7d1891bd7b936f12349b7d1403761c8a0b85a18b148e9da4429d5d102c1a41e" | |||
"checksum num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "1708c0628602a98b52fad936cf3edb9a107af06e52e49fdf0707e884456a6af6" | |||
"checksum onig 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee619da9cf707b167098e84fb00f10db61d5a662d1d29b59822bcac3a81553dd" | |||
"checksum onig_sys 63.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "531682ab45a2cd40eff91f29340dae975f25336d2b61e624adabed39e61d7fb3" | |||
"checksum percent-encoding 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "de154f638187706bde41d9b4738748933d64e6b37bdbffc0b47a97d16a6ae356" | |||
"checksum pest 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3e2e823a5967bb4cdc6d3e46f47baaf4ecfeae44413a642b74ad44e59e49c7f6" | |||
"checksum pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "3a8b4c6b8165cd1a1cd4b9b120978131389f64bdaf456435caa41e630edba903" | |||
"checksum plist 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1e2f7e9574aabcf57bc5e9f602caabdffffa8179b0c130a039f7895fea3dbdb5" | |||
"checksum pulldown-cmark 0.0.15 (registry+https://github.com/rust-lang/crates.io-index)" = "378e941dbd392c101f2cb88097fa4d7167bc421d4b88de3ff7dbee503bc3233b" | |||
"checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a" | |||
"checksum redox_syscall 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)" = "e4a357d14a12e90a37d658725df0e6468504750b5948b9710f83f94a0c5818e8" | |||
"checksum regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1731164734096285ec2a5ec7fea5248ae2f5485b3feeb0115af4fda2183b2d1b" | |||
"checksum regex-syntax 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ad890a5eef7953f55427c50575c680c42841653abd2b028b68cd223d157f62db" | |||
"checksum rustc-demangle 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3058a43ada2c2d0b92b3ae38007a2d0fa5e9db971be260e0171408a4ff471c95" | |||
"checksum same-file 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d931a44fdaa43b8637009e7632a02adc4f2b2e0733c08caa4cf00e8da4a117a7" | |||
"checksum serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)" = "6a7c6b751a2e8d5df57a5ff71b5b4fc8aaee9ee28ff1341d640dd130bb5f4f7a" | |||
"checksum serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)" = "2f6ca58905ebd3c3b285a8a6d4f3ac92b92c0d7951d5649b1bdd212549c06639" | |||
"checksum serde_derive_internals 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)" = "37aee4e0da52d801acfbc0cc219eb1eda7142112339726e427926a6f6ee65d3a" | |||
"checksum serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "48b04779552e92037212c3615370f6bd57a40ebba7f20e554ff9f55e41a69a7b" | |||
"checksum slug 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f6f5ff4b43cb07b86c5f9236c92714a22cdf9e5a27a7d85e398e2c9403328cb8" | |||
"checksum syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad" | |||
"checksum synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a393066ed9010ebaed60b9eafa373d4b1baac186dd7e008555b0f702b51945b6" | |||
"checksum syntect 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2f436345e5b6ebbfdf51b20b95cd9bcb82576262c340bad9cf815078d76b082a" | |||
"checksum tera 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)" = "62736a6d748fd2c5a8b4be21010e37d79f78aea3c2e07a9e13ff5c70864a3129" | |||
"checksum thread_local 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "1697c4b57aeeb7a536b647165a2825faddffb1d3bad386d507709bd51a90bb14" | |||
"checksum time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)" = "ffd7ccbf969a892bf83f1e441126968a07a3941c24ff522a26af9f9f4585d1a3" | |||
"checksum toml 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b0601da6c97135c8d330c7a13a013ca6cd4143221b01de2f8d4edc50a9e551c7" | |||
"checksum unicode-bidi 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a6a2c4e3710edd365cd7e78383153ed739fa31af19f9172f72d3575060f5a43a" | |||
"checksum unicode-normalization 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "51ccda9ef9efa3f7ef5d91e8f9b83bbe6955f9bf86aec89d5cce2c874625920f" | |||
"checksum unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc" | |||
"checksum unidecode 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d2adb95ee07cd579ed18131f2d9e7a17c25a4b76022935c7f2460d2bfae89fd2" | |||
"checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" | |||
"checksum url 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "eeb819346883532a271eb626deb43c4a1bb4c4dd47c519bd78137c3e72a4fe27" | |||
"checksum utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "662fab6525a98beff2921d7f61a39e7d59e0b425ebc7d0d9e66d316e55124122" | |||
"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" | |||
"checksum walkdir 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "bb08f9e670fab86099470b97cd2b252d6527f0b3cc1401acdb595ffc9dd288ff" | |||
"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" | |||
"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" | |||
"checksum xml-rs 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b46ee689ba7a669c08a1170c2348d2516c62dc461135c9e86b2f1f476e07be4a" | |||
"checksum yaml-rust 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e66366e18dc58b46801afbf2ca7661a9f59cc8c5962c29892b6039b4f86fa992" |
@@ -0,0 +1,12 @@ | |||
[package] | |||
name = "config" | |||
version = "0.1.0" | |||
authors = ["Vincent Prouillet <vincent@wearewizards.io>"] | |||
[dependencies] | |||
toml = "0.4" | |||
serde = "1.0" | |||
serde_derive = "1.0" | |||
errors = { path = "../errors" } | |||
rendering = { path = "../rendering" } |
@@ -1,9 +1,16 @@ | |||
#[macro_use] | |||
extern crate serde_derive; | |||
extern crate toml; | |||
#[macro_use] | |||
extern crate errors; | |||
extern crate rendering; | |||
use std::collections::HashMap; | |||
use std::fs::File; | |||
use std::io::prelude::*; | |||
use std::path::Path; | |||
use std::collections::HashMap; | |||
use toml::{Value as Toml, self}; | |||
use toml::{Value as Toml}; | |||
use errors::{Result, ResultExt}; | |||
use rendering::highlighting::THEME_SET; | |||
@@ -36,6 +43,8 @@ pub struct Config { | |||
/// The default template can be overridden by creating a `anchor-link.html` template and CSS will need to be | |||
/// written if you turn that on. | |||
pub insert_anchor_links: Option<bool>, | |||
/// Whether to compile the `sass` directory and output the css files into the static folder | |||
pub compile_sass: Option<bool>, | |||
/// All user params set in [extra] in the config | |||
pub extra: Option<HashMap<String, Toml>>, | |||
@@ -61,17 +70,18 @@ impl Config { | |||
set_default!(config.language_code, "en".to_string()); | |||
set_default!(config.highlight_code, false); | |||
set_default!(config.generate_rss, false); | |||
set_default!(config.rss_limit, <usize>::max_value()); | |||
set_default!(config.rss_limit, 20); | |||
set_default!(config.generate_tags_pages, false); | |||
set_default!(config.generate_categories_pages, false); | |||
set_default!(config.insert_anchor_links, false); | |||
set_default!(config.compile_sass, false); | |||
match config.highlight_theme { | |||
Some(ref t) => { | |||
if !THEME_SET.themes.contains_key(t) { | |||
bail!("Theme {} not available", t) | |||
} | |||
}, | |||
} | |||
None => config.highlight_theme = Some("base16-ocean-dark".to_string()) | |||
}; | |||
@@ -124,6 +134,7 @@ impl Default for Config { | |||
generate_tags_pages: Some(true), | |||
generate_categories_pages: Some(true), | |||
insert_anchor_links: Some(false), | |||
compile_sass: Some(false), | |||
extra: None, | |||
} | |||
} |
@@ -0,0 +1,779 @@ | |||
[root] | |||
name = "content" | |||
version = "0.1.0" | |||
dependencies = [ | |||
"config 0.1.0", | |||
"errors 0.1.0", | |||
"front_matter 0.1.0", | |||
"rayon 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"rendering 0.1.0", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"slug 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"tera 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"utils 0.1.0", | |||
] | |||
[[package]] | |||
name = "aho-corasick" | |||
version = "0.6.3" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "backtrace" | |||
version = "0.3.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"backtrace-sys 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"cfg-if 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"dbghelp-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"rustc-demangle 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "backtrace-sys" | |||
version = "0.1.11" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "base64" | |||
version = "0.5.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "bincode" | |||
version = "0.8.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "bitflags" | |||
version = "0.7.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "bitflags" | |||
version = "0.8.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "bitflags" | |||
version = "0.9.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "byteorder" | |||
version = "1.0.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "cfg-if" | |||
version = "0.1.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "chrono" | |||
version = "0.3.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"num 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "chrono" | |||
version = "0.4.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"num 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "cmake" | |||
version = "0.1.24" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "coco" | |||
version = "0.1.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"either 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"scopeguard 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "config" | |||
version = "0.1.0" | |||
dependencies = [ | |||
"errors 0.1.0", | |||
"rendering 0.1.0", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"toml 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "dbghelp-sys" | |||
version = "0.2.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "dtoa" | |||
version = "0.4.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "either" | |||
version = "1.1.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "error-chain" | |||
version = "0.10.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"backtrace 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "errors" | |||
version = "0.1.0" | |||
dependencies = [ | |||
"error-chain 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"tera 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"toml 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "flate2" | |||
version = "0.2.19" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"miniz-sys 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "fnv" | |||
version = "1.0.5" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "front_matter" | |||
version = "0.1.0" | |||
dependencies = [ | |||
"chrono 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"errors 0.1.0", | |||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"tera 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"toml 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "futures" | |||
version = "0.1.14" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "gcc" | |||
version = "0.3.51" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "getopts" | |||
version = "0.2.14" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "glob" | |||
version = "0.2.11" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "humansize" | |||
version = "1.0.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "idna" | |||
version = "0.1.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"unicode-bidi 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"unicode-normalization 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "itoa" | |||
version = "0.3.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "kernel32-sys" | |||
version = "0.2.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "lazy_static" | |||
version = "0.2.8" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "libc" | |||
version = "0.2.24" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "matches" | |||
version = "0.1.6" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "memchr" | |||
version = "1.0.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "miniz-sys" | |||
version = "0.1.9" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "num" | |||
version = "0.1.39" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"num-integer 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"num-iter 0.1.33 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "num-integer" | |||
version = "0.1.34" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "num-iter" | |||
version = "0.1.33" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"num-integer 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "num-traits" | |||
version = "0.1.39" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "num_cpus" | |||
version = "1.6.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "onig" | |||
version = "1.3.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"onig_sys 63.0.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "onig_sys" | |||
version = "63.0.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"cmake 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "percent-encoding" | |||
version = "1.0.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "pest" | |||
version = "0.4.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "pkg-config" | |||
version = "0.3.9" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "plist" | |||
version = "0.2.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"base64 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"chrono 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"xml-rs 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "pulldown-cmark" | |||
version = "0.0.15" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "quote" | |||
version = "0.3.15" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "rand" | |||
version = "0.3.15" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "rayon" | |||
version = "0.8.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"rayon-core 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "rayon-core" | |||
version = "1.2.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"coco 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"num_cpus 1.6.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "redox_syscall" | |||
version = "0.1.19" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "regex" | |||
version = "0.2.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"aho-corasick 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"regex-syntax 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"thread_local 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "regex-syntax" | |||
version = "0.4.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "rendering" | |||
version = "0.1.0" | |||
dependencies = [ | |||
"errors 0.1.0", | |||
"front_matter 0.1.0", | |||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"pulldown-cmark 0.0.15 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"slug 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"syntect 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"tera 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"utils 0.1.0", | |||
] | |||
[[package]] | |||
name = "rustc-demangle" | |||
version = "0.1.4" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "same-file" | |||
version = "0.1.3" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "scopeguard" | |||
version = "0.3.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "serde" | |||
version = "1.0.9" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "serde_derive" | |||
version = "1.0.9" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_derive_internals 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "serde_derive_internals" | |||
version = "0.15.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "serde_json" | |||
version = "1.0.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"dtoa 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"itoa 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "slug" | |||
version = "0.1.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"unidecode 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "syn" | |||
version = "0.11.11" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "synom" | |||
version = "0.11.3" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "syntect" | |||
version = "1.7.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"bincode 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"bitflags 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"flate2 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"onig 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"plist 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"regex-syntax 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"walkdir 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"yaml-rust 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "tempdir" | |||
version = "0.3.5" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "tera" | |||
version = "0.10.8" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"chrono 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"error-chain 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"humansize 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"pest 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"slug 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"url 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "thread_local" | |||
version = "0.3.4" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "time" | |||
version = "0.1.37" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"redox_syscall 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "toml" | |||
version = "0.4.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "unicode-bidi" | |||
version = "0.3.3" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "unicode-normalization" | |||
version = "0.1.5" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "unicode-xid" | |||
version = "0.0.4" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "unidecode" | |||
version = "0.2.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "unreachable" | |||
version = "1.0.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "url" | |||
version = "1.5.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"idna 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"percent-encoding 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "utf8-ranges" | |||
version = "1.0.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "utils" | |||
version = "0.1.0" | |||
dependencies = [ | |||
"errors 0.1.0", | |||
] | |||
[[package]] | |||
name = "void" | |||
version = "1.0.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "walkdir" | |||
version = "1.0.7" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"same-file 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "winapi" | |||
version = "0.2.8" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "winapi-build" | |||
version = "0.1.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "xml-rs" | |||
version = "0.4.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "yaml-rust" | |||
version = "0.3.5" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[metadata] | |||
"checksum aho-corasick 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "500909c4f87a9e52355b26626d890833e9e1d53ac566db76c36faa984b889699" | |||
"checksum backtrace 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "72f9b4182546f4b04ebc4ab7f84948953a118bd6021a1b6a6c909e3e94f6be76" | |||
"checksum backtrace-sys 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "3a0d842ea781ce92be2bf78a9b38883948542749640b8378b3b2f03d1fd9f1ff" | |||
"checksum base64 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "30e93c03064e7590d0466209155251b90c22e37fab1daf2771582598b5827557" | |||
"checksum bincode 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e103c8b299b28a9c6990458b7013dc4a8356a9b854c51b9883241f5866fac36e" | |||
"checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d" | |||
"checksum bitflags 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1370e9fc2a6ae53aea8b7a5110edbd08836ed87c88736dfabccade1c2b44bff4" | |||
"checksum bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5" | |||
"checksum byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c40977b0ee6b9885c9013cd41d9feffdd22deb3bb4dc3a71d901cc7a77de18c8" | |||
"checksum cfg-if 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d0c47d456a36ebf0536a6705c83c1cbbcb9255fbc1d905a6ded104f479268a29" | |||
"checksum chrono 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "158b0bd7d75cbb6bf9c25967a48a2e9f77da95876b858eadfabaa99cd069de6e" | |||
"checksum chrono 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7c20ebe0b2b08b0aeddba49c609fe7957ba2e33449882cb186a180bc60682fa9" | |||
"checksum cmake 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)" = "b8ebbb35d3dc9cd09497168f33de1acb79b265d350ab0ac34133b98f8509af1f" | |||
"checksum coco 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c06169f5beb7e31c7c67ebf5540b8b472d23e3eade3b2ec7d1f5b504a85f91bd" | |||
"checksum dbghelp-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "97590ba53bcb8ac28279161ca943a924d1fd4a8fb3fa63302591647c4fc5b850" | |||
"checksum dtoa 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "80c8b71fd71146990a9742fc06dcbbde19161a267e0ad4e572c35162f4578c90" | |||
"checksum either 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "18785c1ba806c258137c937e44ada9ee7e69a37e3c72077542cd2f069d78562a" | |||
"checksum error-chain 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d9435d864e017c3c6afeac1654189b06cdb491cf2ff73dbf0d73b0f292f42ff8" | |||
"checksum flate2 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)" = "36df0166e856739905cd3d7e0b210fe818592211a008862599845e012d8d304c" | |||
"checksum fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6cc484842f1e2884faf56f529f960cc12ad8c71ce96cc7abba0a067c98fee344" | |||
"checksum futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "4b63a4792d4f8f686defe3b39b92127fea6344de5d38202b2ee5a11bbbf29d6a" | |||
"checksum gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)" = "120d07f202dcc3f72859422563522b66fe6463a4c513df062874daad05f85f0a" | |||
"checksum getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9047cfbd08a437050b363d35ef160452c5fe8ea5187ae0a624708c91581d685" | |||
"checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb" | |||
"checksum humansize 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "92d211e6e70b05749dce515b47684f29a3c8c38bbbb21c50b30aff9eca1b0bd3" | |||
"checksum idna 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2233d4940b1f19f0418c158509cd7396b8d70a5db5705ce410914dc8fa603b37" | |||
"checksum itoa 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "eb2f404fbc66fd9aac13e998248505e7ecb2ad8e44ab6388684c5fb11c6c251c" | |||
"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" | |||
"checksum lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3b37545ab726dd833ec6420aaba8231c5b320814b9029ad585555d2a03e94fbf" | |||
"checksum libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)" = "38f5c2b18a287cf78b4097db62e20f43cace381dc76ae5c0a3073067f78b7ddc" | |||
"checksum matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "100aabe6b8ff4e4a7e32c1c13523379802df0772b82466207ac25b013f193376" | |||
"checksum memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1dbccc0e46f1ea47b9f17e6d67c5a96bd27030519c519c9c91327e31275a47b4" | |||
"checksum miniz-sys 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "28eaee17666671fa872e567547e8428e83308ebe5808cdf6a0e28397dbe2c726" | |||
"checksum num 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "2c3a3dc9f30bf824141521b30c908a859ab190b76e20435fcd89f35eb6583887" | |||
"checksum num-integer 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)" = "ef1a4bf6f9174aa5783a9b4cc892cacd11aebad6c69ad027a0b65c6ca5f8aa37" | |||
"checksum num-iter 0.1.33 (registry+https://github.com/rust-lang/crates.io-index)" = "f7d1891bd7b936f12349b7d1403761c8a0b85a18b148e9da4429d5d102c1a41e" | |||
"checksum num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "1708c0628602a98b52fad936cf3edb9a107af06e52e49fdf0707e884456a6af6" | |||
"checksum num_cpus 1.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "aec53c34f2d0247c5ca5d32cca1478762f301740468ee9ee6dcb7a0dd7a0c584" | |||
"checksum onig 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee619da9cf707b167098e84fb00f10db61d5a662d1d29b59822bcac3a81553dd" | |||
"checksum onig_sys 63.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "531682ab45a2cd40eff91f29340dae975f25336d2b61e624adabed39e61d7fb3" | |||
"checksum percent-encoding 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "de154f638187706bde41d9b4738748933d64e6b37bdbffc0b47a97d16a6ae356" | |||
"checksum pest 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3e2e823a5967bb4cdc6d3e46f47baaf4ecfeae44413a642b74ad44e59e49c7f6" | |||
"checksum pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "3a8b4c6b8165cd1a1cd4b9b120978131389f64bdaf456435caa41e630edba903" | |||
"checksum plist 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1e2f7e9574aabcf57bc5e9f602caabdffffa8179b0c130a039f7895fea3dbdb5" | |||
"checksum pulldown-cmark 0.0.15 (registry+https://github.com/rust-lang/crates.io-index)" = "378e941dbd392c101f2cb88097fa4d7167bc421d4b88de3ff7dbee503bc3233b" | |||
"checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a" | |||
"checksum rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "022e0636ec2519ddae48154b028864bdce4eaf7d35226ab8e65c611be97b189d" | |||
"checksum rayon 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b614fe08b6665cb9a231d07ac1364b0ef3cb3698f1239ee0c4c3a88a524f54c8" | |||
"checksum rayon-core 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7febc28567082c345f10cddc3612c6ea020fc3297a1977d472cf9fdb73e6e493" | |||
"checksum redox_syscall 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)" = "e4a357d14a12e90a37d658725df0e6468504750b5948b9710f83f94a0c5818e8" | |||
"checksum regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1731164734096285ec2a5ec7fea5248ae2f5485b3feeb0115af4fda2183b2d1b" | |||
"checksum regex-syntax 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ad890a5eef7953f55427c50575c680c42841653abd2b028b68cd223d157f62db" | |||
"checksum rustc-demangle 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3058a43ada2c2d0b92b3ae38007a2d0fa5e9db971be260e0171408a4ff471c95" | |||
"checksum same-file 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d931a44fdaa43b8637009e7632a02adc4f2b2e0733c08caa4cf00e8da4a117a7" | |||
"checksum scopeguard 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c79eb2c3ac4bc2507cda80e7f3ac5b88bd8eae4c0914d5663e6a8933994be918" | |||
"checksum serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)" = "6a7c6b751a2e8d5df57a5ff71b5b4fc8aaee9ee28ff1341d640dd130bb5f4f7a" | |||
"checksum serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)" = "2f6ca58905ebd3c3b285a8a6d4f3ac92b92c0d7951d5649b1bdd212549c06639" | |||
"checksum serde_derive_internals 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)" = "37aee4e0da52d801acfbc0cc219eb1eda7142112339726e427926a6f6ee65d3a" | |||
"checksum serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "48b04779552e92037212c3615370f6bd57a40ebba7f20e554ff9f55e41a69a7b" | |||
"checksum slug 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f6f5ff4b43cb07b86c5f9236c92714a22cdf9e5a27a7d85e398e2c9403328cb8" | |||
"checksum syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad" | |||
"checksum synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a393066ed9010ebaed60b9eafa373d4b1baac186dd7e008555b0f702b51945b6" | |||
"checksum syntect 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2f436345e5b6ebbfdf51b20b95cd9bcb82576262c340bad9cf815078d76b082a" | |||
"checksum tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "87974a6f5c1dfb344d733055601650059a3363de2a6104819293baff662132d6" | |||
"checksum tera 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)" = "62736a6d748fd2c5a8b4be21010e37d79f78aea3c2e07a9e13ff5c70864a3129" | |||
"checksum thread_local 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "1697c4b57aeeb7a536b647165a2825faddffb1d3bad386d507709bd51a90bb14" | |||
"checksum time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)" = "ffd7ccbf969a892bf83f1e441126968a07a3941c24ff522a26af9f9f4585d1a3" | |||
"checksum toml 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b0601da6c97135c8d330c7a13a013ca6cd4143221b01de2f8d4edc50a9e551c7" | |||
"checksum unicode-bidi 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a6a2c4e3710edd365cd7e78383153ed739fa31af19f9172f72d3575060f5a43a" | |||
"checksum unicode-normalization 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "51ccda9ef9efa3f7ef5d91e8f9b83bbe6955f9bf86aec89d5cce2c874625920f" | |||
"checksum unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc" | |||
"checksum unidecode 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d2adb95ee07cd579ed18131f2d9e7a17c25a4b76022935c7f2460d2bfae89fd2" | |||
"checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" | |||
"checksum url 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "eeb819346883532a271eb626deb43c4a1bb4c4dd47c519bd78137c3e72a4fe27" | |||
"checksum utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "662fab6525a98beff2921d7f61a39e7d59e0b425ebc7d0d9e66d316e55124122" | |||
"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" | |||
"checksum walkdir 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "bb08f9e670fab86099470b97cd2b252d6527f0b3cc1401acdb595ffc9dd288ff" | |||
"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" | |||
"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" | |||
"checksum xml-rs 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b46ee689ba7a669c08a1170c2348d2516c62dc461135c9e86b2f1f476e07be4a" | |||
"checksum yaml-rust 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e66366e18dc58b46801afbf2ca7661a9f59cc8c5962c29892b6039b4f86fa992" |
@@ -0,0 +1,19 @@ | |||
[package] | |||
name = "content" | |||
version = "0.1.0" | |||
authors = ["Vincent Prouillet <vincent@wearewizards.io>"] | |||
[dependencies] | |||
tera = "0.10" | |||
serde = "1.0" | |||
slug = "0.1" | |||
rayon = "0.8" | |||
errors = { path = "../errors" } | |||
config = { path = "../config" } | |||
utils = { path = "../utils" } | |||
rendering = { path = "../rendering" } | |||
front_matter = { path = "../front_matter" } | |||
[dev-dependencies] | |||
tempdir = "0.3" |
@@ -0,0 +1,148 @@ | |||
#![feature(test)] | |||
extern crate test; | |||
extern crate tera; | |||
extern crate content; | |||
extern crate front_matter; | |||
extern crate config; | |||
use std::collections::HashMap; | |||
use config::Config; | |||
use tera::Tera; | |||
use front_matter::{SortBy, InsertAnchor}; | |||
use content::{Page, sort_pages, populate_previous_and_next_pages}; | |||
fn create_pages(number: usize, sort_by: SortBy) -> Vec<Page> { | |||
let mut pages = vec![]; | |||
let config = Config::default(); | |||
let tera = Tera::default(); | |||
let permalinks = HashMap::new(); | |||
for i in 0..number { | |||
let mut page = Page::default(); | |||
match sort_by { | |||
SortBy::Weight => { page.meta.weight = Some(i); }, | |||
SortBy::Order => { page.meta.order = Some(i); }, | |||
_ => (), | |||
}; | |||
page.raw_content = r#" | |||
# Modus cognitius profanam ne duae virtutis mundi | |||
## Ut vita | |||
Lorem markdownum litora, care ponto nomina, et ut aspicit gelidas sui et | |||
purpureo genuit. Tamen colla venientis [delphina](http://nil-sol.com/ecquis) | |||
Tusci et temptata citaeque curam isto ubi vult vulnere reppulit. | |||
- Seque vidit flendoque de quodam | |||
- Dabit minimos deiecto caputque noctis pluma | |||
- Leti coniunx est Helicen | |||
- Illius pulvereumque Icare inpositos | |||
- Vivunt pereo pluvio tot ramos Olenios gelidis | |||
- Quater teretes natura inde | |||
### A subsection | |||
Protinus dicunt, breve per, et vivacis genus Orphei munere. Me terram [dimittere | |||
casside](http://corpus.org/) pervenit saxo primoque frequentat genuum sorori | |||
praeferre causas Libys. Illud in serpit adsuetam utrimque nunc haberent, | |||
**terrae si** veni! Hectoreis potes sumite [Mavortis retusa](http://tua.org/) | |||
granum captantur potuisse Minervae, frugum. | |||
> Clivo sub inprovisoque nostrum minus fama est, discordia patrem petebat precatur | |||
absumitur, poena per sit. Foramina *tamen cupidine* memor supplex tollentes | |||
dictum unam orbem, Anubis caecae. Viderat formosior tegebat satis, Aethiopasque | |||
sit submisso coniuge tristis ubi! | |||
## Praeceps Corinthus totidem quem crus vultum cape | |||
```rs | |||
#[derive(Debug)] | |||
pub struct Site { | |||
/// The base path of the gutenberg site | |||
pub base_path: PathBuf, | |||
/// The parsed config for the site | |||
pub config: Config, | |||
pub pages: HashMap<PathBuf, Page>, | |||
pub sections: HashMap<PathBuf, Section>, | |||
pub tera: Tera, | |||
live_reload: bool, | |||
output_path: PathBuf, | |||
static_path: PathBuf, | |||
pub tags: Option<Taxonomy>, | |||
pub categories: Option<Taxonomy>, | |||
/// A map of all .md files (section and pages) and their permalink | |||
/// We need that if there are relative links in the content that need to be resolved | |||
pub permalinks: HashMap<String, String>, | |||
} | |||
``` | |||
## More stuff | |||
And a shortcode: | |||
{{ youtube(id="my_youtube_id") }} | |||
### Another subsection | |||
Gotta make the toc do a little bit of work | |||
# A big title | |||
- hello | |||
- world | |||
- ! | |||
```py | |||
if __name__ == "__main__": | |||
gen_site("basic-blog", [""], 250, paginate=True) | |||
``` | |||
"#.to_string(); | |||
page.render_markdown(&permalinks, &tera, &config, InsertAnchor::None).unwrap(); | |||
pages.push(page); | |||
} | |||
pages | |||
} | |||
// Most of the time spent in those benches are due to the .clone()... | |||
// but i don't know how to remove them so there are some baseline bench with | |||
// just the cloning and with a bit of math we can figure it out | |||
#[bench] | |||
fn bench_baseline_cloning(b: &mut test::Bencher) { | |||
let pages = create_pages(250, SortBy::Order); | |||
b.iter(|| pages.clone()); | |||
} | |||
#[bench] | |||
fn bench_sorting_none(b: &mut test::Bencher) { | |||
let pages = create_pages(250, SortBy::Order); | |||
b.iter(|| sort_pages(pages.clone(), SortBy::None)); | |||
} | |||
#[bench] | |||
fn bench_sorting_order(b: &mut test::Bencher) { | |||
let pages = create_pages(250, SortBy::Order); | |||
b.iter(|| sort_pages(pages.clone(), SortBy::Order)); | |||
} | |||
#[bench] | |||
fn bench_populate_previous_and_next_pages(b: &mut test::Bencher) { | |||
let pages = create_pages(250, SortBy::Order); | |||
let (sorted_pages, _) = sort_pages(pages, SortBy::Order); | |||
b.iter(|| populate_previous_and_next_pages(sorted_pages.clone())); | |||
} | |||
#[bench] | |||
fn bench_page_render_html(b: &mut test::Bencher) { | |||
let pages = create_pages(10, SortBy::Order); | |||
let (mut sorted_pages, _) = sort_pages(pages, SortBy::Order); | |||
sorted_pages = populate_previous_and_next_pages(sorted_pages.clone()); | |||
let config = Config::default(); | |||
let mut tera = Tera::default(); | |||
tera.add_raw_template("page.html", "{{ page.content }}").unwrap(); | |||
let page = &sorted_pages[5]; | |||
b.iter(|| page.render_html(&tera, &config).unwrap()); | |||
} |
@@ -0,0 +1,24 @@ | |||
extern crate tera; | |||
extern crate slug; | |||
extern crate serde; | |||
extern crate rayon; | |||
extern crate errors; | |||
extern crate config; | |||
extern crate front_matter; | |||
extern crate rendering; | |||
extern crate utils; | |||
#[cfg(test)] | |||
extern crate tempdir; | |||
mod file_info; | |||
mod page; | |||
mod section; | |||
mod sorting; | |||
pub use file_info::FileInfo; | |||
pub use page::Page; | |||
pub use section::Section; | |||
pub use sorting::{sort_pages, populate_previous_and_next_pages}; |
@@ -10,13 +10,12 @@ use slug::slugify; | |||
use errors::{Result, ResultExt}; | |||
use config::Config; | |||
use utils::fs::{read_file, find_related_assets}; | |||
use utils::site::get_reading_analytics; | |||
use front_matter::{PageFrontMatter, InsertAnchor, split_page_content}; | |||
use rendering::markdown::markdown_to_html; | |||
use rendering::context::Context; | |||
use fs::{read_file}; | |||
use content::utils::{find_related_assets, get_reading_analytics}; | |||
use content::file_info::FileInfo; | |||
use content::{Header, Section}; | |||
use rendering::{Context, Header, markdown_to_html}; | |||
use file_info::FileInfo; | |||
#[derive(Clone, Debug, PartialEq)] | |||
@@ -108,10 +107,10 @@ impl Page { | |||
let path = path.as_ref(); | |||
let content = read_file(path)?; | |||
let mut page = Page::parse(path, &content, config)?; | |||
page.assets = find_related_assets(path.parent().unwrap()); | |||
page.assets = vec![]; | |||
if !page.assets.is_empty() && page.file.name != "index" { | |||
bail!("Page `{}` has assets ({:?}) but is not named index.md", path.display(), page.assets); | |||
if page.file.name == "index" { | |||
page.assets = find_related_assets(path.parent().unwrap()); | |||
} | |||
Ok(page) | |||
@@ -121,7 +120,14 @@ impl Page { | |||
/// We need access to all pages url to render links relative to content | |||
/// so that can't happen at the same time as parsing | |||
pub fn render_markdown(&mut self, permalinks: &HashMap<String, String>, tera: &Tera, config: &Config, anchor_insert: InsertAnchor) -> Result<()> { | |||
let context = Context::new(tera, config, &self.permalink, permalinks, anchor_insert); | |||
let context = Context::new( | |||
tera, | |||
config.highlight_code.unwrap(), | |||
config.highlight_theme.clone().unwrap(), | |||
&self.permalink, | |||
permalinks, | |||
anchor_insert | |||
); | |||
let res = markdown_to_html(&self.raw_content, &context)?; | |||
self.content = res.0; | |||
self.toc = res.1; | |||
@@ -136,7 +142,7 @@ impl Page { | |||
} | |||
/// Renders the page using the default layout, unless specified in front-matter | |||
pub fn render_html(&self, tera: &Tera, config: &Config, section: Option<&Section>) -> Result<String> { | |||
pub fn render_html(&self, tera: &Tera, config: &Config) -> Result<String> { | |||
let tpl_name = match self.meta.template { | |||
Some(ref l) => l.to_string(), | |||
None => "page.html".to_string() | |||
@@ -147,7 +153,6 @@ impl Page { | |||
context.add("page", self); | |||
context.add("current_url", &self.permalink); | |||
context.add("current_path", &self.path); | |||
context.add("section", §ion); | |||
tera.render(&tpl_name, &context) | |||
.chain_err(|| format!("Failed to render page '{}'", self.file.path.display())) | |||
@@ -322,16 +327,4 @@ Hello world | |||
let page = res.unwrap(); | |||
assert_eq!(page.file.parent, path.join("content").join("posts")); | |||
} | |||
#[test] | |||
fn errors_file_not_named_index_with_assets() { | |||
let tmp_dir = TempDir::new("example").expect("create temp dir"); | |||
File::create(tmp_dir.path().join("something.md")).unwrap(); | |||
File::create(tmp_dir.path().join("example.js")).unwrap(); | |||
File::create(tmp_dir.path().join("graph.jpg")).unwrap(); | |||
File::create(tmp_dir.path().join("fail.png")).unwrap(); | |||
let page = Page::from_file(tmp_dir.path().join("something.md"), &Config::default()); | |||
assert!(page.is_err()); | |||
} | |||
} |
@@ -8,12 +8,11 @@ use serde::ser::{SerializeStruct, self}; | |||
use config::Config; | |||
use front_matter::{SectionFrontMatter, split_section_content}; | |||
use errors::{Result, ResultExt}; | |||
use fs::{read_file}; | |||
use rendering::markdown::markdown_to_html; | |||
use rendering::context::Context; | |||
use content::Page; | |||
use content::file_info::FileInfo; | |||
use content::Header; | |||
use utils::fs::read_file; | |||
use rendering::{Context, Header, markdown_to_html}; | |||
use page::Page; | |||
use file_info::FileInfo; | |||
#[derive(Clone, Debug, PartialEq)] | |||
@@ -90,7 +89,14 @@ impl Section { | |||
/// We need access to all pages url to render links relative to content | |||
/// so that can't happen at the same time as parsing | |||
pub fn render_markdown(&mut self, permalinks: &HashMap<String, String>, tera: &Tera, config: &Config) -> Result<()> { | |||
let context = Context::new(tera, config, &self.permalink, permalinks, self.meta.insert_anchor.unwrap()); | |||
let context = Context::new( | |||
tera, | |||
config.highlight_code.unwrap(), | |||
config.highlight_theme.clone().unwrap(), | |||
&self.permalink, | |||
permalinks, | |||
self.meta.insert_anchor.unwrap() | |||
); | |||
let res = markdown_to_html(&self.raw_content, &context)?; | |||
self.content = res.0; | |||
self.toc = res.1; | |||
@@ -98,7 +104,7 @@ impl Section { | |||
} | |||
/// Renders the page using the default layout, unless specified in front-matter | |||
pub fn render_html(&self, sections: HashMap<String, Section>, tera: &Tera, config: &Config) -> Result<String> { | |||
pub fn render_html(&self, tera: &Tera, config: &Config) -> Result<String> { | |||
let tpl_name = self.get_template_name(); | |||
let mut context = TeraContext::new(); | |||
@@ -106,9 +112,6 @@ impl Section { | |||
context.add("section", self); | |||
context.add("current_url", &self.permalink); | |||
context.add("current_path", &self.path); | |||
if self.is_index() { | |||
context.add("sections", §ions); | |||
} | |||
tera.render(&tpl_name, &context) | |||
.chain_err(|| format!("Failed to render section '{}'", self.file.path.display())) |
@@ -1,65 +1,49 @@ | |||
use content::Page; | |||
#[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize)] | |||
#[serde(rename_all = "lowercase")] | |||
pub enum SortBy { | |||
Date, | |||
Order, | |||
None, | |||
} | |||
use rayon::prelude::*; | |||
use page::Page; | |||
use front_matter::SortBy; | |||
/// Sort pages using the method for the given section | |||
/// Sort pages by the given criteria | |||
/// | |||
/// Any pages that doesn't have a date when the sorting method is date or order | |||
/// when the sorting method is order will be ignored. | |||
/// Any pages that doesn't have a the required field when the sorting method is other than none | |||
/// will be ignored. | |||
pub fn sort_pages(pages: Vec<Page>, sort_by: SortBy) -> (Vec<Page>, Vec<Page>) { | |||
match sort_by { | |||
SortBy::Date => { | |||
let mut can_be_sorted = vec![]; | |||
let mut cannot_be_sorted = vec![]; | |||
for page in pages { | |||
if page.meta.date.is_some() { | |||
can_be_sorted.push(page); | |||
} else { | |||
cannot_be_sorted.push(page); | |||
} | |||
} | |||
can_be_sorted.sort_by(|a, b| b.meta.date().unwrap().cmp(&a.meta.date().unwrap())); | |||
(can_be_sorted, cannot_be_sorted) | |||
}, | |||
SortBy::Order => { | |||
let mut can_be_sorted = vec![]; | |||
let mut cannot_be_sorted = vec![]; | |||
for page in pages { | |||
if page.meta.order.is_some() { | |||
can_be_sorted.push(page); | |||
} else { | |||
cannot_be_sorted.push(page); | |||
} | |||
if sort_by == SortBy::None { | |||
return (pages, vec![]); | |||
} | |||
let (mut can_be_sorted, cannot_be_sorted): (Vec<_>, Vec<_>) = pages | |||
.into_par_iter() | |||
.partition(|page| { | |||
match sort_by { | |||
SortBy::Date => page.meta.date.is_some(), | |||
SortBy::Order => page.meta.order.is_some(), | |||
SortBy::Weight => page.meta.weight.is_some(), | |||
_ => unreachable!() | |||
} | |||
can_be_sorted.sort_by(|a, b| b.meta.order().cmp(&a.meta.order())); | |||
}); | |||
(can_be_sorted, cannot_be_sorted) | |||
}, | |||
SortBy::None => (pages, vec![]) | |||
} | |||
match sort_by { | |||
SortBy::Date => can_be_sorted.par_sort_unstable_by(|a, b| b.meta.date().unwrap().cmp(&a.meta.date().unwrap())), | |||
SortBy::Order => can_be_sorted.par_sort_unstable_by(|a, b| b.meta.order().cmp(&a.meta.order())), | |||
SortBy::Weight => can_be_sorted.par_sort_unstable_by(|a, b| a.meta.weight().cmp(&b.meta.weight())), | |||
_ => unreachable!() | |||
}; | |||
(can_be_sorted, cannot_be_sorted) | |||
} | |||
/// Horribly inefficient way to set previous and next on each pages | |||
/// So many clones | |||
pub fn populate_previous_and_next_pages(input: &[Page]) -> Vec<Page> { | |||
let pages = input.to_vec(); | |||
let mut res = Vec::new(); | |||
let mut res = Vec::with_capacity(input.len()); | |||
// the input is already sorted | |||
// We might put prev/next randomly if a page is missing date/order, probably fine | |||
for (i, page) in input.iter().enumerate() { | |||
let mut new_page = page.clone(); | |||
// The input is already sorted | |||
for (i, _) in input.iter().enumerate() { | |||
let mut new_page = input[i].clone(); | |||
if i > 0 { | |||
let next = &pages[i - 1]; | |||
let mut next_page = next.clone(); | |||
let mut next_page = input[i - 1].clone(); | |||
// Remove prev/next otherwise we serialise the whole thing... | |||
next_page.previous = None; | |||
next_page.next = None; | |||
@@ -67,9 +51,8 @@ pub fn populate_previous_and_next_pages(input: &[Page]) -> Vec<Page> { | |||
} | |||
if i < input.len() - 1 { | |||
let previous = &pages[i + 1]; | |||
let mut previous_page = input[i + 1].clone(); | |||
// Remove prev/next otherwise we serialise the whole thing... | |||
let mut previous_page = previous.clone(); | |||
previous_page.previous = None; | |||
previous_page.next = None; | |||
new_page.previous = Some(Box::new(previous_page)); | |||
@@ -82,9 +65,9 @@ pub fn populate_previous_and_next_pages(input: &[Page]) -> Vec<Page> { | |||
#[cfg(test)] | |||
mod tests { | |||
use front_matter::{PageFrontMatter}; | |||
use content::Page; | |||
use super::{SortBy, sort_pages, populate_previous_and_next_pages}; | |||
use front_matter::{PageFrontMatter, SortBy}; | |||
use page::Page; | |||
use super::{sort_pages, populate_previous_and_next_pages}; | |||
fn create_page_with_date(date: &str) -> Page { | |||
let mut front_matter = PageFrontMatter::default(); | |||
@@ -98,6 +81,12 @@ mod tests { | |||
Page::new("content/hello.md", front_matter) | |||
} | |||
fn create_page_with_weight(weight: usize) -> Page { | |||
let mut front_matter = PageFrontMatter::default(); | |||
front_matter.weight = Some(weight); | |||
Page::new("content/hello.md", front_matter) | |||
} | |||
#[test] | |||
fn can_sort_by_dates() { | |||
let input = vec![ | |||
@@ -126,6 +115,20 @@ mod tests { | |||
assert_eq!(pages[2].clone().meta.order.unwrap(), 1); | |||
} | |||
#[test] | |||
fn can_sort_by_weight() { | |||
let input = vec![ | |||
create_page_with_weight(2), | |||
create_page_with_weight(3), | |||
create_page_with_weight(1), | |||
]; | |||
let (pages, _) = sort_pages(input, SortBy::Weight); | |||
// Should be sorted by date | |||
assert_eq!(pages[0].clone().meta.weight.unwrap(), 1); | |||
assert_eq!(pages[1].clone().meta.weight.unwrap(), 2); | |||
assert_eq!(pages[2].clone().meta.weight.unwrap(), 3); | |||
} | |||
#[test] | |||
fn can_sort_by_none() { | |||
let input = vec![ | |||
@@ -155,11 +158,11 @@ mod tests { | |||
#[test] | |||
fn can_populate_previous_and_next_pages() { | |||
let input = vec![ | |||
create_page_with_order(3), | |||
create_page_with_order(2), | |||
create_page_with_order(1), | |||
create_page_with_order(2), | |||
create_page_with_order(3), | |||
]; | |||
let pages = populate_previous_and_next_pages(input.as_slice()); | |||
let pages = populate_previous_and_next_pages(&input); | |||
assert!(pages[0].clone().next.is_none()); | |||
assert!(pages[0].clone().previous.is_some()); | |||
@@ -167,8 +170,8 @@ mod tests { | |||
assert!(pages[1].clone().next.is_some()); | |||
assert!(pages[1].clone().previous.is_some()); | |||
assert_eq!(pages[1].clone().next.unwrap().meta.order.unwrap(), 3); | |||
assert_eq!(pages[1].clone().previous.unwrap().meta.order.unwrap(), 1); | |||
assert_eq!(pages[1].clone().previous.unwrap().meta.order.unwrap(), 3); | |||
assert_eq!(pages[1].clone().next.unwrap().meta.order.unwrap(), 1); | |||
assert!(pages[2].clone().next.is_some()); | |||
assert!(pages[2].clone().previous.is_none()); |
@@ -0,0 +1,9 @@ | |||
[package] | |||
name = "errors" | |||
version = "0.1.0" | |||
authors = ["Vincent Prouillet <vincent@wearewizards.io>"] | |||
[dependencies] | |||
error-chain = "0.10" | |||
tera = "0.10" | |||
toml = "0.4" |
@@ -0,0 +1,29 @@ | |||
#[macro_use] | |||
extern crate error_chain; | |||
extern crate tera; | |||
extern crate toml; | |||
error_chain! { | |||
errors {} | |||
links { | |||
Tera(tera::Error, tera::ErrorKind); | |||
} | |||
foreign_links { | |||
Io(::std::io::Error); | |||
Toml(toml::de::Error); | |||
} | |||
} | |||
// So we can use bail! in all other crates | |||
#[macro_export] | |||
macro_rules! bail { | |||
($e:expr) => { | |||
return Err($e.into()); | |||
}; | |||
($fmt:expr, $($arg:tt)+) => { | |||
return Err(format!($fmt, $($arg)+).into()); | |||
}; | |||
} | |||
@@ -0,0 +1,445 @@ | |||
[root] | |||
name = "front_matter" | |||
version = "0.1.0" | |||
dependencies = [ | |||
"chrono 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"core 0.1.0", | |||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"tera 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"toml 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "aho-corasick" | |||
version = "0.6.3" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "backtrace" | |||
version = "0.3.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"backtrace-sys 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"cfg-if 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"dbghelp-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"rustc-demangle 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "backtrace-sys" | |||
version = "0.1.11" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "cfg-if" | |||
version = "0.1.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "chrono" | |||
version = "0.4.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"num 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "core" | |||
version = "0.1.0" | |||
dependencies = [ | |||
"error-chain 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"tera 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"toml 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "dbghelp-sys" | |||
version = "0.2.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "dtoa" | |||
version = "0.4.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "error-chain" | |||
version = "0.10.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"backtrace 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "gcc" | |||
version = "0.3.51" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "glob" | |||
version = "0.2.11" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "humansize" | |||
version = "1.0.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "idna" | |||
version = "0.1.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"unicode-bidi 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"unicode-normalization 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "itoa" | |||
version = "0.3.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "kernel32-sys" | |||
version = "0.2.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "lazy_static" | |||
version = "0.2.8" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "libc" | |||
version = "0.2.24" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "matches" | |||
version = "0.1.6" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "memchr" | |||
version = "1.0.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "num" | |||
version = "0.1.39" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"num-integer 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"num-iter 0.1.33 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "num-integer" | |||
version = "0.1.34" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "num-iter" | |||
version = "0.1.33" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"num-integer 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "num-traits" | |||
version = "0.1.39" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "percent-encoding" | |||
version = "1.0.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "pest" | |||
version = "0.4.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "quote" | |||
version = "0.3.15" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "redox_syscall" | |||
version = "0.1.19" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "regex" | |||
version = "0.2.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"aho-corasick 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"regex-syntax 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"thread_local 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "regex-syntax" | |||
version = "0.4.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "rustc-demangle" | |||
version = "0.1.4" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "serde" | |||
version = "1.0.9" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "serde_derive" | |||
version = "1.0.9" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_derive_internals 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "serde_derive_internals" | |||
version = "0.15.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "serde_json" | |||
version = "1.0.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"dtoa 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"itoa 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "slug" | |||
version = "0.1.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"unidecode 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "syn" | |||
version = "0.11.11" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "synom" | |||
version = "0.11.3" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "tera" | |||
version = "0.10.8" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"chrono 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"error-chain 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"humansize 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"pest 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"slug 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"url 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "thread_local" | |||
version = "0.3.4" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "time" | |||
version = "0.1.37" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"redox_syscall 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "toml" | |||
version = "0.4.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "unicode-bidi" | |||
version = "0.3.3" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "unicode-normalization" | |||
version = "0.1.5" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "unicode-xid" | |||
version = "0.0.4" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "unidecode" | |||
version = "0.2.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "unreachable" | |||
version = "1.0.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "url" | |||
version = "1.5.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"idna 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"percent-encoding 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "utf8-ranges" | |||
version = "1.0.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "void" | |||
version = "1.0.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "winapi" | |||
version = "0.2.8" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "winapi-build" | |||
version = "0.1.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[metadata] | |||
"checksum aho-corasick 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "500909c4f87a9e52355b26626d890833e9e1d53ac566db76c36faa984b889699" | |||
"checksum backtrace 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "72f9b4182546f4b04ebc4ab7f84948953a118bd6021a1b6a6c909e3e94f6be76" | |||
"checksum backtrace-sys 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "3a0d842ea781ce92be2bf78a9b38883948542749640b8378b3b2f03d1fd9f1ff" | |||
"checksum cfg-if 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d0c47d456a36ebf0536a6705c83c1cbbcb9255fbc1d905a6ded104f479268a29" | |||
"checksum chrono 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7c20ebe0b2b08b0aeddba49c609fe7957ba2e33449882cb186a180bc60682fa9" | |||
"checksum dbghelp-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "97590ba53bcb8ac28279161ca943a924d1fd4a8fb3fa63302591647c4fc5b850" | |||
"checksum dtoa 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "80c8b71fd71146990a9742fc06dcbbde19161a267e0ad4e572c35162f4578c90" | |||
"checksum error-chain 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d9435d864e017c3c6afeac1654189b06cdb491cf2ff73dbf0d73b0f292f42ff8" | |||
"checksum gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)" = "120d07f202dcc3f72859422563522b66fe6463a4c513df062874daad05f85f0a" | |||
"checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb" | |||
"checksum humansize 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "92d211e6e70b05749dce515b47684f29a3c8c38bbbb21c50b30aff9eca1b0bd3" | |||
"checksum idna 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2233d4940b1f19f0418c158509cd7396b8d70a5db5705ce410914dc8fa603b37" | |||
"checksum itoa 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "eb2f404fbc66fd9aac13e998248505e7ecb2ad8e44ab6388684c5fb11c6c251c" | |||
"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" | |||
"checksum lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3b37545ab726dd833ec6420aaba8231c5b320814b9029ad585555d2a03e94fbf" | |||
"checksum libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)" = "38f5c2b18a287cf78b4097db62e20f43cace381dc76ae5c0a3073067f78b7ddc" | |||
"checksum matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "100aabe6b8ff4e4a7e32c1c13523379802df0772b82466207ac25b013f193376" | |||
"checksum memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1dbccc0e46f1ea47b9f17e6d67c5a96bd27030519c519c9c91327e31275a47b4" | |||
"checksum num 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "2c3a3dc9f30bf824141521b30c908a859ab190b76e20435fcd89f35eb6583887" | |||
"checksum num-integer 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)" = "ef1a4bf6f9174aa5783a9b4cc892cacd11aebad6c69ad027a0b65c6ca5f8aa37" | |||
"checksum num-iter 0.1.33 (registry+https://github.com/rust-lang/crates.io-index)" = "f7d1891bd7b936f12349b7d1403761c8a0b85a18b148e9da4429d5d102c1a41e" | |||
"checksum num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "1708c0628602a98b52fad936cf3edb9a107af06e52e49fdf0707e884456a6af6" | |||
"checksum percent-encoding 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "de154f638187706bde41d9b4738748933d64e6b37bdbffc0b47a97d16a6ae356" | |||
"checksum pest 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3e2e823a5967bb4cdc6d3e46f47baaf4ecfeae44413a642b74ad44e59e49c7f6" | |||
"checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a" | |||
"checksum redox_syscall 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)" = "e4a357d14a12e90a37d658725df0e6468504750b5948b9710f83f94a0c5818e8" | |||
"checksum regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1731164734096285ec2a5ec7fea5248ae2f5485b3feeb0115af4fda2183b2d1b" | |||
"checksum regex-syntax 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ad890a5eef7953f55427c50575c680c42841653abd2b028b68cd223d157f62db" | |||
"checksum rustc-demangle 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3058a43ada2c2d0b92b3ae38007a2d0fa5e9db971be260e0171408a4ff471c95" | |||
"checksum serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)" = "6a7c6b751a2e8d5df57a5ff71b5b4fc8aaee9ee28ff1341d640dd130bb5f4f7a" | |||
"checksum serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)" = "2f6ca58905ebd3c3b285a8a6d4f3ac92b92c0d7951d5649b1bdd212549c06639" | |||
"checksum serde_derive_internals 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)" = "37aee4e0da52d801acfbc0cc219eb1eda7142112339726e427926a6f6ee65d3a" | |||
"checksum serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "48b04779552e92037212c3615370f6bd57a40ebba7f20e554ff9f55e41a69a7b" | |||
"checksum slug 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f6f5ff4b43cb07b86c5f9236c92714a22cdf9e5a27a7d85e398e2c9403328cb8" | |||
"checksum syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad" | |||
"checksum synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a393066ed9010ebaed60b9eafa373d4b1baac186dd7e008555b0f702b51945b6" | |||
"checksum tera 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)" = "62736a6d748fd2c5a8b4be21010e37d79f78aea3c2e07a9e13ff5c70864a3129" | |||
"checksum thread_local 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "1697c4b57aeeb7a536b647165a2825faddffb1d3bad386d507709bd51a90bb14" | |||
"checksum time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)" = "ffd7ccbf969a892bf83f1e441126968a07a3941c24ff522a26af9f9f4585d1a3" | |||
"checksum toml 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b0601da6c97135c8d330c7a13a013ca6cd4143221b01de2f8d4edc50a9e551c7" | |||
"checksum unicode-bidi 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a6a2c4e3710edd365cd7e78383153ed739fa31af19f9172f72d3575060f5a43a" | |||
"checksum unicode-normalization 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "51ccda9ef9efa3f7ef5d91e8f9b83bbe6955f9bf86aec89d5cce2c874625920f" | |||
"checksum unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc" | |||
"checksum unidecode 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d2adb95ee07cd579ed18131f2d9e7a17c25a4b76022935c7f2460d2bfae89fd2" | |||
"checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" | |||
"checksum url 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "eeb819346883532a271eb626deb43c4a1bb4c4dd47c519bd78137c3e72a4fe27" | |||
"checksum utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "662fab6525a98beff2921d7f61a39e7d59e0b425ebc7d0d9e66d316e55124122" | |||
"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" | |||
"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" | |||
"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" |
@@ -0,0 +1,16 @@ | |||
[package] | |||
name = "front_matter" | |||
version = "0.1.0" | |||
authors = ["Vincent Prouillet <vincent@wearewizards.io>"] | |||
[dependencies] | |||
tera = "0.10" | |||
chrono = "0.4" | |||
serde = "1.0" | |||
serde_derive = "1.0" | |||
toml = "0.4" | |||
regex = "0.2" | |||
lazy_static = "0.2" | |||
errors = { path = "../errors" } |
@@ -1,19 +1,48 @@ | |||
use std::path::Path; | |||
#[macro_use] | |||
extern crate lazy_static; | |||
#[macro_use] | |||
extern crate serde_derive; | |||
extern crate serde; | |||
extern crate toml; | |||
extern crate regex; | |||
extern crate tera; | |||
extern crate chrono; | |||
#[macro_use] | |||
extern crate errors; | |||
use std::path::Path; | |||
use regex::Regex; | |||
use errors::{Result, ResultExt}; | |||
mod page; | |||
mod section; | |||
pub use self::page::PageFrontMatter; | |||
pub use self::section::{SectionFrontMatter, InsertAnchor}; | |||
pub use page::PageFrontMatter; | |||
pub use section::SectionFrontMatter; | |||
lazy_static! { | |||
static ref PAGE_RE: Regex = Regex::new(r"^[[:space:]]*\+\+\+\r?\n((?s).*?(?-s))\+\+\+\r?\n?((?s).*(?-s))$").unwrap(); | |||
} | |||
#[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize)] | |||
#[serde(rename_all = "lowercase")] | |||
pub enum SortBy { | |||
Date, | |||
Order, | |||
Weight, | |||
None, | |||
} | |||
#[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize)] | |||
#[serde(rename_all = "lowercase")] | |||
pub enum InsertAnchor { | |||
Left, | |||
Right, | |||
None, | |||
} | |||
/// Split a file between the front matter and its content | |||
/// Will return an error if the front matter wasn't found | |||
fn split_content(file_path: &Path, content: &str) -> Result<(String, String)> { | |||
@@ -43,7 +72,7 @@ pub fn split_section_content(file_path: &Path, content: &str) -> Result<(Section | |||
pub fn split_page_content(file_path: &Path, content: &str) -> Result<(PageFrontMatter, String)> { | |||
let (front_matter, content) = split_content(file_path, content)?; | |||
let meta = PageFrontMatter::parse(&front_matter) | |||
.chain_err(|| format!("Error when parsing front matter of section `{}`", file_path.to_string_lossy()))?; | |||
.chain_err(|| format!("Error when parsing front matter of page `{}`", file_path.to_string_lossy()))?; | |||
Ok((meta, content)) | |||
} | |||
@@ -4,7 +4,7 @@ use chrono::prelude::*; | |||
use tera::Value; | |||
use toml; | |||
use errors::{Result}; | |||
use errors::Result; | |||
/// The front matter of every page | |||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] | |||
@@ -28,6 +28,8 @@ pub struct PageFrontMatter { | |||
pub category: Option<String>, | |||
/// Integer to use to order content. Lowest is at the bottom, highest first | |||
pub order: Option<usize>, | |||
/// Integer to use to order content. Highest is at the bottom, lowest first | |||
pub weight: Option<usize>, | |||
/// All aliases for that page. Gutenberg will create HTML templates that will | |||
#[serde(skip_serializing)] | |||
pub aliases: Option<Vec<String>>, | |||
@@ -84,6 +86,10 @@ impl PageFrontMatter { | |||
self.order.unwrap() | |||
} | |||
pub fn weight(&self) -> usize { | |||
self.weight.unwrap() | |||
} | |||
pub fn has_tags(&self) -> bool { | |||
match self.tags { | |||
Some(ref t) => !t.is_empty(), | |||
@@ -103,6 +109,7 @@ impl Default for PageFrontMatter { | |||
tags: None, | |||
category: None, | |||
order: None, | |||
weight: None, | |||
aliases: None, | |||
template: None, | |||
extra: None, |
@@ -3,19 +3,12 @@ use std::collections::HashMap; | |||
use tera::Value; | |||
use toml; | |||
use errors::{Result}; | |||
use content::SortBy; | |||
use errors::Result; | |||
static DEFAULT_PAGINATE_PATH: &'static str = "page"; | |||
use super::{SortBy, InsertAnchor}; | |||
static DEFAULT_PAGINATE_PATH: &'static str = "page"; | |||
#[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize)] | |||
#[serde(rename_all = "lowercase")] | |||
pub enum InsertAnchor { | |||
Left, | |||
Right, | |||
None, | |||
} | |||
/// The front matter of every section | |||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] |
@@ -0,0 +1,741 @@ | |||
[root] | |||
name = "pagination" | |||
version = "0.1.0" | |||
dependencies = [ | |||
"config 0.1.0", | |||
"content 0.1.0", | |||
"errors 0.1.0", | |||
"front_matter 0.1.0", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"tera 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "aho-corasick" | |||
version = "0.6.3" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "backtrace" | |||
version = "0.3.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"backtrace-sys 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"cfg-if 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"dbghelp-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"rustc-demangle 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "backtrace-sys" | |||
version = "0.1.11" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "base64" | |||
version = "0.5.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "base64" | |||
version = "0.6.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "bincode" | |||
version = "0.8.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "bitflags" | |||
version = "0.7.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "bitflags" | |||
version = "0.8.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "bitflags" | |||
version = "0.9.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "byteorder" | |||
version = "1.0.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "cfg-if" | |||
version = "0.1.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "chrono" | |||
version = "0.3.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"num 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "chrono" | |||
version = "0.4.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"num 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "cmake" | |||
version = "0.1.24" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "config" | |||
version = "0.1.0" | |||
dependencies = [ | |||
"errors 0.1.0", | |||
"rendering 0.1.0", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"toml 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "content" | |||
version = "0.1.0" | |||
dependencies = [ | |||
"config 0.1.0", | |||
"errors 0.1.0", | |||
"front_matter 0.1.0", | |||
"rendering 0.1.0", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"slug 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"tera 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"utils 0.1.0", | |||
] | |||
[[package]] | |||
name = "dbghelp-sys" | |||
version = "0.2.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "dtoa" | |||
version = "0.4.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "error-chain" | |||
version = "0.10.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"backtrace 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "errors" | |||
version = "0.1.0" | |||
dependencies = [ | |||
"error-chain 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"tera 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"toml 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "flate2" | |||
version = "0.2.19" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"miniz-sys 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "fnv" | |||
version = "1.0.5" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "front_matter" | |||
version = "0.1.0" | |||
dependencies = [ | |||
"chrono 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"errors 0.1.0", | |||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"tera 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"toml 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "gcc" | |||
version = "0.3.51" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "getopts" | |||
version = "0.2.14" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "glob" | |||
version = "0.2.11" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "humansize" | |||
version = "1.0.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "idna" | |||
version = "0.1.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"unicode-bidi 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"unicode-normalization 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "itoa" | |||
version = "0.3.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "kernel32-sys" | |||
version = "0.2.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "lazy_static" | |||
version = "0.2.8" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "libc" | |||
version = "0.2.24" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "matches" | |||
version = "0.1.6" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "memchr" | |||
version = "1.0.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "miniz-sys" | |||
version = "0.1.9" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "num" | |||
version = "0.1.39" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"num-integer 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"num-iter 0.1.33 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "num-integer" | |||
version = "0.1.34" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "num-iter" | |||
version = "0.1.33" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"num-integer 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "num-traits" | |||
version = "0.1.39" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "onig" | |||
version = "1.3.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"onig_sys 63.0.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "onig_sys" | |||
version = "63.0.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"cmake 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "percent-encoding" | |||
version = "1.0.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "pest" | |||
version = "0.4.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "pkg-config" | |||
version = "0.3.9" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "plist" | |||
version = "0.2.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"base64 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"chrono 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"xml-rs 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "pulldown-cmark" | |||
version = "0.0.15" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "quote" | |||
version = "0.3.15" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "redox_syscall" | |||
version = "0.1.19" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "regex" | |||
version = "0.2.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"aho-corasick 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"regex-syntax 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"thread_local 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "regex-syntax" | |||
version = "0.4.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "rendering" | |||
version = "0.1.0" | |||
dependencies = [ | |||
"errors 0.1.0", | |||
"front_matter 0.1.0", | |||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"pulldown-cmark 0.0.15 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"slug 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"syntect 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"templates 0.1.0", | |||
"tera 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"utils 0.1.0", | |||
] | |||
[[package]] | |||
name = "rustc-demangle" | |||
version = "0.1.4" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "safemem" | |||
version = "0.2.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "same-file" | |||
version = "0.1.3" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "serde" | |||
version = "1.0.9" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "serde_derive" | |||
version = "1.0.9" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_derive_internals 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "serde_derive_internals" | |||
version = "0.15.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "serde_json" | |||
version = "1.0.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"dtoa 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"itoa 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "slug" | |||
version = "0.1.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"unidecode 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "syn" | |||
version = "0.11.11" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "synom" | |||
version = "0.11.3" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "syntect" | |||
version = "1.7.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"bincode 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"bitflags 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"flate2 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"onig 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"plist 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"regex-syntax 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"walkdir 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"yaml-rust 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "templates" | |||
version = "0.1.0" | |||
dependencies = [ | |||
"base64 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"errors 0.1.0", | |||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"pulldown-cmark 0.0.15 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"tera 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"utils 0.1.0", | |||
] | |||
[[package]] | |||
name = "tera" | |||
version = "0.10.8" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"chrono 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"error-chain 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"humansize 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"pest 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"slug 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"url 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "thread_local" | |||
version = "0.3.4" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "time" | |||
version = "0.1.37" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"redox_syscall 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "toml" | |||
version = "0.4.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "unicode-bidi" | |||
version = "0.3.3" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "unicode-normalization" | |||
version = "0.1.5" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "unicode-xid" | |||
version = "0.0.4" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "unidecode" | |||
version = "0.2.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "unreachable" | |||
version = "1.0.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "url" | |||
version = "1.5.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"idna 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"percent-encoding 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "utf8-ranges" | |||
version = "1.0.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "utils" | |||
version = "0.1.0" | |||
dependencies = [ | |||
"errors 0.1.0", | |||
] | |||
[[package]] | |||
name = "void" | |||
version = "1.0.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "walkdir" | |||
version = "1.0.7" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"same-file 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "winapi" | |||
version = "0.2.8" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "winapi-build" | |||
version = "0.1.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "xml-rs" | |||
version = "0.4.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "yaml-rust" | |||
version = "0.3.5" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[metadata] | |||
"checksum aho-corasick 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "500909c4f87a9e52355b26626d890833e9e1d53ac566db76c36faa984b889699" | |||
"checksum backtrace 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "72f9b4182546f4b04ebc4ab7f84948953a118bd6021a1b6a6c909e3e94f6be76" | |||
"checksum backtrace-sys 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "3a0d842ea781ce92be2bf78a9b38883948542749640b8378b3b2f03d1fd9f1ff" | |||
"checksum base64 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "30e93c03064e7590d0466209155251b90c22e37fab1daf2771582598b5827557" | |||
"checksum base64 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "96434f987501f0ed4eb336a411e0631ecd1afa11574fe148587adc4ff96143c9" | |||
"checksum bincode 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e103c8b299b28a9c6990458b7013dc4a8356a9b854c51b9883241f5866fac36e" | |||
"checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d" | |||
"checksum bitflags 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1370e9fc2a6ae53aea8b7a5110edbd08836ed87c88736dfabccade1c2b44bff4" | |||
"checksum bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5" | |||
"checksum byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c40977b0ee6b9885c9013cd41d9feffdd22deb3bb4dc3a71d901cc7a77de18c8" | |||
"checksum cfg-if 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d0c47d456a36ebf0536a6705c83c1cbbcb9255fbc1d905a6ded104f479268a29" | |||
"checksum chrono 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "158b0bd7d75cbb6bf9c25967a48a2e9f77da95876b858eadfabaa99cd069de6e" | |||
"checksum chrono 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7c20ebe0b2b08b0aeddba49c609fe7957ba2e33449882cb186a180bc60682fa9" | |||
"checksum cmake 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)" = "b8ebbb35d3dc9cd09497168f33de1acb79b265d350ab0ac34133b98f8509af1f" | |||
"checksum dbghelp-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "97590ba53bcb8ac28279161ca943a924d1fd4a8fb3fa63302591647c4fc5b850" | |||
"checksum dtoa 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "80c8b71fd71146990a9742fc06dcbbde19161a267e0ad4e572c35162f4578c90" | |||
"checksum error-chain 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d9435d864e017c3c6afeac1654189b06cdb491cf2ff73dbf0d73b0f292f42ff8" | |||
"checksum flate2 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)" = "36df0166e856739905cd3d7e0b210fe818592211a008862599845e012d8d304c" | |||
"checksum fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6cc484842f1e2884faf56f529f960cc12ad8c71ce96cc7abba0a067c98fee344" | |||
"checksum gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)" = "120d07f202dcc3f72859422563522b66fe6463a4c513df062874daad05f85f0a" | |||
"checksum getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9047cfbd08a437050b363d35ef160452c5fe8ea5187ae0a624708c91581d685" | |||
"checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb" | |||
"checksum humansize 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "92d211e6e70b05749dce515b47684f29a3c8c38bbbb21c50b30aff9eca1b0bd3" | |||
"checksum idna 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2233d4940b1f19f0418c158509cd7396b8d70a5db5705ce410914dc8fa603b37" | |||
"checksum itoa 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "eb2f404fbc66fd9aac13e998248505e7ecb2ad8e44ab6388684c5fb11c6c251c" | |||
"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" | |||
"checksum lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3b37545ab726dd833ec6420aaba8231c5b320814b9029ad585555d2a03e94fbf" | |||
"checksum libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)" = "38f5c2b18a287cf78b4097db62e20f43cace381dc76ae5c0a3073067f78b7ddc" | |||
"checksum matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "100aabe6b8ff4e4a7e32c1c13523379802df0772b82466207ac25b013f193376" | |||
"checksum memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1dbccc0e46f1ea47b9f17e6d67c5a96bd27030519c519c9c91327e31275a47b4" | |||
"checksum miniz-sys 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "28eaee17666671fa872e567547e8428e83308ebe5808cdf6a0e28397dbe2c726" | |||
"checksum num 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "2c3a3dc9f30bf824141521b30c908a859ab190b76e20435fcd89f35eb6583887" | |||
"checksum num-integer 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)" = "ef1a4bf6f9174aa5783a9b4cc892cacd11aebad6c69ad027a0b65c6ca5f8aa37" | |||
"checksum num-iter 0.1.33 (registry+https://github.com/rust-lang/crates.io-index)" = "f7d1891bd7b936f12349b7d1403761c8a0b85a18b148e9da4429d5d102c1a41e" | |||
"checksum num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "1708c0628602a98b52fad936cf3edb9a107af06e52e49fdf0707e884456a6af6" | |||
"checksum onig 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee619da9cf707b167098e84fb00f10db61d5a662d1d29b59822bcac3a81553dd" | |||
"checksum onig_sys 63.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "531682ab45a2cd40eff91f29340dae975f25336d2b61e624adabed39e61d7fb3" | |||
"checksum percent-encoding 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "de154f638187706bde41d9b4738748933d64e6b37bdbffc0b47a97d16a6ae356" | |||
"checksum pest 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3e2e823a5967bb4cdc6d3e46f47baaf4ecfeae44413a642b74ad44e59e49c7f6" | |||
"checksum pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "3a8b4c6b8165cd1a1cd4b9b120978131389f64bdaf456435caa41e630edba903" | |||
"checksum plist 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1e2f7e9574aabcf57bc5e9f602caabdffffa8179b0c130a039f7895fea3dbdb5" | |||
"checksum pulldown-cmark 0.0.15 (registry+https://github.com/rust-lang/crates.io-index)" = "378e941dbd392c101f2cb88097fa4d7167bc421d4b88de3ff7dbee503bc3233b" | |||
"checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a" | |||
"checksum redox_syscall 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)" = "e4a357d14a12e90a37d658725df0e6468504750b5948b9710f83f94a0c5818e8" | |||
"checksum regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1731164734096285ec2a5ec7fea5248ae2f5485b3feeb0115af4fda2183b2d1b" | |||
"checksum regex-syntax 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ad890a5eef7953f55427c50575c680c42841653abd2b028b68cd223d157f62db" | |||
"checksum rustc-demangle 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3058a43ada2c2d0b92b3ae38007a2d0fa5e9db971be260e0171408a4ff471c95" | |||
"checksum safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e27a8b19b835f7aea908818e871f5cc3a5a186550c30773be987e155e8163d8f" | |||
"checksum same-file 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d931a44fdaa43b8637009e7632a02adc4f2b2e0733c08caa4cf00e8da4a117a7" | |||
"checksum serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)" = "6a7c6b751a2e8d5df57a5ff71b5b4fc8aaee9ee28ff1341d640dd130bb5f4f7a" | |||
"checksum serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)" = "2f6ca58905ebd3c3b285a8a6d4f3ac92b92c0d7951d5649b1bdd212549c06639" | |||
"checksum serde_derive_internals 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)" = "37aee4e0da52d801acfbc0cc219eb1eda7142112339726e427926a6f6ee65d3a" | |||
"checksum serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "48b04779552e92037212c3615370f6bd57a40ebba7f20e554ff9f55e41a69a7b" | |||
"checksum slug 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f6f5ff4b43cb07b86c5f9236c92714a22cdf9e5a27a7d85e398e2c9403328cb8" | |||
"checksum syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad" | |||
"checksum synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a393066ed9010ebaed60b9eafa373d4b1baac186dd7e008555b0f702b51945b6" | |||
"checksum syntect 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2f436345e5b6ebbfdf51b20b95cd9bcb82576262c340bad9cf815078d76b082a" | |||
"checksum tera 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)" = "62736a6d748fd2c5a8b4be21010e37d79f78aea3c2e07a9e13ff5c70864a3129" | |||
"checksum thread_local 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "1697c4b57aeeb7a536b647165a2825faddffb1d3bad386d507709bd51a90bb14" | |||
"checksum time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)" = "ffd7ccbf969a892bf83f1e441126968a07a3941c24ff522a26af9f9f4585d1a3" | |||
"checksum toml 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b0601da6c97135c8d330c7a13a013ca6cd4143221b01de2f8d4edc50a9e551c7" | |||
"checksum unicode-bidi 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a6a2c4e3710edd365cd7e78383153ed739fa31af19f9172f72d3575060f5a43a" | |||
"checksum unicode-normalization 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "51ccda9ef9efa3f7ef5d91e8f9b83bbe6955f9bf86aec89d5cce2c874625920f" | |||
"checksum unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc" | |||
"checksum unidecode 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d2adb95ee07cd579ed18131f2d9e7a17c25a4b76022935c7f2460d2bfae89fd2" | |||
"checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" | |||
"checksum url 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "eeb819346883532a271eb626deb43c4a1bb4c4dd47c519bd78137c3e72a4fe27" | |||
"checksum utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "662fab6525a98beff2921d7f61a39e7d59e0b425ebc7d0d9e66d316e55124122" | |||
"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" | |||
"checksum walkdir 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "bb08f9e670fab86099470b97cd2b252d6527f0b3cc1401acdb595ffc9dd288ff" | |||
"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" | |||
"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" | |||
"checksum xml-rs 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b46ee689ba7a669c08a1170c2348d2516c62dc461135c9e86b2f1f476e07be4a" | |||
"checksum yaml-rust 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e66366e18dc58b46801afbf2ca7661a9f59cc8c5962c29892b6039b4f86fa992" |
@@ -0,0 +1,16 @@ | |||
[package] | |||
name = "pagination" | |||
version = "0.1.0" | |||
authors = ["Vincent Prouillet <vincent@wearewizards.io>"] | |||
[dependencies] | |||
tera = "0.10" | |||
serde = "1.0" | |||
serde_derive = "1.0" | |||
errors = { path = "../errors" } | |||
config = { path = "../config" } | |||
content = { path = "../content" } | |||
[dev-dependencies] | |||
front_matter = { path = "../front_matter" } |
@@ -1,9 +1,21 @@ | |||
#[macro_use] | |||
extern crate serde_derive; | |||
extern crate tera; | |||
extern crate errors; | |||
extern crate config; | |||
extern crate content; | |||
#[cfg(test)] | |||
extern crate front_matter; | |||
use std::collections::HashMap; | |||
use tera::{Context, to_value, Value}; | |||
use tera::{Tera, Context, to_value, Value}; | |||
use errors::{Result, ResultExt}; | |||
use config::Config; | |||
use content::{Page, Section}; | |||
use site::Site; | |||
/// A list of all the pages in the paginator with their index and links | |||
@@ -28,6 +40,17 @@ impl<'a> Pager<'a> { | |||
pages, | |||
} | |||
} | |||
/// Returns a manually cloned Pager with the pages removed | |||
/// for use as template context | |||
fn clone_without_pages(&self) -> Pager<'a> { | |||
Pager { | |||
index: self.index, | |||
permalink: self.permalink.clone(), | |||
path: self.path.clone(), | |||
pages: vec![], | |||
} | |||
} | |||
} | |||
#[derive(Clone, Debug, PartialEq)] | |||
@@ -112,7 +135,12 @@ impl<'a> Paginator<'a> { | |||
paginator.insert("first", to_value(&self.section.permalink).unwrap()); | |||
let last_pager = &self.pagers[self.pagers.len() - 1]; | |||
paginator.insert("last", to_value(&last_pager.permalink).unwrap()); | |||
paginator.insert("pagers", to_value(&self.pagers).unwrap()); | |||
paginator.insert( | |||
"pagers", | |||
to_value( | |||
&self.pagers.iter().map(|p| p.clone_without_pages()).collect::<Vec<_>>() | |||
).unwrap() | |||
); | |||
// Variables for this specific page | |||
if pager_index > 0 { | |||
@@ -134,30 +162,27 @@ impl<'a> Paginator<'a> { | |||
paginator | |||
} | |||
pub fn render_pager(&self, pager: &Pager, site: &Site) -> Result<String> { | |||
pub fn render_pager(&self, pager: &Pager, config: &Config, tera: &Tera) -> Result<String> { | |||
let mut context = Context::new(); | |||
context.add("config", &site.config); | |||
context.add("config", &config); | |||
context.add("section", self.section); | |||
context.add("current_url", &pager.permalink); | |||
context.add("current_path", &pager.path); | |||
context.add("paginator", &self.build_paginator_context(pager)); | |||
if self.section.is_index() { | |||
context.add("section", &site.sections); | |||
} | |||
site.tera.render(&self.section.get_template_name(), &context) | |||
tera.render(&self.section.get_template_name(), &context) | |||
.chain_err(|| format!("Failed to render pager {} of section '{}'", pager.index, self.section.file.path.display())) | |||
} | |||
} | |||
#[cfg(test)] | |||
mod tests { | |||
use tera::{to_value}; | |||
use tera::to_value; | |||
use front_matter::SectionFrontMatter; | |||
use content::{Page, Section}; | |||
use super::{Paginator}; | |||
use super::Paginator; | |||
fn create_section(is_index: bool) -> Section { | |||
let mut f = SectionFrontMatter::default(); |
@@ -0,0 +1,702 @@ | |||
[root] | |||
name = "rendering" | |||
version = "0.1.0" | |||
dependencies = [ | |||
"errors 0.1.0", | |||
"front_matter 0.1.0", | |||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"pulldown-cmark 0.0.15 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"slug 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"syntect 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"templates 0.1.0", | |||
"tera 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"utils 0.1.0", | |||
] | |||
[[package]] | |||
name = "aho-corasick" | |||
version = "0.6.3" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "backtrace" | |||
version = "0.3.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"backtrace-sys 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"cfg-if 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"dbghelp-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"rustc-demangle 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "backtrace-sys" | |||
version = "0.1.11" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "base64" | |||
version = "0.5.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "base64" | |||
version = "0.6.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "bincode" | |||
version = "0.8.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "bitflags" | |||
version = "0.7.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "bitflags" | |||
version = "0.8.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "bitflags" | |||
version = "0.9.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "byteorder" | |||
version = "1.0.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "cfg-if" | |||
version = "0.1.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "chrono" | |||
version = "0.3.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"num 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "chrono" | |||
version = "0.4.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"num 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "cmake" | |||
version = "0.1.24" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "dbghelp-sys" | |||
version = "0.2.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "dtoa" | |||
version = "0.4.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "error-chain" | |||
version = "0.10.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"backtrace 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "errors" | |||
version = "0.1.0" | |||
dependencies = [ | |||
"error-chain 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"tera 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"toml 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "flate2" | |||
version = "0.2.19" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"miniz-sys 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "fnv" | |||
version = "1.0.5" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "front_matter" | |||
version = "0.1.0" | |||
dependencies = [ | |||
"chrono 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"errors 0.1.0", | |||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"tera 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"toml 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "gcc" | |||
version = "0.3.51" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "getopts" | |||
version = "0.2.14" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "glob" | |||
version = "0.2.11" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "humansize" | |||
version = "1.0.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "idna" | |||
version = "0.1.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"unicode-bidi 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"unicode-normalization 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "itoa" | |||
version = "0.3.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "kernel32-sys" | |||
version = "0.2.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "lazy_static" | |||
version = "0.2.8" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "libc" | |||
version = "0.2.24" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "matches" | |||
version = "0.1.6" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "memchr" | |||
version = "1.0.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "miniz-sys" | |||
version = "0.1.9" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "num" | |||
version = "0.1.39" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"num-integer 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"num-iter 0.1.33 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "num-integer" | |||
version = "0.1.34" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "num-iter" | |||
version = "0.1.33" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"num-integer 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "num-traits" | |||
version = "0.1.39" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "onig" | |||
version = "1.3.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"onig_sys 63.0.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "onig_sys" | |||
version = "63.0.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"cmake 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "percent-encoding" | |||
version = "1.0.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "pest" | |||
version = "0.4.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "pkg-config" | |||
version = "0.3.9" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "plist" | |||
version = "0.2.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"base64 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"chrono 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"xml-rs 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "pulldown-cmark" | |||
version = "0.0.15" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "quote" | |||
version = "0.3.15" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "redox_syscall" | |||
version = "0.1.19" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "regex" | |||
version = "0.2.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"aho-corasick 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"regex-syntax 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"thread_local 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "regex-syntax" | |||
version = "0.4.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "rustc-demangle" | |||
version = "0.1.4" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "safemem" | |||
version = "0.2.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "same-file" | |||
version = "0.1.3" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "serde" | |||
version = "1.0.9" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "serde_derive" | |||
version = "1.0.9" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_derive_internals 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "serde_derive_internals" | |||
version = "0.15.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "serde_json" | |||
version = "1.0.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"dtoa 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"itoa 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "slug" | |||
version = "0.1.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"unidecode 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "syn" | |||
version = "0.11.11" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "synom" | |||
version = "0.11.3" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "syntect" | |||
version = "1.7.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"bincode 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"bitflags 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"flate2 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"onig 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"plist 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"regex-syntax 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"walkdir 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"yaml-rust 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "templates" | |||
version = "0.1.0" | |||
dependencies = [ | |||
"base64 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"errors 0.1.0", | |||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"pulldown-cmark 0.0.15 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"tera 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"utils 0.1.0", | |||
] | |||
[[package]] | |||
name = "tera" | |||
version = "0.10.8" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"chrono 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"error-chain 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"humansize 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"pest 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"slug 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"url 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "thread_local" | |||
version = "0.3.4" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "time" | |||
version = "0.1.37" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"redox_syscall 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "toml" | |||
version = "0.4.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "unicode-bidi" | |||
version = "0.3.3" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "unicode-normalization" | |||
version = "0.1.5" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "unicode-xid" | |||
version = "0.0.4" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "unidecode" | |||
version = "0.2.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "unreachable" | |||
version = "1.0.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "url" | |||
version = "1.5.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"idna 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"percent-encoding 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "utf8-ranges" | |||
version = "1.0.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "utils" | |||
version = "0.1.0" | |||
dependencies = [ | |||
"errors 0.1.0", | |||
] | |||
[[package]] | |||
name = "void" | |||
version = "1.0.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "walkdir" | |||
version = "1.0.7" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"same-file 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "winapi" | |||
version = "0.2.8" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "winapi-build" | |||
version = "0.1.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "xml-rs" | |||
version = "0.4.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "yaml-rust" | |||
version = "0.3.5" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[metadata] | |||
"checksum aho-corasick 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "500909c4f87a9e52355b26626d890833e9e1d53ac566db76c36faa984b889699" | |||
"checksum backtrace 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "72f9b4182546f4b04ebc4ab7f84948953a118bd6021a1b6a6c909e3e94f6be76" | |||
"checksum backtrace-sys 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "3a0d842ea781ce92be2bf78a9b38883948542749640b8378b3b2f03d1fd9f1ff" | |||
"checksum base64 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "30e93c03064e7590d0466209155251b90c22e37fab1daf2771582598b5827557" | |||
"checksum base64 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "96434f987501f0ed4eb336a411e0631ecd1afa11574fe148587adc4ff96143c9" | |||
"checksum bincode 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e103c8b299b28a9c6990458b7013dc4a8356a9b854c51b9883241f5866fac36e" | |||
"checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d" | |||
"checksum bitflags 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1370e9fc2a6ae53aea8b7a5110edbd08836ed87c88736dfabccade1c2b44bff4" | |||
"checksum bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5" | |||
"checksum byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c40977b0ee6b9885c9013cd41d9feffdd22deb3bb4dc3a71d901cc7a77de18c8" | |||
"checksum cfg-if 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d0c47d456a36ebf0536a6705c83c1cbbcb9255fbc1d905a6ded104f479268a29" | |||
"checksum chrono 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "158b0bd7d75cbb6bf9c25967a48a2e9f77da95876b858eadfabaa99cd069de6e" | |||
"checksum chrono 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7c20ebe0b2b08b0aeddba49c609fe7957ba2e33449882cb186a180bc60682fa9" | |||
"checksum cmake 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)" = "b8ebbb35d3dc9cd09497168f33de1acb79b265d350ab0ac34133b98f8509af1f" | |||
"checksum dbghelp-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "97590ba53bcb8ac28279161ca943a924d1fd4a8fb3fa63302591647c4fc5b850" | |||
"checksum dtoa 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "80c8b71fd71146990a9742fc06dcbbde19161a267e0ad4e572c35162f4578c90" | |||
"checksum error-chain 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d9435d864e017c3c6afeac1654189b06cdb491cf2ff73dbf0d73b0f292f42ff8" | |||
"checksum flate2 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)" = "36df0166e856739905cd3d7e0b210fe818592211a008862599845e012d8d304c" | |||
"checksum fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6cc484842f1e2884faf56f529f960cc12ad8c71ce96cc7abba0a067c98fee344" | |||
"checksum gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)" = "120d07f202dcc3f72859422563522b66fe6463a4c513df062874daad05f85f0a" | |||
"checksum getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9047cfbd08a437050b363d35ef160452c5fe8ea5187ae0a624708c91581d685" | |||
"checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb" | |||
"checksum humansize 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "92d211e6e70b05749dce515b47684f29a3c8c38bbbb21c50b30aff9eca1b0bd3" | |||
"checksum idna 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2233d4940b1f19f0418c158509cd7396b8d70a5db5705ce410914dc8fa603b37" | |||
"checksum itoa 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "eb2f404fbc66fd9aac13e998248505e7ecb2ad8e44ab6388684c5fb11c6c251c" | |||
"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" | |||
"checksum lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3b37545ab726dd833ec6420aaba8231c5b320814b9029ad585555d2a03e94fbf" | |||
"checksum libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)" = "38f5c2b18a287cf78b4097db62e20f43cace381dc76ae5c0a3073067f78b7ddc" | |||
"checksum matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "100aabe6b8ff4e4a7e32c1c13523379802df0772b82466207ac25b013f193376" | |||
"checksum memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1dbccc0e46f1ea47b9f17e6d67c5a96bd27030519c519c9c91327e31275a47b4" | |||
"checksum miniz-sys 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "28eaee17666671fa872e567547e8428e83308ebe5808cdf6a0e28397dbe2c726" | |||
"checksum num 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "2c3a3dc9f30bf824141521b30c908a859ab190b76e20435fcd89f35eb6583887" | |||
"checksum num-integer 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)" = "ef1a4bf6f9174aa5783a9b4cc892cacd11aebad6c69ad027a0b65c6ca5f8aa37" | |||
"checksum num-iter 0.1.33 (registry+https://github.com/rust-lang/crates.io-index)" = "f7d1891bd7b936f12349b7d1403761c8a0b85a18b148e9da4429d5d102c1a41e" | |||
"checksum num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "1708c0628602a98b52fad936cf3edb9a107af06e52e49fdf0707e884456a6af6" | |||
"checksum onig 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee619da9cf707b167098e84fb00f10db61d5a662d1d29b59822bcac3a81553dd" | |||
"checksum onig_sys 63.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "531682ab45a2cd40eff91f29340dae975f25336d2b61e624adabed39e61d7fb3" | |||
"checksum percent-encoding 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "de154f638187706bde41d9b4738748933d64e6b37bdbffc0b47a97d16a6ae356" | |||
"checksum pest 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3e2e823a5967bb4cdc6d3e46f47baaf4ecfeae44413a642b74ad44e59e49c7f6" | |||
"checksum pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "3a8b4c6b8165cd1a1cd4b9b120978131389f64bdaf456435caa41e630edba903" | |||
"checksum plist 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1e2f7e9574aabcf57bc5e9f602caabdffffa8179b0c130a039f7895fea3dbdb5" | |||
"checksum pulldown-cmark 0.0.15 (registry+https://github.com/rust-lang/crates.io-index)" = "378e941dbd392c101f2cb88097fa4d7167bc421d4b88de3ff7dbee503bc3233b" | |||
"checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a" | |||
"checksum redox_syscall 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)" = "e4a357d14a12e90a37d658725df0e6468504750b5948b9710f83f94a0c5818e8" | |||
"checksum regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1731164734096285ec2a5ec7fea5248ae2f5485b3feeb0115af4fda2183b2d1b" | |||
"checksum regex-syntax 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ad890a5eef7953f55427c50575c680c42841653abd2b028b68cd223d157f62db" | |||
"checksum rustc-demangle 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3058a43ada2c2d0b92b3ae38007a2d0fa5e9db971be260e0171408a4ff471c95" | |||
"checksum safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e27a8b19b835f7aea908818e871f5cc3a5a186550c30773be987e155e8163d8f" | |||
"checksum same-file 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d931a44fdaa43b8637009e7632a02adc4f2b2e0733c08caa4cf00e8da4a117a7" | |||
"checksum serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)" = "6a7c6b751a2e8d5df57a5ff71b5b4fc8aaee9ee28ff1341d640dd130bb5f4f7a" | |||
"checksum serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)" = "2f6ca58905ebd3c3b285a8a6d4f3ac92b92c0d7951d5649b1bdd212549c06639" | |||
"checksum serde_derive_internals 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)" = "37aee4e0da52d801acfbc0cc219eb1eda7142112339726e427926a6f6ee65d3a" | |||
"checksum serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "48b04779552e92037212c3615370f6bd57a40ebba7f20e554ff9f55e41a69a7b" | |||
"checksum slug 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f6f5ff4b43cb07b86c5f9236c92714a22cdf9e5a27a7d85e398e2c9403328cb8" | |||
"checksum syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad" | |||
"checksum synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a393066ed9010ebaed60b9eafa373d4b1baac186dd7e008555b0f702b51945b6" | |||
"checksum syntect 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2f436345e5b6ebbfdf51b20b95cd9bcb82576262c340bad9cf815078d76b082a" | |||
"checksum tera 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)" = "62736a6d748fd2c5a8b4be21010e37d79f78aea3c2e07a9e13ff5c70864a3129" | |||
"checksum thread_local 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "1697c4b57aeeb7a536b647165a2825faddffb1d3bad386d507709bd51a90bb14" | |||
"checksum time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)" = "ffd7ccbf969a892bf83f1e441126968a07a3941c24ff522a26af9f9f4585d1a3" | |||
"checksum toml 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b0601da6c97135c8d330c7a13a013ca6cd4143221b01de2f8d4edc50a9e551c7" | |||
"checksum unicode-bidi 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a6a2c4e3710edd365cd7e78383153ed739fa31af19f9172f72d3575060f5a43a" | |||
"checksum unicode-normalization 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "51ccda9ef9efa3f7ef5d91e8f9b83bbe6955f9bf86aec89d5cce2c874625920f" | |||
"checksum unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc" | |||
"checksum unidecode 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d2adb95ee07cd579ed18131f2d9e7a17c25a4b76022935c7f2460d2bfae89fd2" | |||
"checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" | |||
"checksum url 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "eeb819346883532a271eb626deb43c4a1bb4c4dd47c519bd78137c3e72a4fe27" | |||
"checksum utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "662fab6525a98beff2921d7f61a39e7d59e0b425ebc7d0d9e66d316e55124122" | |||
"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" | |||
"checksum walkdir 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "bb08f9e670fab86099470b97cd2b252d6527f0b3cc1401acdb595ffc9dd288ff" | |||
"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" | |||
"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" | |||
"checksum xml-rs 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b46ee689ba7a669c08a1170c2348d2516c62dc461135c9e86b2f1f476e07be4a" | |||
"checksum yaml-rust 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e66366e18dc58b46801afbf2ca7661a9f59cc8c5962c29892b6039b4f86fa992" |
@@ -0,0 +1,21 @@ | |||
[package] | |||
name = "rendering" | |||
version = "0.1.0" | |||
authors = ["Vincent Prouillet <vincent@wearewizards.io>"] | |||
[dependencies] | |||
tera = "0.10" | |||
regex = "0.2" | |||
lazy_static = "0.2" | |||
syntect = { version = "1", features = ["static-onig"] } | |||
pulldown-cmark = "0" | |||
slug = "0.1" | |||
serde = "1.0" | |||
serde_derive = "1.0" | |||
errors = { path = "../errors" } | |||
front_matter = { path = "../front_matter" } | |||
utils = { path = "../utils" } | |||
[dev-dependencies] | |||
templates = { path = "../templates" } |
@@ -0,0 +1,100 @@ | |||
#![feature(test)] | |||
extern crate test; | |||
extern crate tera; | |||
extern crate rendering; | |||
extern crate front_matter; | |||
use std::collections::HashMap; | |||
use tera::Tera; | |||
use rendering::{Context, markdown_to_html}; | |||
use front_matter::InsertAnchor; | |||
static CONTENT: &'static str = r#" | |||
# Modus cognitius profanam ne duae virtutis mundi | |||
## Ut vita | |||
Lorem markdownum litora, care ponto nomina, et ut aspicit gelidas sui et | |||
purpureo genuit. Tamen colla venientis [delphina](http://nil-sol.com/ecquis) | |||
Tusci et temptata citaeque curam isto ubi vult vulnere reppulit. | |||
- Seque vidit flendoque de quodam | |||
- Dabit minimos deiecto caputque noctis pluma | |||
- Leti coniunx est Helicen | |||
- Illius pulvereumque Icare inpositos | |||
- Vivunt pereo pluvio tot ramos Olenios gelidis | |||
- Quater teretes natura inde | |||
### A subsection | |||
Protinus dicunt, breve per, et vivacis genus Orphei munere. Me terram [dimittere | |||
casside](http://corpus.org/) pervenit saxo primoque frequentat genuum sorori | |||
praeferre causas Libys. Illud in serpit adsuetam utrimque nunc haberent, | |||
**terrae si** veni! Hectoreis potes sumite [Mavortis retusa](http://tua.org/) | |||
granum captantur potuisse Minervae, frugum. | |||
> Clivo sub inprovisoque nostrum minus fama est, discordia patrem petebat precatur | |||
absumitur, poena per sit. Foramina *tamen cupidine* memor supplex tollentes | |||
dictum unam orbem, Anubis caecae. Viderat formosior tegebat satis, Aethiopasque | |||
sit submisso coniuge tristis ubi! | |||
## Praeceps Corinthus totidem quem crus vultum cape | |||
```rs | |||
#[derive(Debug)] | |||
pub struct Site { | |||
/// The base path of the gutenberg site | |||
pub base_path: PathBuf, | |||
/// The parsed config for the site | |||
pub config: Config, | |||
pub pages: HashMap<PathBuf, Page>, | |||
pub sections: HashMap<PathBuf, Section>, | |||
pub tera: Tera, | |||
live_reload: bool, | |||
output_path: PathBuf, | |||
static_path: PathBuf, | |||
pub tags: Option<Taxonomy>, | |||
pub categories: Option<Taxonomy>, | |||
/// A map of all .md files (section and pages) and their permalink | |||
/// We need that if there are relative links in the content that need to be resolved | |||
pub permalinks: HashMap<String, String>, | |||
} | |||
``` | |||
## More stuff | |||
And a shortcode: | |||
{{ youtube(id="my_youtube_id") }} | |||
### Another subsection | |||
Gotta make the toc do a little bit of work | |||
# A big title | |||
- hello | |||
- world | |||
- ! | |||
```py | |||
if __name__ == "__main__": | |||
gen_site("basic-blog", [""], 250, paginate=True) | |||
``` | |||
"#; | |||
#[bench] | |||
fn bench_markdown_to_html_with_highlighting(b: &mut test::Bencher) { | |||
let tera_ctx = Tera::default(); | |||
let permalinks_ctx = HashMap::new(); | |||
let context = Context::new(&tera_ctx, true, "base16-ocean-dark".to_string(), "", &permalinks_ctx, InsertAnchor::None); | |||
b.iter(|| markdown_to_html(CONTENT, &context)); | |||
} | |||
#[bench] | |||
fn bench_markdown_to_html_without_highlighting(b: &mut test::Bencher) { | |||
let tera_ctx = Tera::default(); | |||
let permalinks_ctx = HashMap::new(); | |||
let context = Context::new(&tera_ctx, false, "base16-ocean-dark".to_string(), "", &permalinks_ctx, InsertAnchor::None); | |||
b.iter(|| markdown_to_html(CONTENT, &context)); | |||
} |
@@ -2,7 +2,6 @@ use std::collections::HashMap; | |||
use tera::Tera; | |||
use config::Config; | |||
use front_matter::InsertAnchor; | |||
@@ -20,7 +19,8 @@ pub struct Context<'a> { | |||
impl<'a> Context<'a> { | |||
pub fn new( | |||
tera: &'a Tera, | |||
config: &'a Config, | |||
highlight_code: bool, | |||
highlight_theme: String, | |||
current_page_permalink: &str, | |||
permalinks: &'a HashMap<String, String>, | |||
insert_anchor: InsertAnchor, | |||
@@ -30,8 +30,8 @@ impl<'a> Context<'a> { | |||
current_page_permalink: current_page_permalink.to_string(), | |||
permalinks, | |||
insert_anchor, | |||
highlight_code: config.highlight_code.unwrap(), | |||
highlight_theme: config.highlight_theme.clone().unwrap(), | |||
highlight_code, | |||
highlight_theme, | |||
} | |||
} | |||
@@ -0,0 +1,16 @@ | |||
use syntect::dumps::from_binary; | |||
use syntect::parsing::SyntaxSet; | |||
use syntect::highlighting::ThemeSet; | |||
thread_local!{ | |||
pub static SYNTAX_SET: SyntaxSet = { | |||
let mut ss: SyntaxSet = from_binary(include_bytes!("../../../sublime_syntaxes/newlines.packdump")); | |||
ss.link_syntaxes(); | |||
ss | |||
}; | |||
} | |||
lazy_static!{ | |||
pub static ref THEME_SET: ThemeSet = from_binary(include_bytes!("../../../sublime_themes/all.themedump")); | |||
} | |||
@@ -0,0 +1,27 @@ | |||
#[macro_use] | |||
extern crate lazy_static; | |||
extern crate regex; | |||
extern crate tera; | |||
extern crate syntect; | |||
extern crate pulldown_cmark; | |||
extern crate slug; | |||
#[macro_use] | |||
extern crate serde_derive; | |||
extern crate serde; | |||
extern crate errors; | |||
extern crate front_matter; | |||
extern crate utils; | |||
#[cfg(test)] | |||
extern crate templates; | |||
mod context; | |||
pub mod highlighting; | |||
mod markdown; | |||
mod short_code; | |||
mod table_of_contents; | |||
pub use context::Context; | |||
pub use markdown::markdown_to_html; | |||
pub use table_of_contents::Header; |
@@ -0,0 +1,264 @@ | |||
use std::borrow::Cow::Owned; | |||
use pulldown_cmark as cmark; | |||
use self::cmark::{Parser, Event, Tag, Options, OPTION_ENABLE_TABLES, OPTION_ENABLE_FOOTNOTES}; | |||
use slug::slugify; | |||
use syntect::easy::HighlightLines; | |||
use syntect::html::{start_coloured_html_snippet, styles_to_coloured_html, IncludeBackground}; | |||
use tera::{Context as TeraContext}; | |||
use errors::Result; | |||
use utils::site::resolve_internal_link; | |||
use front_matter::InsertAnchor; | |||
use context::Context; | |||
use highlighting::{SYNTAX_SET, THEME_SET}; | |||
use short_code::{SHORTCODE_RE, ShortCode, parse_shortcode, render_simple_shortcode}; | |||
use table_of_contents::{TempHeader, Header, make_table_of_contents}; | |||
pub fn markdown_to_html(content: &str, context: &Context) -> Result<(String, Vec<Header>)> { | |||
// We try to be smart about highlighting code as it can be time-consuming | |||
// If the global config disables it, then we do nothing. However, | |||
// if we see a code block in the content, we assume that this page needs | |||
// to be highlighted. It could potentially have false positive if the content | |||
// has ``` in it but that seems kind of unlikely | |||
let should_highlight = if context.highlight_code { | |||
content.contains("```") | |||
} else { | |||
false | |||
}; | |||
// Set while parsing | |||
let mut error = None; | |||
let mut highlighter: Option<HighlightLines> = None; | |||
let mut shortcode_block = None; | |||
// shortcodes live outside of paragraph so we need to ensure we don't close | |||
// a paragraph that has already been closed | |||
let mut added_shortcode = false; | |||
// Don't transform things that look like shortcodes in code blocks | |||
let mut in_code_block = false; | |||
// If we get text in header, we need to insert the id and a anchor | |||
let mut in_header = false; | |||
// pulldown_cmark can send several text events for a title if there are markdown | |||
// specific characters like `!` in them. We only want to insert the anchor the first time | |||
let mut header_already_inserted = false; | |||
let mut anchors: Vec<String> = vec![]; | |||
// the rendered html | |||
let mut html = String::new(); | |||
// We might have cases where the slug is already present in our list of anchor | |||
// for example an article could have several titles named Example | |||
// We add a counter after the slug if the slug is already present, which | |||
// means we will have example, example-1, example-2 etc | |||
fn find_anchor(anchors: &[String], name: String, level: u8) -> String { | |||
if level == 0 && !anchors.contains(&name) { | |||
return name.to_string(); | |||
} | |||
let new_anchor = format!("{}-{}", name, level + 1); | |||
if !anchors.contains(&new_anchor) { | |||
return new_anchor; | |||
} | |||
find_anchor(anchors, name, level + 1) | |||
} | |||
let mut headers = vec![]; | |||
// Defaults to a 0 level so not a real header | |||
// It should be an Option ideally but not worth the hassle to update | |||
let mut temp_header = TempHeader::default(); | |||
let mut opts = Options::empty(); | |||
opts.insert(OPTION_ENABLE_TABLES); | |||
opts.insert(OPTION_ENABLE_FOOTNOTES); | |||
{ | |||
let parser = Parser::new_ext(content, opts).map(|event| match event { | |||
Event::Text(text) => { | |||
// if we are in the middle of a code block | |||
if let Some(ref mut highlighter) = highlighter { | |||
let highlighted = &highlighter.highlight(&text); | |||
let html = styles_to_coloured_html(highlighted, IncludeBackground::Yes); | |||
return Event::Html(Owned(html)); | |||
} | |||
if in_code_block { | |||
return Event::Text(text); | |||
} | |||
// Shortcode without body | |||
if shortcode_block.is_none() && text.starts_with("{{") && text.ends_with("}}") && SHORTCODE_RE.is_match(&text) { | |||
let (name, args) = parse_shortcode(&text); | |||
added_shortcode = true; | |||
match render_simple_shortcode(context.tera, &name, &args) { | |||
Ok(s) => return Event::Html(Owned(format!("</p>{}", s))), | |||
Err(e) => { | |||
error = Some(e); | |||
return Event::Html(Owned("".to_string())); | |||
} | |||
} | |||
// non-matching will be returned normally below | |||
} | |||
// Shortcode with a body | |||
if shortcode_block.is_none() && text.starts_with("{%") && text.ends_with("%}") { | |||
if SHORTCODE_RE.is_match(&text) { | |||
let (name, args) = parse_shortcode(&text); | |||
shortcode_block = Some(ShortCode::new(&name, args)); | |||
} | |||
// Don't return anything | |||
return Event::Text(Owned("".to_string())); | |||
} | |||
// If we have some text while in a shortcode, it's either the body | |||
// or the end tag | |||
if shortcode_block.is_some() { | |||
if let Some(ref mut shortcode) = shortcode_block { | |||
if text.trim() == "{% end %}" { | |||
added_shortcode = true; | |||
match shortcode.render(context.tera) { | |||
Ok(s) => return Event::Html(Owned(format!("</p>{}", s))), | |||
Err(e) => { | |||
error = Some(e); | |||
return Event::Html(Owned("".to_string())); | |||
} | |||
} | |||
} else { | |||
shortcode.append(&text); | |||
return Event::Html(Owned("".to_string())); | |||
} | |||
} | |||
} | |||
if in_header { | |||
if header_already_inserted { | |||
return Event::Text(text); | |||
} | |||
let id = find_anchor(&anchors, slugify(&text), 0); | |||
anchors.push(id.clone()); | |||
let anchor_link = if context.should_insert_anchor() { | |||
let mut c = TeraContext::new(); | |||
c.add("id", &id); | |||
context.tera.render("anchor-link.html", &c).unwrap() | |||
} else { | |||
String::new() | |||
}; | |||
// update the header and add it to the list | |||
temp_header.id = id.clone(); | |||
temp_header.title = text.clone().into_owned(); | |||
temp_header.permalink = format!("{}#{}", context.current_page_permalink, id); | |||
headers.push(temp_header.clone()); | |||
temp_header = TempHeader::default(); | |||
header_already_inserted = true; | |||
let event = match context.insert_anchor { | |||
InsertAnchor::Left => Event::Html(Owned(format!(r#"id="{}">{}{}"#, id, anchor_link, text))), | |||
InsertAnchor::Right => Event::Html(Owned(format!(r#"id="{}">{}{}"#, id, text, anchor_link))), | |||
InsertAnchor::None => Event::Html(Owned(format!(r#"id="{}">{}"#, id, text))) | |||
}; | |||
return event; | |||
} | |||
// Business as usual | |||
Event::Text(text) | |||
}, | |||
Event::Start(Tag::CodeBlock(ref info)) => { | |||
in_code_block = true; | |||
if !should_highlight { | |||
return Event::Html(Owned("<pre><code>".to_owned())); | |||
} | |||
let theme = &THEME_SET.themes[&context.highlight_theme]; | |||
highlighter = SYNTAX_SET.with(|ss| { | |||
let syntax = info | |||
.split(' ') | |||
.next() | |||
.and_then(|lang| ss.find_syntax_by_token(lang)) | |||
.unwrap_or_else(|| ss.find_syntax_plain_text()); | |||
Some(HighlightLines::new(syntax, theme)) | |||
}); | |||
let snippet = start_coloured_html_snippet(theme); | |||
Event::Html(Owned(snippet)) | |||
}, | |||
Event::End(Tag::CodeBlock(_)) => { | |||
in_code_block = false; | |||
if !should_highlight{ | |||
return Event::Html(Owned("</code></pre>\n".to_owned())) | |||
} | |||
// reset highlight and close the code block | |||
highlighter = None; | |||
Event::Html(Owned("</pre>".to_owned())) | |||
}, | |||
// Need to handle relative links | |||
Event::Start(Tag::Link(ref link, ref title)) => { | |||
if in_header { | |||
return Event::Html(Owned("".to_owned())); | |||
} | |||
if link.starts_with("./") { | |||
match resolve_internal_link(link, context.permalinks) { | |||
Ok(url) => { | |||
return Event::Start(Tag::Link(Owned(url), title.clone())); | |||
}, | |||
Err(_) => { | |||
error = Some(format!("Relative link {} not found.", link).into()); | |||
return Event::Html(Owned("".to_string())); | |||
} | |||
}; | |||
} | |||
Event::Start(Tag::Link(link.clone(), title.clone())) | |||
}, | |||
Event::End(Tag::Link(_, _)) => { | |||
if in_header { | |||
return Event::Html(Owned("".to_owned())); | |||
} | |||
event | |||
} | |||
// need to know when we are in a code block to disable shortcodes in them | |||
Event::Start(Tag::Code) => { | |||
in_code_block = true; | |||
event | |||
}, | |||
Event::End(Tag::Code) => { | |||
in_code_block = false; | |||
event | |||
}, | |||
Event::Start(Tag::Header(num)) => { | |||
in_header = true; | |||
temp_header = TempHeader::new(num); | |||
// ugly eh | |||
Event::Html(Owned(format!("<h{} ", num))) | |||
}, | |||
Event::End(Tag::Header(_)) => { | |||
in_header = false; | |||
header_already_inserted = false; | |||
event | |||
}, | |||
// If we added shortcodes, don't close a paragraph since there's none | |||
Event::End(Tag::Paragraph) => { | |||
if added_shortcode { | |||
added_shortcode = false; | |||
return Event::Html(Owned("".to_owned())); | |||
} | |||
event | |||
}, | |||
// Ignore softbreaks inside shortcodes | |||
Event::SoftBreak => { | |||
if shortcode_block.is_some() { | |||
return Event::Html(Owned("".to_owned())); | |||
} | |||
event | |||
}, | |||
_ => { | |||
// println!("event = {:?}", event); | |||
event | |||
}, | |||
}); | |||
cmark::html::push_html(&mut html, parser); | |||
} | |||
match error { | |||
Some(e) => Err(e), | |||
None => Ok((html.replace("<p></p>", ""), make_table_of_contents(&headers))), | |||
} | |||
} |
@@ -6,7 +6,7 @@ use tera::{Tera, Context}; | |||
use errors::{Result, ResultExt}; | |||
lazy_static!{ | |||
static ref SHORTCODE_RE: Regex = Regex::new(r#"\{(?:%|\{)\s+([[:alnum:]]+?)\(([[:alnum:]]+?="?.+?"?)\)\s+(?:%|\})\}"#).unwrap(); | |||
pub static ref SHORTCODE_RE: Regex = Regex::new(r#"\{(?:%|\{)\s+([[:alnum:]]+?)\(([[:alnum:]]+?="?.+?"?)\)\s+(?:%|\})\}"#).unwrap(); | |||
} | |||
/// A shortcode that has a body | |||
@@ -73,7 +73,7 @@ pub fn render_simple_shortcode(tera: &Tera, name: &str, args: &HashMap<String, S | |||
#[cfg(test)] | |||
mod tests { | |||
use super::{parse_shortcode}; | |||
use super::parse_shortcode; | |||
#[test] | |||
fn can_parse_simple_shortcode_one_arg() { |
@@ -21,7 +21,6 @@ impl Header { | |||
} | |||
} | |||
/// Used in | |||
#[derive(Debug, PartialEq, Clone)] | |||
pub struct TempHeader { | |||
pub level: i32, | |||
@@ -70,7 +69,7 @@ fn find_children(parent_level: i32, start_at: usize, temp_headers: &[TempHeader] | |||
continue; | |||
} | |||
let (end, children) = find_children(h.level, start_at + 1, &temp_headers); | |||
let (end, children) = find_children(h.level, start_at + 1, temp_headers); | |||
headers.push(Header::from_temp_header(h, children)); | |||
// we didn't find any children | |||
@@ -96,7 +95,7 @@ fn find_children(parent_level: i32, start_at: usize, temp_headers: &[TempHeader] | |||
/// Converts the flat temp headers into a nested set of headers | |||
/// representing the hierarchy | |||
pub fn make_table_of_contents(temp_headers: Vec<TempHeader>) -> Vec<Header> { | |||
pub fn make_table_of_contents(temp_headers: &[TempHeader]) -> Vec<Header> { | |||
let mut toc = vec![]; | |||
let mut start_idx = 0; | |||
for (i, h) in temp_headers.iter().enumerate() { | |||
@@ -122,7 +121,7 @@ mod tests { | |||
TempHeader::new(1), | |||
TempHeader::new(1), | |||
]; | |||
let toc = make_table_of_contents(input); | |||
let toc = make_table_of_contents(&input); | |||
assert_eq!(toc.len(), 3); | |||
} | |||
@@ -139,7 +138,7 @@ mod tests { | |||
TempHeader::new(3), | |||
TempHeader::new(3), | |||
]; | |||
let toc = make_table_of_contents(input); | |||
let toc = make_table_of_contents(&input); | |||
assert_eq!(toc.len(), 2); | |||
assert_eq!(toc[0].children.len(), 3); | |||
assert_eq!(toc[1].children.len(), 1); | |||
@@ -158,7 +157,7 @@ mod tests { | |||
TempHeader::new(1), | |||
TempHeader::new(4), | |||
]; | |||
let toc = make_table_of_contents(input); | |||
let toc = make_table_of_contents(&input); | |||
assert_eq!(toc.len(), 5); | |||
assert_eq!(toc[2].children.len(), 1); | |||
assert_eq!(toc[4].children.len(), 1); |
@@ -0,0 +1,286 @@ | |||
extern crate tera; | |||
extern crate front_matter; | |||
extern crate templates; | |||
extern crate rendering; | |||
use std::collections::HashMap; | |||
use tera::Tera; | |||
use front_matter::InsertAnchor; | |||
use templates::GUTENBERG_TERA; | |||
use rendering::{Context, markdown_to_html}; | |||
#[test] | |||
fn can_do_markdown_to_html_simple() { | |||
let tera_ctx = Tera::default(); | |||
let permalinks_ctx = HashMap::new(); | |||
let context = Context::new(&tera_ctx, true, "base16-ocean-dark".to_string(), "", &permalinks_ctx, InsertAnchor::None); | |||
let res = markdown_to_html("hello", &context).unwrap(); | |||
assert_eq!(res.0, "<p>hello</p>\n"); | |||
} | |||
#[test] | |||
fn doesnt_highlight_code_block_with_highlighting_off() { | |||
let tera_ctx = Tera::default(); | |||
let permalinks_ctx = HashMap::new(); | |||
let mut context = Context::new(&tera_ctx, true, "base16-ocean-dark".to_string(), "", &permalinks_ctx, InsertAnchor::None); | |||
context.highlight_code = false; | |||
let res = markdown_to_html("```\n$ gutenberg server\n```", &context).unwrap(); | |||
assert_eq!( | |||
res.0, | |||
"<pre><code>$ gutenberg server\n</code></pre>\n" | |||
); | |||
} | |||
#[test] | |||
fn can_highlight_code_block_no_lang() { | |||
let tera_ctx = Tera::default(); | |||
let permalinks_ctx = HashMap::new(); | |||
let context = Context::new(&tera_ctx, true, "base16-ocean-dark".to_string(), "", &permalinks_ctx, InsertAnchor::None); | |||
let res = markdown_to_html("```\n$ gutenberg server\n$ ping\n```", &context).unwrap(); | |||
assert_eq!( | |||
res.0, | |||
"<pre style=\"background-color:#2b303b\">\n<span style=\"background-color:#2b303b;color:#c0c5ce;\">$ gutenberg server\n</span><span style=\"background-color:#2b303b;color:#c0c5ce;\">$ ping\n</span></pre>" | |||
); | |||
} | |||
#[test] | |||
fn can_highlight_code_block_with_lang() { | |||
let tera_ctx = Tera::default(); | |||
let permalinks_ctx = HashMap::new(); | |||
let context = Context::new(&tera_ctx, true, "base16-ocean-dark".to_string(), "", &permalinks_ctx, InsertAnchor::None); | |||
let res = markdown_to_html("```python\nlist.append(1)\n```", &context).unwrap(); | |||
assert_eq!( | |||
res.0, | |||
"<pre style=\"background-color:#2b303b\">\n<span style=\"background-color:#2b303b;color:#c0c5ce;\">list</span><span style=\"background-color:#2b303b;color:#c0c5ce;\">.</span><span style=\"background-color:#2b303b;color:#bf616a;\">append</span><span style=\"background-color:#2b303b;color:#c0c5ce;\">(</span><span style=\"background-color:#2b303b;color:#d08770;\">1</span><span style=\"background-color:#2b303b;color:#c0c5ce;\">)</span><span style=\"background-color:#2b303b;color:#c0c5ce;\">\n</span></pre>" | |||
); | |||
} | |||
#[test] | |||
fn can_higlight_code_block_with_unknown_lang() { | |||
let tera_ctx = Tera::default(); | |||
let permalinks_ctx = HashMap::new(); | |||
let context = Context::new(&tera_ctx, true, "base16-ocean-dark".to_string(), "", &permalinks_ctx, InsertAnchor::None); | |||
let res = markdown_to_html("```yolo\nlist.append(1)\n```", &context).unwrap(); | |||
// defaults to plain text | |||
assert_eq!( | |||
res.0, | |||
"<pre style=\"background-color:#2b303b\">\n<span style=\"background-color:#2b303b;color:#c0c5ce;\">list.append(1)\n</span></pre>" | |||
); | |||
} | |||
#[test] | |||
fn can_render_shortcode() { | |||
let permalinks_ctx = HashMap::new(); | |||
let context = Context::new(&GUTENBERG_TERA, true, "base16-ocean-dark".to_string(), "", &permalinks_ctx, InsertAnchor::None); | |||
let res = markdown_to_html(r#" | |||
Hello | |||
{{ youtube(id="ub36ffWAqgQ") }} | |||
"#, &context).unwrap(); | |||
assert!(res.0.contains("<p>Hello</p>\n<div >")); | |||
assert!(res.0.contains(r#"<iframe src="https://www.youtube.com/embed/ub36ffWAqgQ""#)); | |||
} | |||
#[test] | |||
fn can_render_several_shortcode_in_row() { | |||
let permalinks_ctx = HashMap::new(); | |||
let context = Context::new(&GUTENBERG_TERA, true, "base16-ocean-dark".to_string(), "", &permalinks_ctx, InsertAnchor::None); | |||
let res = markdown_to_html(r#" | |||
Hello | |||
{{ youtube(id="ub36ffWAqgQ") }} | |||
{{ youtube(id="ub36ffWAqgQ", autoplay=true) }} | |||
{{ vimeo(id="210073083") }} | |||
{{ streamable(id="c0ic") }} | |||
{{ gist(url="https://gist.github.com/Keats/32d26f699dcc13ebd41b") }} | |||
"#, &context).unwrap(); | |||
assert!(res.0.contains("<p>Hello</p>\n<div >")); | |||
assert!(res.0.contains(r#"<iframe src="https://www.youtube.com/embed/ub36ffWAqgQ""#)); | |||
assert!(res.0.contains(r#"<iframe src="https://www.youtube.com/embed/ub36ffWAqgQ?autoplay=1""#)); | |||
assert!(res.0.contains(r#"<iframe src="https://www.streamable.com/e/c0ic""#)); | |||
assert!(res.0.contains(r#"//player.vimeo.com/video/210073083""#)); | |||
} | |||
#[test] | |||
fn doesnt_render_shortcode_in_code_block() { | |||
let permalinks_ctx = HashMap::new(); | |||
let context = Context::new(&GUTENBERG_TERA, true, "base16-ocean-dark".to_string(), "", &permalinks_ctx, InsertAnchor::None); | |||
let res = markdown_to_html(r#"```{{ youtube(id="w7Ft2ymGmfc") }}```"#, &context).unwrap(); | |||
assert_eq!(res.0, "<p><code>{{ youtube(id="w7Ft2ymGmfc") }}</code></p>\n"); | |||
} | |||
#[test] | |||
fn can_render_shortcode_with_body() { | |||
let mut tera = Tera::default(); | |||
tera.extend(&GUTENBERG_TERA).unwrap(); | |||
tera.add_raw_template("shortcodes/quote.html", "<blockquote>{{ body }} - {{ author}}</blockquote>").unwrap(); | |||
let permalinks_ctx = HashMap::new(); | |||
let context = Context::new(&tera, true, "base16-ocean-dark".to_string(), "", &permalinks_ctx, InsertAnchor::None); | |||
let res = markdown_to_html(r#" | |||
Hello | |||
{% quote(author="Keats") %} | |||
A quote | |||
{% end %} | |||
"#, &context).unwrap(); | |||
assert_eq!(res.0, "<p>Hello\n</p><blockquote>A quote - Keats</blockquote>"); | |||
} | |||
#[test] | |||
fn errors_rendering_unknown_shortcode() { | |||
let tera_ctx = Tera::default(); | |||
let permalinks_ctx = HashMap::new(); | |||
let context = Context::new(&tera_ctx, true, "base16-ocean-dark".to_string(), "", &permalinks_ctx, InsertAnchor::None); | |||
let res = markdown_to_html("{{ hello(flash=true) }}", &context); | |||
assert!(res.is_err()); | |||
} | |||
#[test] | |||
fn can_make_valid_relative_link() { | |||
let mut permalinks = HashMap::new(); | |||
permalinks.insert("pages/about.md".to_string(), "https://vincent.is/about".to_string()); | |||
let tera_ctx = Tera::default(); | |||
let context = Context::new(&tera_ctx, true, "base16-ocean-dark".to_string(), "", &permalinks, InsertAnchor::None); | |||
let res = markdown_to_html( | |||
r#"[rel link](./pages/about.md), [abs link](https://vincent.is/about)"#, | |||
&context | |||
).unwrap(); | |||
assert!( | |||
res.0.contains(r#"<p><a href="https://vincent.is/about">rel link</a>, <a href="https://vincent.is/about">abs link</a></p>"#) | |||
); | |||
} | |||
#[test] | |||
fn can_make_relative_links_with_anchors() { | |||
let mut permalinks = HashMap::new(); | |||
permalinks.insert("pages/about.md".to_string(), "https://vincent.is/about".to_string()); | |||
let tera_ctx = Tera::default(); | |||
let context = Context::new(&tera_ctx, true, "base16-ocean-dark".to_string(), "", &permalinks, InsertAnchor::None); | |||
let res = markdown_to_html(r#"[rel link](./pages/about.md#cv)"#, &context).unwrap(); | |||
assert!( | |||
res.0.contains(r#"<p><a href="https://vincent.is/about#cv">rel link</a></p>"#) | |||
); | |||
} | |||
#[test] | |||
fn errors_relative_link_inexistant() { | |||
let tera_ctx = Tera::default(); | |||
let permalinks_ctx = HashMap::new(); | |||
let context = Context::new(&tera_ctx, true, "base16-ocean-dark".to_string(), "", &permalinks_ctx, InsertAnchor::None); | |||
let res = markdown_to_html("[rel link](./pages/about.md)", &context); | |||
assert!(res.is_err()); | |||
} | |||
#[test] | |||
fn can_add_id_to_headers() { | |||
let tera_ctx = Tera::default(); | |||
let permalinks_ctx = HashMap::new(); | |||
let context = Context::new(&tera_ctx, true, "base16-ocean-dark".to_string(), "", &permalinks_ctx, InsertAnchor::None); | |||
let res = markdown_to_html(r#"# Hello"#, &context).unwrap(); | |||
assert_eq!(res.0, "<h1 id=\"hello\">Hello</h1>\n"); | |||
} | |||
#[test] | |||
fn can_add_id_to_headers_same_slug() { | |||
let tera_ctx = Tera::default(); | |||
let permalinks_ctx = HashMap::new(); | |||
let context = Context::new(&tera_ctx, true, "base16-ocean-dark".to_string(), "", &permalinks_ctx, InsertAnchor::None); | |||
let res = markdown_to_html("# Hello\n# Hello", &context).unwrap(); | |||
assert_eq!(res.0, "<h1 id=\"hello\">Hello</h1>\n<h1 id=\"hello-1\">Hello</h1>\n"); | |||
} | |||
#[test] | |||
fn can_insert_anchor_left() { | |||
let permalinks_ctx = HashMap::new(); | |||
let context = Context::new(&GUTENBERG_TERA, true, "base16-ocean-dark".to_string(), "", &permalinks_ctx, InsertAnchor::Left); | |||
let res = markdown_to_html("# Hello", &context).unwrap(); | |||
assert_eq!( | |||
res.0, | |||
"<h1 id=\"hello\"><a class=\"gutenberg-anchor\" href=\"#hello\" aria-label=\"Anchor link for: hello\">đź”—</a>\nHello</h1>\n" | |||
); | |||
} | |||
#[test] | |||
fn can_insert_anchor_right() { | |||
let permalinks_ctx = HashMap::new(); | |||
let context = Context::new(&GUTENBERG_TERA, true, "base16-ocean-dark".to_string(), "", &permalinks_ctx, InsertAnchor::Right); | |||
let res = markdown_to_html("# Hello", &context).unwrap(); | |||
assert_eq!( | |||
res.0, | |||
"<h1 id=\"hello\">Hello<a class=\"gutenberg-anchor\" href=\"#hello\" aria-label=\"Anchor link for: hello\">đź”—</a>\n</h1>\n" | |||
); | |||
} | |||
// See https://github.com/Keats/gutenberg/issues/42 | |||
#[test] | |||
fn can_insert_anchor_with_exclamation_mark() { | |||
let permalinks_ctx = HashMap::new(); | |||
let context = Context::new(&GUTENBERG_TERA, true, "base16-ocean-dark".to_string(), "", &permalinks_ctx, InsertAnchor::Left); | |||
let res = markdown_to_html("# Hello!", &context).unwrap(); | |||
assert_eq!( | |||
res.0, | |||
"<h1 id=\"hello\"><a class=\"gutenberg-anchor\" href=\"#hello\" aria-label=\"Anchor link for: hello\">đź”—</a>\nHello!</h1>\n" | |||
); | |||
} | |||
// See https://github.com/Keats/gutenberg/issues/53 | |||
#[test] | |||
fn can_insert_anchor_with_link() { | |||
let permalinks_ctx = HashMap::new(); | |||
let context = Context::new(&GUTENBERG_TERA, true, "base16-ocean-dark".to_string(), "", &permalinks_ctx, InsertAnchor::Left); | |||
let res = markdown_to_html("## [](#xresources)Xresources", &context).unwrap(); | |||
assert_eq!( | |||
res.0, | |||
"<h2 id=\"xresources\"><a class=\"gutenberg-anchor\" href=\"#xresources\" aria-label=\"Anchor link for: xresources\">đź”—</a>\nXresources</h2>\n" | |||
); | |||
} | |||
#[test] | |||
fn can_insert_anchor_with_other_special_chars() { | |||
let permalinks_ctx = HashMap::new(); | |||
let context = Context::new(&GUTENBERG_TERA, true, "base16-ocean-dark".to_string(), "", &permalinks_ctx, InsertAnchor::Left); | |||
let res = markdown_to_html("# Hello*_()", &context).unwrap(); | |||
assert_eq!( | |||
res.0, | |||
"<h1 id=\"hello\"><a class=\"gutenberg-anchor\" href=\"#hello\" aria-label=\"Anchor link for: hello\">đź”—</a>\nHello*_()</h1>\n" | |||
); | |||
} | |||
#[test] | |||
fn can_make_toc() { | |||
let permalinks_ctx = HashMap::new(); | |||
let context = Context::new( | |||
&GUTENBERG_TERA, | |||
true, | |||
"base16-ocean-dark".to_string(), | |||
"https://mysite.com/something", | |||
&permalinks_ctx, | |||
InsertAnchor::Left | |||
); | |||
let res = markdown_to_html(r#" | |||
# Header 1 | |||
## Header 2 | |||
## Another Header 2 | |||
### Last one | |||
"#, &context).unwrap(); | |||
let toc = res.1; | |||
assert_eq!(toc.len(), 1); | |||
assert_eq!(toc[0].children.len(), 2); | |||
assert_eq!(toc[0].children[1].children.len(), 1); | |||
} |
@@ -0,0 +1,852 @@ | |||
[root] | |||
name = "site" | |||
version = "0.1.0" | |||
dependencies = [ | |||
"config 0.1.0", | |||
"content 0.1.0", | |||
"errors 0.1.0", | |||
"front_matter 0.1.0", | |||
"glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"pagination 0.1.0", | |||
"rayon 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"taxonomies 0.1.0", | |||
"tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"templates 0.1.0", | |||
"tera 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"utils 0.1.0", | |||
"walkdir 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "aho-corasick" | |||
version = "0.6.3" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "backtrace" | |||
version = "0.3.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"backtrace-sys 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"cfg-if 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"dbghelp-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"rustc-demangle 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "backtrace-sys" | |||
version = "0.1.11" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "base64" | |||
version = "0.5.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "base64" | |||
version = "0.6.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "bincode" | |||
version = "0.8.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "bitflags" | |||
version = "0.7.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "bitflags" | |||
version = "0.8.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "bitflags" | |||
version = "0.9.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "byteorder" | |||
version = "1.0.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "cfg-if" | |||
version = "0.1.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "chrono" | |||
version = "0.3.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"num 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "chrono" | |||
version = "0.4.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"num 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "cmake" | |||
version = "0.1.24" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "coco" | |||
version = "0.1.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"either 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"scopeguard 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "config" | |||
version = "0.1.0" | |||
dependencies = [ | |||
"errors 0.1.0", | |||
"rendering 0.1.0", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"toml 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "content" | |||
version = "0.1.0" | |||
dependencies = [ | |||
"config 0.1.0", | |||
"errors 0.1.0", | |||
"front_matter 0.1.0", | |||
"rayon 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"rendering 0.1.0", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"slug 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"tera 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"utils 0.1.0", | |||
] | |||
[[package]] | |||
name = "dbghelp-sys" | |||
version = "0.2.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "dtoa" | |||
version = "0.4.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "either" | |||
version = "1.1.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "error-chain" | |||
version = "0.10.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"backtrace 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "errors" | |||
version = "0.1.0" | |||
dependencies = [ | |||
"error-chain 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"tera 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"toml 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "flate2" | |||
version = "0.2.19" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"miniz-sys 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "fnv" | |||
version = "1.0.5" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "front_matter" | |||
version = "0.1.0" | |||
dependencies = [ | |||
"chrono 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"errors 0.1.0", | |||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"tera 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"toml 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "futures" | |||
version = "0.1.14" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "gcc" | |||
version = "0.3.51" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "getopts" | |||
version = "0.2.14" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "glob" | |||
version = "0.2.11" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "humansize" | |||
version = "1.0.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "idna" | |||
version = "0.1.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"unicode-bidi 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"unicode-normalization 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "itoa" | |||
version = "0.3.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "kernel32-sys" | |||
version = "0.2.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "lazy_static" | |||
version = "0.2.8" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "libc" | |||
version = "0.2.24" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "matches" | |||
version = "0.1.6" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "memchr" | |||
version = "1.0.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "miniz-sys" | |||
version = "0.1.9" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "num" | |||
version = "0.1.39" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"num-integer 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"num-iter 0.1.33 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "num-integer" | |||
version = "0.1.34" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "num-iter" | |||
version = "0.1.33" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"num-integer 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "num-traits" | |||
version = "0.1.39" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "num_cpus" | |||
version = "1.6.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "onig" | |||
version = "1.3.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"onig_sys 63.0.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "onig_sys" | |||
version = "63.0.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"cmake 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "pagination" | |||
version = "0.1.0" | |||
dependencies = [ | |||
"config 0.1.0", | |||
"content 0.1.0", | |||
"errors 0.1.0", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"tera 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "percent-encoding" | |||
version = "1.0.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "pest" | |||
version = "0.4.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "pkg-config" | |||
version = "0.3.9" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "plist" | |||
version = "0.2.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"base64 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"chrono 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"xml-rs 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "pulldown-cmark" | |||
version = "0.0.15" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "quote" | |||
version = "0.3.15" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "rand" | |||
version = "0.3.15" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "rayon" | |||
version = "0.8.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"rayon-core 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "rayon-core" | |||
version = "1.2.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"coco 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"num_cpus 1.6.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "redox_syscall" | |||
version = "0.1.19" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "regex" | |||
version = "0.2.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"aho-corasick 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"regex-syntax 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"thread_local 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "regex-syntax" | |||
version = "0.4.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "rendering" | |||
version = "0.1.0" | |||
dependencies = [ | |||
"errors 0.1.0", | |||
"front_matter 0.1.0", | |||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"pulldown-cmark 0.0.15 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"slug 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"syntect 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"tera 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"utils 0.1.0", | |||
] | |||
[[package]] | |||
name = "rustc-demangle" | |||
version = "0.1.4" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "safemem" | |||
version = "0.2.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "same-file" | |||
version = "0.1.3" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "scopeguard" | |||
version = "0.3.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "serde" | |||
version = "1.0.9" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "serde_derive" | |||
version = "1.0.9" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_derive_internals 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "serde_derive_internals" | |||
version = "0.15.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "serde_json" | |||
version = "1.0.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"dtoa 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"itoa 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "slug" | |||
version = "0.1.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"unidecode 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "syn" | |||
version = "0.11.11" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "synom" | |||
version = "0.11.3" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "syntect" | |||
version = "1.7.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"bincode 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"bitflags 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"flate2 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"onig 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"plist 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"regex-syntax 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"walkdir 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"yaml-rust 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "taxonomies" | |||
version = "0.1.0" | |||
dependencies = [ | |||
"config 0.1.0", | |||
"content 0.1.0", | |||
"errors 0.1.0", | |||
"front_matter 0.1.0", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"slug 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"tera 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "tempdir" | |||
version = "0.3.5" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "templates" | |||
version = "0.1.0" | |||
dependencies = [ | |||
"base64 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"content 0.1.0", | |||
"errors 0.1.0", | |||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"pulldown-cmark 0.0.15 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"tera 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"utils 0.1.0", | |||
] | |||
[[package]] | |||
name = "tera" | |||
version = "0.10.8" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"chrono 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"error-chain 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"humansize 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"pest 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"slug 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"url 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "thread_local" | |||
version = "0.3.4" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "time" | |||
version = "0.1.37" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"redox_syscall 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "toml" | |||
version = "0.4.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "unicode-bidi" | |||
version = "0.3.3" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "unicode-normalization" | |||
version = "0.1.5" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "unicode-xid" | |||
version = "0.0.4" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "unidecode" | |||
version = "0.2.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "unreachable" | |||
version = "1.0.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "url" | |||
version = "1.5.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"idna 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"percent-encoding 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "utf8-ranges" | |||
version = "1.0.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "utils" | |||
version = "0.1.0" | |||
dependencies = [ | |||
"errors 0.1.0", | |||
] | |||
[[package]] | |||
name = "void" | |||
version = "1.0.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "walkdir" | |||
version = "1.0.7" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"same-file 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "winapi" | |||
version = "0.2.8" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "winapi-build" | |||
version = "0.1.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "xml-rs" | |||
version = "0.4.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "yaml-rust" | |||
version = "0.3.5" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[metadata] | |||
"checksum aho-corasick 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "500909c4f87a9e52355b26626d890833e9e1d53ac566db76c36faa984b889699" | |||
"checksum backtrace 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "72f9b4182546f4b04ebc4ab7f84948953a118bd6021a1b6a6c909e3e94f6be76" | |||
"checksum backtrace-sys 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "3a0d842ea781ce92be2bf78a9b38883948542749640b8378b3b2f03d1fd9f1ff" | |||
"checksum base64 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "30e93c03064e7590d0466209155251b90c22e37fab1daf2771582598b5827557" | |||
"checksum base64 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "96434f987501f0ed4eb336a411e0631ecd1afa11574fe148587adc4ff96143c9" | |||
"checksum bincode 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e103c8b299b28a9c6990458b7013dc4a8356a9b854c51b9883241f5866fac36e" | |||
"checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d" | |||
"checksum bitflags 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1370e9fc2a6ae53aea8b7a5110edbd08836ed87c88736dfabccade1c2b44bff4" | |||
"checksum bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5" | |||
"checksum byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c40977b0ee6b9885c9013cd41d9feffdd22deb3bb4dc3a71d901cc7a77de18c8" | |||
"checksum cfg-if 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d0c47d456a36ebf0536a6705c83c1cbbcb9255fbc1d905a6ded104f479268a29" | |||
"checksum chrono 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "158b0bd7d75cbb6bf9c25967a48a2e9f77da95876b858eadfabaa99cd069de6e" | |||
"checksum chrono 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7c20ebe0b2b08b0aeddba49c609fe7957ba2e33449882cb186a180bc60682fa9" | |||
"checksum cmake 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)" = "b8ebbb35d3dc9cd09497168f33de1acb79b265d350ab0ac34133b98f8509af1f" | |||
"checksum coco 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c06169f5beb7e31c7c67ebf5540b8b472d23e3eade3b2ec7d1f5b504a85f91bd" | |||
"checksum dbghelp-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "97590ba53bcb8ac28279161ca943a924d1fd4a8fb3fa63302591647c4fc5b850" | |||
"checksum dtoa 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "80c8b71fd71146990a9742fc06dcbbde19161a267e0ad4e572c35162f4578c90" | |||
"checksum either 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "18785c1ba806c258137c937e44ada9ee7e69a37e3c72077542cd2f069d78562a" | |||
"checksum error-chain 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d9435d864e017c3c6afeac1654189b06cdb491cf2ff73dbf0d73b0f292f42ff8" | |||
"checksum flate2 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)" = "36df0166e856739905cd3d7e0b210fe818592211a008862599845e012d8d304c" | |||
"checksum fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6cc484842f1e2884faf56f529f960cc12ad8c71ce96cc7abba0a067c98fee344" | |||
"checksum futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "4b63a4792d4f8f686defe3b39b92127fea6344de5d38202b2ee5a11bbbf29d6a" | |||
"checksum gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)" = "120d07f202dcc3f72859422563522b66fe6463a4c513df062874daad05f85f0a" | |||
"checksum getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9047cfbd08a437050b363d35ef160452c5fe8ea5187ae0a624708c91581d685" | |||
"checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb" | |||
"checksum humansize 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "92d211e6e70b05749dce515b47684f29a3c8c38bbbb21c50b30aff9eca1b0bd3" | |||
"checksum idna 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2233d4940b1f19f0418c158509cd7396b8d70a5db5705ce410914dc8fa603b37" | |||
"checksum itoa 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "eb2f404fbc66fd9aac13e998248505e7ecb2ad8e44ab6388684c5fb11c6c251c" | |||
"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" | |||
"checksum lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3b37545ab726dd833ec6420aaba8231c5b320814b9029ad585555d2a03e94fbf" | |||
"checksum libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)" = "38f5c2b18a287cf78b4097db62e20f43cace381dc76ae5c0a3073067f78b7ddc" | |||
"checksum matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "100aabe6b8ff4e4a7e32c1c13523379802df0772b82466207ac25b013f193376" | |||
"checksum memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1dbccc0e46f1ea47b9f17e6d67c5a96bd27030519c519c9c91327e31275a47b4" | |||
"checksum miniz-sys 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "28eaee17666671fa872e567547e8428e83308ebe5808cdf6a0e28397dbe2c726" | |||
"checksum num 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "2c3a3dc9f30bf824141521b30c908a859ab190b76e20435fcd89f35eb6583887" | |||
"checksum num-integer 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)" = "ef1a4bf6f9174aa5783a9b4cc892cacd11aebad6c69ad027a0b65c6ca5f8aa37" | |||
"checksum num-iter 0.1.33 (registry+https://github.com/rust-lang/crates.io-index)" = "f7d1891bd7b936f12349b7d1403761c8a0b85a18b148e9da4429d5d102c1a41e" | |||
"checksum num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "1708c0628602a98b52fad936cf3edb9a107af06e52e49fdf0707e884456a6af6" | |||
"checksum num_cpus 1.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "aec53c34f2d0247c5ca5d32cca1478762f301740468ee9ee6dcb7a0dd7a0c584" | |||
"checksum onig 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee619da9cf707b167098e84fb00f10db61d5a662d1d29b59822bcac3a81553dd" | |||
"checksum onig_sys 63.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "531682ab45a2cd40eff91f29340dae975f25336d2b61e624adabed39e61d7fb3" | |||
"checksum percent-encoding 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "de154f638187706bde41d9b4738748933d64e6b37bdbffc0b47a97d16a6ae356" | |||
"checksum pest 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3e2e823a5967bb4cdc6d3e46f47baaf4ecfeae44413a642b74ad44e59e49c7f6" | |||
"checksum pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "3a8b4c6b8165cd1a1cd4b9b120978131389f64bdaf456435caa41e630edba903" | |||
"checksum plist 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1e2f7e9574aabcf57bc5e9f602caabdffffa8179b0c130a039f7895fea3dbdb5" | |||
"checksum pulldown-cmark 0.0.15 (registry+https://github.com/rust-lang/crates.io-index)" = "378e941dbd392c101f2cb88097fa4d7167bc421d4b88de3ff7dbee503bc3233b" | |||
"checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a" | |||
"checksum rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "022e0636ec2519ddae48154b028864bdce4eaf7d35226ab8e65c611be97b189d" | |||
"checksum rayon 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b614fe08b6665cb9a231d07ac1364b0ef3cb3698f1239ee0c4c3a88a524f54c8" | |||
"checksum rayon-core 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7febc28567082c345f10cddc3612c6ea020fc3297a1977d472cf9fdb73e6e493" | |||
"checksum redox_syscall 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)" = "e4a357d14a12e90a37d658725df0e6468504750b5948b9710f83f94a0c5818e8" | |||
"checksum regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1731164734096285ec2a5ec7fea5248ae2f5485b3feeb0115af4fda2183b2d1b" | |||
"checksum regex-syntax 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ad890a5eef7953f55427c50575c680c42841653abd2b028b68cd223d157f62db" | |||
"checksum rustc-demangle 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3058a43ada2c2d0b92b3ae38007a2d0fa5e9db971be260e0171408a4ff471c95" | |||
"checksum safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e27a8b19b835f7aea908818e871f5cc3a5a186550c30773be987e155e8163d8f" | |||
"checksum same-file 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d931a44fdaa43b8637009e7632a02adc4f2b2e0733c08caa4cf00e8da4a117a7" | |||
"checksum scopeguard 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c79eb2c3ac4bc2507cda80e7f3ac5b88bd8eae4c0914d5663e6a8933994be918" | |||
"checksum serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)" = "6a7c6b751a2e8d5df57a5ff71b5b4fc8aaee9ee28ff1341d640dd130bb5f4f7a" | |||
"checksum serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)" = "2f6ca58905ebd3c3b285a8a6d4f3ac92b92c0d7951d5649b1bdd212549c06639" | |||
"checksum serde_derive_internals 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)" = "37aee4e0da52d801acfbc0cc219eb1eda7142112339726e427926a6f6ee65d3a" | |||
"checksum serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "48b04779552e92037212c3615370f6bd57a40ebba7f20e554ff9f55e41a69a7b" | |||
"checksum slug 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f6f5ff4b43cb07b86c5f9236c92714a22cdf9e5a27a7d85e398e2c9403328cb8" | |||
"checksum syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad" | |||
"checksum synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a393066ed9010ebaed60b9eafa373d4b1baac186dd7e008555b0f702b51945b6" | |||
"checksum syntect 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2f436345e5b6ebbfdf51b20b95cd9bcb82576262c340bad9cf815078d76b082a" | |||
"checksum tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "87974a6f5c1dfb344d733055601650059a3363de2a6104819293baff662132d6" | |||
"checksum tera 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)" = "62736a6d748fd2c5a8b4be21010e37d79f78aea3c2e07a9e13ff5c70864a3129" | |||
"checksum thread_local 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "1697c4b57aeeb7a536b647165a2825faddffb1d3bad386d507709bd51a90bb14" | |||
"checksum time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)" = "ffd7ccbf969a892bf83f1e441126968a07a3941c24ff522a26af9f9f4585d1a3" | |||
"checksum toml 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b0601da6c97135c8d330c7a13a013ca6cd4143221b01de2f8d4edc50a9e551c7" | |||
"checksum unicode-bidi 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a6a2c4e3710edd365cd7e78383153ed739fa31af19f9172f72d3575060f5a43a" | |||
"checksum unicode-normalization 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "51ccda9ef9efa3f7ef5d91e8f9b83bbe6955f9bf86aec89d5cce2c874625920f" | |||
"checksum unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc" | |||
"checksum unidecode 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d2adb95ee07cd579ed18131f2d9e7a17c25a4b76022935c7f2460d2bfae89fd2" | |||
"checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" | |||
"checksum url 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "eeb819346883532a271eb626deb43c4a1bb4c4dd47c519bd78137c3e72a4fe27" | |||
"checksum utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "662fab6525a98beff2921d7f61a39e7d59e0b425ebc7d0d9e66d316e55124122" | |||
"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" | |||
"checksum walkdir 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "bb08f9e670fab86099470b97cd2b252d6527f0b3cc1401acdb595ffc9dd288ff" | |||
"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" | |||
"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" | |||
"checksum xml-rs 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b46ee689ba7a669c08a1170c2348d2516c62dc461135c9e86b2f1f476e07be4a" | |||
"checksum yaml-rust 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e66366e18dc58b46801afbf2ca7661a9f59cc8c5962c29892b6039b4f86fa992" |
@@ -0,0 +1,27 @@ | |||
[package] | |||
name = "site" | |||
version = "0.1.0" | |||
authors = ["Vincent Prouillet <vincent@wearewizards.io>"] | |||
[dependencies] | |||
tera = "0.10" | |||
glob = "0.2" | |||
walkdir = "1" | |||
rayon = "0.8" | |||
serde = "1.0" | |||
serde_derive = "1.0" | |||
sass-rs = "0.1" | |||
#sass-rs = { git = "https://github.com/compass-rs/sass-rs.git" } | |||
errors = { path = "../errors" } | |||
config = { path = "../config" } | |||
utils = { path = "../utils" } | |||
templates = { path = "../templates" } | |||
front_matter = { path = "../front_matter" } | |||
pagination = { path = "../pagination" } | |||
taxonomies = { path = "../taxonomies" } | |||
content = { path = "../content" } | |||
[dev-dependencies] | |||
tempdir = "0.3" |
@@ -0,0 +1,168 @@ | |||
""" | |||
Generates test sites for use in benchmark. | |||
Tested with python3 and probably does not work on Windows. | |||
""" | |||
import datetime | |||
import os | |||
import random | |||
import shutil | |||
TAGS = ["a", "b", "c", "d", "e", "f", "g"] | |||
CATEGORIES = ["c1", "c2", "c3", "c4"] | |||
PAGE = """ | |||
+++ | |||
title = "Hello" | |||
date = "REPLACE_DATE" | |||
tags = REPLACE_TAG | |||
category = "REPLACE_CATEGORY" | |||
+++ | |||
# Modus cognitius profanam ne duae virtutis mundi | |||
## Ut vita | |||
Lorem markdownum litora, care ponto nomina, et ut aspicit gelidas sui et | |||
purpureo genuit. Tamen colla venientis [delphina](http://nil-sol.com/ecquis) | |||
Tusci et temptata citaeque curam isto ubi vult vulnere reppulit. | |||
- Seque vidit flendoque de quodam | |||
- Dabit minimos deiecto caputque noctis pluma | |||
- Leti coniunx est Helicen | |||
- Illius pulvereumque Icare inpositos | |||
- Vivunt pereo pluvio tot ramos Olenios gelidis | |||
- Quater teretes natura inde | |||
### A subsection | |||
Protinus dicunt, breve per, et vivacis genus Orphei munere. Me terram [dimittere | |||
casside](http://corpus.org/) pervenit saxo primoque frequentat genuum sorori | |||
praeferre causas Libys. Illud in serpit adsuetam utrimque nunc haberent, | |||
**terrae si** veni! Hectoreis potes sumite [Mavortis retusa](http://tua.org/) | |||
granum captantur potuisse Minervae, frugum. | |||
> Clivo sub inprovisoque nostrum minus fama est, discordia patrem petebat precatur | |||
absumitur, poena per sit. Foramina *tamen cupidine* memor supplex tollentes | |||
dictum unam orbem, Anubis caecae. Viderat formosior tegebat satis, Aethiopasque | |||
sit submisso coniuge tristis ubi! | |||
## Praeceps Corinthus totidem quem crus vultum cape | |||
```rs | |||
#[derive(Debug)] | |||
pub struct Site { | |||
/// The base path of the gutenberg site | |||
pub base_path: PathBuf, | |||
/// The parsed config for the site | |||
pub config: Config, | |||
pub pages: HashMap<PathBuf, Page>, | |||
pub sections: HashMap<PathBuf, Section>, | |||
pub tera: Tera, | |||
live_reload: bool, | |||
output_path: PathBuf, | |||
static_path: PathBuf, | |||
pub tags: Option<Taxonomy>, | |||
pub categories: Option<Taxonomy>, | |||
/// A map of all .md files (section and pages) and their permalink | |||
/// We need that if there are relative links in the content that need to be resolved | |||
pub permalinks: HashMap<String, String>, | |||
} | |||
``` | |||
## More stuff | |||
And a shortcode: | |||
{{ youtube(id="my_youtube_id") }} | |||
### Another subsection | |||
Gotta make the toc do a little bit of work | |||
# A big title | |||
- hello | |||
- world | |||
- ! | |||
```py | |||
if __name__ == "__main__": | |||
gen_site("basic-blog", [""], 250, paginate=True) | |||
``` | |||
""" | |||
def gen_skeleton(name, is_blog): | |||
if os.path.exists(name): | |||
shutil.rmtree(name) | |||
os.makedirs(os.path.join(name, "content")) | |||
os.makedirs(os.path.join(name, "static")) | |||
with open(os.path.join(name, "config.toml"), "w") as f: | |||
if is_blog: | |||
f.write(""" | |||
title = "My site" | |||
base_url = "https://replace-this-with-your-url.com" | |||
generate_tags_pages = true | |||
generate_categories_pages = true | |||
[extra.author] | |||
name = "Vincent Prouillet" | |||
""") | |||
else: | |||
f.write(""" | |||
title = "My site" | |||
base_url = "https://replace-this-with-your-url.com" | |||
[extra.author] | |||
name = "Vincent Prouillet" | |||
""") | |||
# Re-use the test templates | |||
shutil.copytree("../test_site/templates", os.path.join(name, "templates")) | |||
def gen_section(path, num_pages, is_blog): | |||
with open(os.path.join(path, "_index.md"), "w") as f: | |||
if is_blog: | |||
f.write(""" | |||
+++ | |||
paginate_by = 5 | |||
sort_by = "date" | |||
template = "section_paginated.html" | |||
+++ | |||
""") | |||
else: | |||
f.write("+++\n+++\n") | |||
day = datetime.date.today() | |||
for (i, page) in enumerate(range(0, num_pages)): | |||
with open(os.path.join(path, "page-{}.md".format(i)), "w") as f: | |||
f.write( | |||
PAGE | |||
.replace("REPLACE_DATE", str(day + datetime.timedelta(days=1))) | |||
.replace("REPLACE_CATEGORY", random.choice(CATEGORIES)) | |||
.replace("REPLACE_TAG", str([random.choice(TAGS), random.choice(TAGS)])) | |||
) | |||
def gen_site(name, sections, num_pages_per_section, is_blog=False): | |||
gen_skeleton(name, is_blog) | |||
for section in sections: | |||
path = os.path.join(name, "content", section) if section else os.path.join(name, "content") | |||
if section: | |||
os.makedirs(path) | |||
gen_section(path, num_pages_per_section, is_blog) | |||
if __name__ == "__main__": | |||
gen_site("small-blog", [""], 30, is_blog=True) | |||
gen_site("medium-blog", [""], 250, is_blog=True) | |||
gen_site("big-blog", [""], 1000, is_blog=True) | |||
gen_site("huge-blog", [""], 10000, is_blog=True) | |||
gen_site("small-kb", ["help", "help1", "help2", "help3", "help4", "help5", "help6", "help7", "help8", "help9"], 10) | |||
gen_site("medium-kb", ["help", "help1", "help2", "help3", "help4", "help5", "help6", "help7", "help8", "help9"], 100) | |||
gen_site("huge-kb", ["help", "help1", "help2", "help3", "help4", "help5", "help6", "help7", "help8", "help9"], 1000) |
@@ -0,0 +1,157 @@ | |||
//! Benchmarking loading/markdown rendering of generated sites of various sizes | |||
#![feature(test)] | |||
extern crate test; | |||
extern crate site; | |||
use std::env; | |||
use site::Site; | |||
#[bench] | |||
fn bench_loading_small_blog(b: &mut test::Bencher) { | |||
let mut path = env::current_dir().unwrap().to_path_buf(); | |||
path.push("benches"); | |||
path.push("small-blog"); | |||
let mut site = Site::new(&path, "config.toml").unwrap(); | |||
b.iter(|| site.load().unwrap()); | |||
} | |||
#[bench] | |||
fn bench_loading_small_blog_with_syntax_highlighting(b: &mut test::Bencher) { | |||
let mut path = env::current_dir().unwrap().to_path_buf(); | |||
path.push("benches"); | |||
path.push("small-blog"); | |||
let mut site = Site::new(&path, "config.toml").unwrap(); | |||
site.config.highlight_code = Some(true); | |||
b.iter(|| site.load().unwrap()); | |||
} | |||
#[bench] | |||
fn bench_loading_medium_blog(b: &mut test::Bencher) { | |||
let mut path = env::current_dir().unwrap().to_path_buf(); | |||
path.push("benches"); | |||
path.push("medium-blog"); | |||
let mut site = Site::new(&path, "config.toml").unwrap(); | |||
b.iter(|| site.load().unwrap()); | |||
} | |||
#[bench] | |||
fn bench_loading_medium_blog_with_syntax_highlighting(b: &mut test::Bencher) { | |||
let mut path = env::current_dir().unwrap().to_path_buf(); | |||
path.push("benches"); | |||
path.push("medium-blog"); | |||
let mut site = Site::new(&path, "config.toml").unwrap(); | |||
site.config.highlight_code = Some(true); | |||
b.iter(|| site.load().unwrap()); | |||
} | |||
#[bench] | |||
fn bench_loading_big_blog(b: &mut test::Bencher) { | |||
let mut path = env::current_dir().unwrap().to_path_buf(); | |||
path.push("benches"); | |||
path.push("big-blog"); | |||
let mut site = Site::new(&path, "config.toml").unwrap(); | |||
b.iter(|| site.load().unwrap()); | |||
} | |||
#[bench] | |||
fn bench_loading_big_blog_with_syntax_highlighting(b: &mut test::Bencher) { | |||
let mut path = env::current_dir().unwrap().to_path_buf(); | |||
path.push("benches"); | |||
path.push("big-blog"); | |||
let mut site = Site::new(&path, "config.toml").unwrap(); | |||
site.config.highlight_code = Some(true); | |||
b.iter(|| site.load().unwrap()); | |||
} | |||
//#[bench] | |||
//fn bench_loading_huge_blog(b: &mut test::Bencher) { | |||
// let mut path = env::current_dir().unwrap().to_path_buf(); | |||
// path.push("benches"); | |||
// path.push("huge-blog"); | |||
// let mut site = Site::new(&path, "config.toml").unwrap(); | |||
// | |||
// b.iter(|| site.load().unwrap()); | |||
//} | |||
// | |||
//#[bench] | |||
//fn bench_loading_huge_blog_with_syntax_highlighting(b: &mut test::Bencher) { | |||
// let mut path = env::current_dir().unwrap().to_path_buf(); | |||
// path.push("benches"); | |||
// path.push("huge-blog"); | |||
// let mut site = Site::new(&path, "config.toml").unwrap(); | |||
// site.config.highlight_code = Some(true); | |||
// | |||
// b.iter(|| site.load().unwrap()); | |||
//} | |||
#[bench] | |||
fn bench_loading_small_kb(b: &mut test::Bencher) { | |||
let mut path = env::current_dir().unwrap().to_path_buf(); | |||
path.push("benches"); | |||
path.push("small-kb"); | |||
let mut site = Site::new(&path, "config.toml").unwrap(); | |||
b.iter(|| site.load().unwrap()); | |||
} | |||
#[bench] | |||
fn bench_loading_small_kb_with_syntax_highlighting(b: &mut test::Bencher) { | |||
let mut path = env::current_dir().unwrap().to_path_buf(); | |||
path.push("benches"); | |||
path.push("small-kb"); | |||
let mut site = Site::new(&path, "config.toml").unwrap(); | |||
site.config.highlight_code = Some(true); | |||
b.iter(|| site.load().unwrap()); | |||
} | |||
#[bench] | |||
fn bench_loading_medium_kb(b: &mut test::Bencher) { | |||
let mut path = env::current_dir().unwrap().to_path_buf(); | |||
path.push("benches"); | |||
path.push("medium-kb"); | |||
let mut site = Site::new(&path, "config.toml").unwrap(); | |||
b.iter(|| site.load().unwrap()); | |||
} | |||
#[bench] | |||
fn bench_loading_medium_kb_with_syntax_highlighting(b: &mut test::Bencher) { | |||
let mut path = env::current_dir().unwrap().to_path_buf(); | |||
path.push("benches"); | |||
path.push("medium-kb"); | |||
let mut site = Site::new(&path, "config.toml").unwrap(); | |||
site.config.highlight_code = Some(true); | |||
b.iter(|| site.load().unwrap()); | |||
} | |||
//#[bench] | |||
//fn bench_loading_huge_kb(b: &mut test::Bencher) { | |||
// let mut path = env::current_dir().unwrap().to_path_buf(); | |||
// path.push("benches"); | |||
// path.push("huge-kb"); | |||
// let mut site = Site::new(&path, "config.toml").unwrap(); | |||
// | |||
// b.iter(|| site.load().unwrap()); | |||
//} | |||
// | |||
//#[bench] | |||
//fn bench_loading_huge_kb_with_syntax_highlighting(b: &mut test::Bencher) { | |||
// let mut path = env::current_dir().unwrap().to_path_buf(); | |||
// path.push("benches"); | |||
// path.push("huge-kb"); | |||
// let mut site = Site::new(&path, "config.toml").unwrap(); | |||
// site.config.highlight_code = Some(true); | |||
// | |||
// b.iter(|| site.load().unwrap()); | |||
//} |
@@ -0,0 +1,83 @@ | |||
//! Benchmarking writing down on the hard drive sites of various sizes | |||
#![feature(test)] | |||
extern crate test; | |||
extern crate site; | |||
extern crate tempdir; | |||
use std::env; | |||
use site::Site; | |||
use tempdir::TempDir; | |||
#[bench] | |||
fn bench_rendering_small_blog(b: &mut test::Bencher) { | |||
let mut path = env::current_dir().unwrap().to_path_buf(); | |||
path.push("benches"); | |||
path.push("small-blog"); | |||
let mut site = Site::new(&path, "config.toml").unwrap(); | |||
let tmp_dir = TempDir::new("example").expect("create temp dir"); | |||
let public = &tmp_dir.path().join("public"); | |||
site.set_output_path(&public); | |||
site.load().unwrap(); | |||
b.iter(|| site.build().unwrap()); | |||
} | |||
#[bench] | |||
fn bench_rendering_medium_blog(b: &mut test::Bencher) { | |||
let mut path = env::current_dir().unwrap().to_path_buf(); | |||
path.push("benches"); | |||
path.push("medium-blog"); | |||
let mut site = Site::new(&path, "config.toml").unwrap(); | |||
let tmp_dir = TempDir::new("example").expect("create temp dir"); | |||
let public = &tmp_dir.path().join("public"); | |||
site.set_output_path(&public); | |||
site.load().unwrap(); | |||
b.iter(|| site.build().unwrap()); | |||
} | |||
//#[bench] | |||
//fn bench_rendering_big_blog(b: &mut test::Bencher) { | |||
// let mut path = env::current_dir().unwrap().to_path_buf(); | |||
// path.push("benches"); | |||
// path.push("big-blog"); | |||
// let mut site = Site::new(&path, "config.toml").unwrap(); | |||
// let tmp_dir = TempDir::new("example").expect("create temp dir"); | |||
// let public = &tmp_dir.path().join("public"); | |||
// site.set_output_path(&public); | |||
// site.load().unwrap(); | |||
// | |||
// b.iter(|| site.build().unwrap()); | |||
//} | |||
#[bench] | |||
fn bench_rendering_small_kb(b: &mut test::Bencher) { | |||
let mut path = env::current_dir().unwrap().to_path_buf(); | |||
path.push("benches"); | |||
path.push("small-kb"); | |||
let mut site = Site::new(&path, "config.toml").unwrap(); | |||
let tmp_dir = TempDir::new("example").expect("create temp dir"); | |||
let public = &tmp_dir.path().join("public"); | |||
site.set_output_path(&public); | |||
site.load().unwrap(); | |||
b.iter(|| site.build().unwrap()); | |||
} | |||
#[bench] | |||
fn bench_rendering_medium_kb(b: &mut test::Bencher) { | |||
let mut path = env::current_dir().unwrap().to_path_buf(); | |||
path.push("benches"); | |||
path.push("medium-kb"); | |||
let mut site = Site::new(&path, "config.toml").unwrap(); | |||
let tmp_dir = TempDir::new("example").expect("create temp dir"); | |||
let public = &tmp_dir.path().join("public"); | |||
site.set_output_path(&public); | |||
site.load().unwrap(); | |||
b.iter(|| site.build().unwrap()); | |||
} | |||
@@ -0,0 +1,66 @@ | |||
#![feature(test)] | |||
extern crate test; | |||
extern crate site; | |||
extern crate tempdir; | |||
use std::env; | |||
use tempdir::TempDir; | |||
use site::Site; | |||
fn setup_site(name: &str) -> Site { | |||
let mut path = env::current_dir().unwrap().to_path_buf(); | |||
path.push("benches"); | |||
path.push(name); | |||
let mut site = Site::new(&path, "config.toml").unwrap(); | |||
site.load().unwrap(); | |||
site | |||
} | |||
#[bench] | |||
fn bench_render_aliases(b: &mut test::Bencher) { | |||
let mut site = setup_site("huge-blog"); | |||
let tmp_dir = TempDir::new("benches").expect("create temp dir"); | |||
let public = &tmp_dir.path().join("public"); | |||
site.set_output_path(&public); | |||
b.iter(|| site.render_aliases().unwrap()); | |||
} | |||
#[bench] | |||
fn bench_render_sitemap(b: &mut test::Bencher) { | |||
let mut site = setup_site("huge-blog"); | |||
let tmp_dir = TempDir::new("benches").expect("create temp dir"); | |||
let public = &tmp_dir.path().join("public"); | |||
site.set_output_path(&public); | |||
b.iter(|| site.render_sitemap().unwrap()); | |||
} | |||
#[bench] | |||
fn bench_render_rss_feed(b: &mut test::Bencher) { | |||
let mut site = setup_site("huge-blog"); | |||
let tmp_dir = TempDir::new("benches").expect("create temp dir"); | |||
let public = &tmp_dir.path().join("public"); | |||
site.set_output_path(&public); | |||
b.iter(|| site.render_rss_feed().unwrap()); | |||
} | |||
#[bench] | |||
fn bench_render_categories(b: &mut test::Bencher) { | |||
let mut site = setup_site("huge-blog"); | |||
let tmp_dir = TempDir::new("benches").expect("create temp dir"); | |||
let public = &tmp_dir.path().join("public"); | |||
site.set_output_path(&public); | |||
b.iter(|| site.render_categories().unwrap()); | |||
} | |||
#[bench] | |||
fn bench_render_paginated(b: &mut test::Bencher) { | |||
let mut site = setup_site("medium-blog"); | |||
let tmp_dir = TempDir::new("benches").expect("create temp dir"); | |||
let public = &tmp_dir.path().join("public"); | |||
site.set_output_path(&public); | |||
let section = site.sections.values().collect::<Vec<_>>()[0]; | |||
b.iter(|| site.render_paginated(public, section)); | |||
} |
@@ -1,18 +1,60 @@ | |||
extern crate tera; | |||
extern crate rayon; | |||
extern crate glob; | |||
extern crate walkdir; | |||
extern crate serde; | |||
#[macro_use] | |||
extern crate serde_derive; | |||
extern crate sass_rs; | |||
#[macro_use] | |||
extern crate errors; | |||
extern crate config; | |||
extern crate utils; | |||
extern crate front_matter; | |||
extern crate templates; | |||
extern crate pagination; | |||
extern crate taxonomies; | |||
extern crate content; | |||
#[cfg(test)] | |||
extern crate tempdir; | |||
use std::collections::HashMap; | |||
use std::fs::{remove_dir_all, copy, create_dir_all}; | |||
use std::mem; | |||
use std::path::{Path, PathBuf}; | |||
use glob::glob; | |||
use tera::{Tera, Context}; | |||
use walkdir::WalkDir; | |||
use sass_rs::{Options, compile_file}; | |||
use errors::{Result, ResultExt}; | |||
use config::{Config, get_config}; | |||
use fs::{create_file, create_directory, ensure_directory_exists}; | |||
use content::{Page, Section, Paginator, SortBy, Taxonomy, populate_previous_and_next_pages, sort_pages}; | |||
use utils::fs::{create_file, create_directory, ensure_directory_exists}; | |||
use content::{Page, Section, populate_previous_and_next_pages, sort_pages}; | |||
use templates::{GUTENBERG_TERA, global_fns, render_redirect_template}; | |||
use front_matter::InsertAnchor; | |||
use front_matter::{SortBy, InsertAnchor}; | |||
use taxonomies::Taxonomy; | |||
use pagination::Paginator; | |||
use rayon::prelude::*; | |||
/// The sitemap only needs links and potentially date so we trim down | |||
/// all pages to only that | |||
#[derive(Debug, Serialize)] | |||
struct SitemapEntry { | |||
permalink: String, | |||
date: Option<String>, | |||
} | |||
impl SitemapEntry { | |||
pub fn new(permalink: String, date: Option<String>) -> SitemapEntry { | |||
SitemapEntry { permalink, date } | |||
} | |||
} | |||
#[derive(Debug)] | |||
pub struct Site { | |||
@@ -95,37 +137,80 @@ impl Site { | |||
let base_path = self.base_path.to_string_lossy().replace("\\", "/"); | |||
let content_glob = format!("{}/{}", base_path, "content/**/*.md"); | |||
for entry in glob(&content_glob).unwrap().filter_map(|e| e.ok()) { | |||
let path = entry.as_path(); | |||
if path.file_name().unwrap() == "_index.md" { | |||
self.add_section(path, false)?; | |||
} else { | |||
self.add_page(path, false)?; | |||
} | |||
let (section_entries, page_entries): (Vec<_>, Vec<_>) = glob(&content_glob) | |||
.unwrap() | |||
.filter_map(|e| e.ok()) | |||
.partition(|entry| entry.as_path().file_name().unwrap() == "_index.md"); | |||
let sections = { | |||
let config = &self.config; | |||
section_entries | |||
.into_par_iter() | |||
.filter(|entry| entry.as_path().file_name().unwrap() == "_index.md") | |||
.map(|entry| { | |||
let path = entry.as_path(); | |||
Section::from_file(path, config) | |||
}).collect::<Vec<_>>() | |||
}; | |||
let pages = { | |||
let config = &self.config; | |||
page_entries | |||
.into_par_iter() | |||
.filter(|entry| entry.as_path().file_name().unwrap() != "_index.md") | |||
.map(|entry| { | |||
let path = entry.as_path(); | |||
Page::from_file(path, config) | |||
}).collect::<Vec<_>>() | |||
}; | |||
// Kinda duplicated code for add_section/add_page but necessary to do it that | |||
// way because of the borrow checker | |||
for section in sections { | |||
let s = section?; | |||
self.add_section(s, false)?; | |||
} | |||
// Insert a default index section if necessary so we don't need to create | |||
// a _index.md to render the index page | |||
let index_path = self.base_path.join("content").join("_index.md"); | |||
if !self.sections.contains_key(&index_path) { | |||
let mut index_section = Section::default(); | |||
index_section.permalink = self.config.make_permalink(""); | |||
// TODO: need to insert into permalinks too | |||
self.sections.insert(index_path, index_section); | |||
} | |||
// Silly thing needed to make the borrow checker happy | |||
let mut pages_insert_anchors = HashMap::new(); | |||
for page in self.pages.values() { | |||
pages_insert_anchors.insert(page.file.path.clone(), self.find_parent_section_insert_anchor(&page.file.parent.clone())); | |||
} | |||
// TODO: make that parallel | |||
for page in self.pages.values_mut() { | |||
let insert_anchor = pages_insert_anchors[&page.file.path]; | |||
page.render_markdown(&self.permalinks, &self.tera, &self.config, insert_anchor)?; | |||
} | |||
// TODO: make that parallel | |||
for section in self.sections.values_mut() { | |||
section.render_markdown(&self.permalinks, &self.tera, &self.config)?; | |||
for page in pages { | |||
let p = page?; | |||
pages_insert_anchors.insert(p.file.path.clone(), self.find_parent_section_insert_anchor(&p.file.parent.clone())); | |||
self.add_page(p, false)?; | |||
} | |||
{ | |||
// Another silly thing needed to not borrow &self in parallel and | |||
// make the borrow checker happy | |||
let permalinks = &self.permalinks; | |||
let tera = &self.tera; | |||
let config = &self.config; | |||
self.pages.par_iter_mut() | |||
.map(|(_, page)| page) | |||
.map(|page| { | |||
let insert_anchor = pages_insert_anchors[&page.file.path]; | |||
page.render_markdown(permalinks, tera, config, insert_anchor) | |||
}) | |||
.fold(|| Ok(()), Result::and) | |||
.reduce(|| Ok(()), Result::and)?; | |||
self.sections.par_iter_mut() | |||
.map(|(_, section)| section) | |||
.map(|section| section.render_markdown(permalinks, tera, config)) | |||
.fold(|| Ok(()), Result::and) | |||
.reduce(|| Ok(()), Result::and)?; | |||
} | |||
self.populate_sections(); | |||
@@ -147,14 +232,14 @@ impl Site { | |||
/// The `render` parameter is used in the serve command, when rebuilding a page. | |||
/// If `true`, it will also render the markdown for that page | |||
/// Returns the previous page struct if there was one | |||
pub fn add_page(&mut self, path: &Path, render: bool) -> Result<Option<Page>> { | |||
let page = Page::from_file(&path, &self.config)?; | |||
pub fn add_page(&mut self, page: Page, render: bool) -> Result<Option<Page>> { | |||
let path = page.file.path.clone(); | |||
self.permalinks.insert(page.file.relative.clone(), page.permalink.clone()); | |||
let prev = self.pages.insert(page.file.path.clone(), page); | |||
if render { | |||
let insert_anchor = self.find_parent_section_insert_anchor(&self.pages[path].file.parent); | |||
let mut page = self.pages.get_mut(path).unwrap(); | |||
let insert_anchor = self.find_parent_section_insert_anchor(&self.pages[&path].file.parent); | |||
let mut page = self.pages.get_mut(&path).unwrap(); | |||
page.render_markdown(&self.permalinks, &self.tera, &self.config, insert_anchor)?; | |||
} | |||
@@ -165,13 +250,13 @@ impl Site { | |||
/// The `render` parameter is used in the serve command, when rebuilding a page. | |||
/// If `true`, it will also render the markdown for that page | |||
/// Returns the previous section struct if there was one | |||
pub fn add_section(&mut self, path: &Path, render: bool) -> Result<Option<Section>> { | |||
let section = Section::from_file(path, &self.config)?; | |||
pub fn add_section(&mut self, section: Section, render: bool) -> Result<Option<Section>> { | |||
let path = section.file.path.clone(); | |||
self.permalinks.insert(section.file.relative.clone(), section.permalink.clone()); | |||
let prev = self.sections.insert(section.file.path.clone(), section); | |||
if render { | |||
let mut section = self.sections.get_mut(path).unwrap(); | |||
let mut section = self.sections.get_mut(&path).unwrap(); | |||
section.render_markdown(&self.permalinks, &self.tera, &self.config)?; | |||
} | |||
@@ -226,7 +311,8 @@ impl Site { | |||
continue; | |||
} | |||
} | |||
let (sorted_pages, cannot_be_sorted_pages) = sort_pages(section.pages.clone(), section.meta.sort_by()); | |||
let pages = mem::replace(&mut section.pages, vec![]); | |||
let (sorted_pages, cannot_be_sorted_pages) = sort_pages(pages, section.meta.sort_by()); | |||
section.pages = populate_previous_and_next_pages(&sorted_pages); | |||
section.ignored_pages = cannot_be_sorted_pages; | |||
} | |||
@@ -242,7 +328,7 @@ impl Site { | |||
// TODO: can we pass a reference? | |||
let (tags, categories) = Taxonomy::find_tags_and_categories( | |||
self.pages.values().cloned().collect::<Vec<_>>() | |||
self.pages.values().cloned().collect::<Vec<_>>().as_slice() | |||
); | |||
if generate_tags_pages { | |||
self.tags = Some(tags); | |||
@@ -304,7 +390,7 @@ impl Site { | |||
} | |||
/// Renders a single content page | |||
pub fn render_page(&self, page: &Page, section: Option<&Section>) -> Result<()> { | |||
pub fn render_page(&self, page: &Page) -> Result<()> { | |||
ensure_directory_exists(&self.output_path)?; | |||
// Copy the nesting of the content directory if we have sections for that page | |||
@@ -322,7 +408,7 @@ impl Site { | |||
create_directory(¤t_path)?; | |||
// Finally, create a index.html file there with the page rendered | |||
let output = page.render_html(&self.tera, &self.config, section)?; | |||
let output = page.render_html(&self.tera, &self.config)?; | |||
create_file(¤t_path.join("index.html"), &self.inject_livereload(output))?; | |||
// Copy any asset we found previously into the same directory as the index.html | |||
@@ -351,15 +437,43 @@ impl Site { | |||
self.render_categories()?; | |||
self.render_tags()?; | |||
if self.config.compile_sass.unwrap() { | |||
self.compile_sass()?; | |||
} | |||
self.copy_static_directory() | |||
} | |||
pub fn compile_sass(&self) -> Result<()> { | |||
ensure_directory_exists(&self.output_path)?; | |||
let base_path = self.base_path.to_string_lossy().replace("\\", "/"); | |||
let sass_glob = format!("{}/{}", base_path, "sass/**/*.scss"); | |||
let files = glob(&sass_glob) | |||
.unwrap() | |||
.filter_map(|e| e.ok()) | |||
.filter(|entry| !entry.as_path().file_name().unwrap().to_string_lossy().starts_with('_')) | |||
.collect::<Vec<_>>(); | |||
for file in files { | |||
let name = file.as_path().file_stem().unwrap().to_string_lossy(); | |||
let css = match compile_file(file.as_path().to_str().unwrap(), Options::default()) { | |||
Ok(c) => c, | |||
Err(e) => bail!(e) | |||
}; | |||
create_file(&self.output_path.join(format!("{}.css", name)), &css)?; | |||
} | |||
Ok(()) | |||
} | |||
pub fn render_aliases(&self) -> Result<()> { | |||
for page in self.pages.values() { | |||
if let Some(ref aliases) = page.meta.aliases { | |||
for alias in aliases { | |||
let mut output_path = self.output_path.to_path_buf(); | |||
for component in alias.split("/") { | |||
for component in alias.split('/') { | |||
output_path.push(&component); | |||
if !output_path.exists() { | |||
@@ -406,23 +520,24 @@ impl Site { | |||
} | |||
ensure_directory_exists(&self.output_path)?; | |||
let output_path = self.output_path.join(&taxonomy.get_list_name()); | |||
let list_output = taxonomy.render_list(&self.tera, &self.config)?; | |||
create_directory(&output_path)?; | |||
create_file(&output_path.join("index.html"), &self.inject_livereload(list_output))?; | |||
for item in &taxonomy.items { | |||
let single_output = taxonomy.render_single_item(item, &self.tera, &self.config)?; | |||
create_directory(&output_path.join(&item.slug))?; | |||
create_file( | |||
&output_path.join(&item.slug).join("index.html"), | |||
&self.inject_livereload(single_output) | |||
)?; | |||
} | |||
Ok(()) | |||
taxonomy | |||
.items | |||
.par_iter() | |||
.map(|item| { | |||
let single_output = taxonomy.render_single_item(item, &self.tera, &self.config)?; | |||
create_directory(&output_path.join(&item.slug))?; | |||
create_file( | |||
&output_path.join(&item.slug).join("index.html"), | |||
&self.inject_livereload(single_output) | |||
) | |||
}) | |||
.fold(|| Ok(()), Result::and) | |||
.reduce(|| Ok(()), Result::and) | |||
} | |||
/// What it says on the tin | |||
@@ -430,16 +545,23 @@ impl Site { | |||
ensure_directory_exists(&self.output_path)?; | |||
let mut context = Context::new(); | |||
context.add("pages", &self.pages.values().collect::<Vec<&Page>>()); | |||
context.add("sections", &self.sections.values().collect::<Vec<&Section>>()); | |||
context.add( | |||
"pages", | |||
&self.pages.values().map(|p| SitemapEntry::new(p.permalink.clone(), p.meta.date.clone())).collect::<Vec<_>>() | |||
); | |||
context.add( | |||
"sections", | |||
&self.sections.values().map(|s| SitemapEntry::new(s.permalink.clone(), None)).collect::<Vec<_>>() | |||
); | |||
let mut categories = vec![]; | |||
if let Some(ref c) = self.categories { | |||
let name = c.get_list_name(); | |||
categories.push(self.config.make_permalink(&name)); | |||
categories.push(SitemapEntry::new(self.config.make_permalink(&name), None)); | |||
for item in &c.items { | |||
categories.push( | |||
self.config.make_permalink(&format!("{}/{}", &name, item.slug)) | |||
SitemapEntry::new(self.config.make_permalink(&format!("{}/{}", &name, item.slug)), None), | |||
); | |||
} | |||
} | |||
@@ -448,10 +570,10 @@ impl Site { | |||
let mut tags = vec![]; | |||
if let Some(ref t) = self.tags { | |||
let name = t.get_list_name(); | |||
tags.push(self.config.make_permalink(&name)); | |||
tags.push(SitemapEntry::new(self.config.make_permalink(&name), None)); | |||
for item in &t.items { | |||
tags.push( | |||
self.config.make_permalink(&format!("{}/{}", &name, item.slug)) | |||
SitemapEntry::new(self.config.make_permalink(&format!("{}/{}", &name, item.slug)), None), | |||
); | |||
} | |||
} | |||
@@ -478,8 +600,9 @@ impl Site { | |||
if pages.is_empty() { | |||
return Ok(()); | |||
} | |||
context.add("last_build_date", &pages[0].meta.date); | |||
let (sorted_pages, _) = sort_pages(pages, SortBy::Date); | |||
context.add("last_build_date", &sorted_pages[0].meta.date); | |||
context.add("pages", &sorted_pages); | |||
context.add("config", &self.config); | |||
@@ -497,17 +620,6 @@ impl Site { | |||
Ok(()) | |||
} | |||
/// Create a hashmap of paths to section | |||
/// For example `content/posts/_index.md` key will be `posts` | |||
/// The index section will always be called `index` so don't use a path such as | |||
/// `content/index/_index.md` yourself | |||
fn get_sections_map(&self) -> HashMap<String, Section> { | |||
self.sections | |||
.values() | |||
.map(|s| (if s.is_index() { "index".to_string() } else { s.file.components.join("/") }, s.clone())) | |||
.collect() | |||
} | |||
/// Renders a single section | |||
pub fn render_section(&self, section: &Section, render_pages: bool) -> Result<()> { | |||
ensure_directory_exists(&self.output_path)?; | |||
@@ -523,9 +635,12 @@ impl Site { | |||
} | |||
if render_pages { | |||
for page in §ion.pages { | |||
self.render_page(page, Some(section))?; | |||
} | |||
section | |||
.pages | |||
.par_iter() | |||
.map(|p| self.render_page(p)) | |||
.fold(|| Ok(()), Result::and) | |||
.reduce(|| Ok(()), Result::and)?; | |||
} | |||
if !section.meta.should_render() { | |||
@@ -535,11 +650,7 @@ impl Site { | |||
if section.meta.is_paginated() { | |||
self.render_paginated(&output_path, section)?; | |||
} else { | |||
let output = section.render_html( | |||
if section.is_index() { self.get_sections_map() } else { HashMap::new() }, | |||
&self.tera, | |||
&self.config, | |||
)?; | |||
let output = section.render_html(&self.tera, &self.config)?; | |||
create_file(&output_path.join("index.html"), &self.inject_livereload(output))?; | |||
} | |||
@@ -552,10 +663,13 @@ impl Site { | |||
/// Renders all sections | |||
pub fn render_sections(&self) -> Result<()> { | |||
for section in self.sections.values() { | |||
self.render_section(section, true)?; | |||
} | |||
Ok(()) | |||
self.sections | |||
.values() | |||
.collect::<Vec<_>>() | |||
.into_par_iter() | |||
.map(|s| self.render_section(s, true)) | |||
.fold(|| Ok(()), Result::and) | |||
.reduce(|| Ok(()), Result::and) | |||
} | |||
/// Renders all pages that do not belong to any sections | |||
@@ -563,14 +677,14 @@ impl Site { | |||
ensure_directory_exists(&self.output_path)?; | |||
for page in self.get_all_orphan_pages() { | |||
self.render_page(page, None)?; | |||
self.render_page(page)?; | |||
} | |||
Ok(()) | |||
} | |||
/// Renders a list of pages when the section/index is wanting pagination. | |||
fn render_paginated(&self, output_path: &Path, section: &Section) -> Result<()> { | |||
pub fn render_paginated(&self, output_path: &Path, section: &Section) -> Result<()> { | |||
ensure_directory_exists(&self.output_path)?; | |||
let paginate_path = match section.meta.paginate_path { | |||
@@ -579,70 +693,26 @@ impl Site { | |||
}; | |||
let paginator = Paginator::new(§ion.pages, section); | |||
for (i, pager) in paginator.pagers.iter().enumerate() { | |||
let folder_path = output_path.join(&paginate_path); | |||
let page_path = folder_path.join(&format!("{}", i + 1)); | |||
create_directory(&folder_path)?; | |||
create_directory(&page_path)?; | |||
let output = paginator.render_pager(pager, self)?; | |||
if i > 0 { | |||
create_file(&page_path.join("index.html"), &self.inject_livereload(output))?; | |||
} else { | |||
create_file(&output_path.join("index.html"), &self.inject_livereload(output))?; | |||
create_file(&page_path.join("index.html"), &render_redirect_template(§ion.permalink, &self.tera)?)?; | |||
} | |||
} | |||
Ok(()) | |||
} | |||
} | |||
/// Resolves an internal link (of the `./posts/something.md#hey` sort) to its absolute link | |||
pub fn resolve_internal_link(link: &str, permalinks: &HashMap<String, String>) -> Result<String> { | |||
// First we remove the ./ since that's gutenberg specific | |||
let clean_link = link.replacen("./", "", 1); | |||
// Then we remove any potential anchor | |||
// parts[0] will be the file path and parts[1] the anchor if present | |||
let parts = clean_link.split('#').collect::<Vec<_>>(); | |||
match permalinks.get(parts[0]) { | |||
Some(p) => { | |||
if parts.len() > 1 { | |||
Ok(format!("{}#{}", p, parts[1])) | |||
} else { | |||
Ok(p.to_string()) | |||
} | |||
}, | |||
None => bail!(format!("Relative link {} not found.", link)), | |||
} | |||
} | |||
#[cfg(test)] | |||
mod tests { | |||
use std::collections::HashMap; | |||
use super::resolve_internal_link; | |||
#[test] | |||
fn can_resolve_valid_internal_link() { | |||
let mut permalinks = HashMap::new(); | |||
permalinks.insert("pages/about.md".to_string(), "https://vincent.is/about".to_string()); | |||
let res = resolve_internal_link("./pages/about.md", &permalinks).unwrap(); | |||
assert_eq!(res, "https://vincent.is/about"); | |||
} | |||
#[test] | |||
fn can_resolve_internal_links_with_anchors() { | |||
let mut permalinks = HashMap::new(); | |||
permalinks.insert("pages/about.md".to_string(), "https://vincent.is/about".to_string()); | |||
let res = resolve_internal_link("./pages/about.md#hello", &permalinks).unwrap(); | |||
assert_eq!(res, "https://vincent.is/about#hello"); | |||
} | |||
#[test] | |||
fn errors_resolve_inexistant_internal_link() { | |||
let res = resolve_internal_link("./pages/about.md#hello", &HashMap::new()); | |||
assert!(res.is_err()); | |||
let folder_path = output_path.join(&paginate_path); | |||
create_directory(&folder_path)?; | |||
paginator | |||
.pagers | |||
.par_iter() | |||
.enumerate() | |||
.map(|(i, pager)| { | |||
let page_path = folder_path.join(&format!("{}", i + 1)); | |||
create_directory(&page_path)?; | |||
let output = paginator.render_pager(pager, &self.config, &self.tera)?; | |||
if i > 0 { | |||
create_file(&page_path.join("index.html"), &self.inject_livereload(output))?; | |||
} else { | |||
create_file(&output_path.join("index.html"), &self.inject_livereload(output))?; | |||
create_file(&page_path.join("index.html"), &render_redirect_template(§ion.permalink, &self.tera)?)?; | |||
} | |||
Ok(()) | |||
}) | |||
.fold(|| Ok(()), Result::and) | |||
.reduce(|| Ok(()), Result::and) | |||
} | |||
} |
@@ -1,6 +1,7 @@ | |||
title = "My site" | |||
base_url = "https://replace-this-with-your-url.com" | |||
highlight_code = true | |||
compile_sass = true | |||
[extra.author] | |||
name = "Vincent Prouillet" |
@@ -1,6 +1,7 @@ | |||
+++ | |||
title = "Docker" | |||
order = 1 | |||
date = "2017-01-01" | |||
+++ | |||
A simple page |
@@ -1,6 +1,7 @@ | |||
+++ | |||
title = "Nix" | |||
order = 2 | |||
date = "2017-01-01" | |||
+++ | |||
A simple page |
@@ -1,6 +1,7 @@ | |||
+++ | |||
title = "Python tutorial" | |||
order = 1 | |||
date = "2017-01-01" | |||
+++ | |||
A simple page |
@@ -1,6 +1,7 @@ | |||
+++ | |||
title = "Rust" | |||
order = 2 | |||
date = "2017-01-01" | |||
+++ | |||
A simple page |
@@ -0,0 +1,3 @@ | |||
.container { | |||
font-size: 2rem; | |||
} |
@@ -0,0 +1,9 @@ | |||
body { | |||
background: red; | |||
.container { | |||
background: blue; | |||
} | |||
} | |||
@import "included"; |
@@ -1,7 +1,6 @@ | |||
{% extends "index.html" %} | |||
{% block content %} | |||
{% if section %}Section:{{ section.permalink }}{% endif %} | |||
{{ page.content | safe }} | |||
{% if page.previous %}Previous article: {{ page.previous.permalink }}{% endif %} |
@@ -1,4 +1,4 @@ | |||
extern crate gutenberg; | |||
extern crate site; | |||
extern crate tempdir; | |||
extern crate glob; | |||
@@ -8,7 +8,7 @@ use std::fs::File; | |||
use std::io::prelude::*; | |||
use tempdir::TempDir; | |||
use gutenberg::{Site}; | |||
use site::Site; | |||
#[test] | |||
@@ -132,9 +132,6 @@ fn can_build_site_without_live_reload() { | |||
// Both pages and sections are in the sitemap | |||
assert!(file_contains!(public, "sitemap.xml", "<loc>https://replace-this-with-your-url.com/posts/simple/</loc>")); | |||
assert!(file_contains!(public, "sitemap.xml", "<loc>https://replace-this-with-your-url.com/posts/</loc>")); | |||
// section is in the page context | |||
assert!(file_contains!(public, "posts/python/index.html", "Section:")); | |||
} | |||
#[test] |
@@ -0,0 +1,812 @@ | |||
[root] | |||
name = "taxonomies" | |||
version = "0.1.0" | |||
dependencies = [ | |||
"config 0.1.0", | |||
"content 0.1.0", | |||
"errors 0.1.0", | |||
"front_matter 0.1.0", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"slug 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"tera 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "aho-corasick" | |||
version = "0.6.3" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "backtrace" | |||
version = "0.3.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"backtrace-sys 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"cfg-if 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"dbghelp-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"rustc-demangle 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "backtrace-sys" | |||
version = "0.1.11" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "base64" | |||
version = "0.5.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "base64" | |||
version = "0.6.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "bincode" | |||
version = "0.8.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "bitflags" | |||
version = "0.7.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "bitflags" | |||
version = "0.8.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "bitflags" | |||
version = "0.9.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "byteorder" | |||
version = "1.0.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "cfg-if" | |||
version = "0.1.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "chrono" | |||
version = "0.3.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"num 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "chrono" | |||
version = "0.4.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"num 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "cmake" | |||
version = "0.1.24" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "coco" | |||
version = "0.1.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"either 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"scopeguard 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "config" | |||
version = "0.1.0" | |||
dependencies = [ | |||
"errors 0.1.0", | |||
"rendering 0.1.0", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"toml 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "content" | |||
version = "0.1.0" | |||
dependencies = [ | |||
"config 0.1.0", | |||
"errors 0.1.0", | |||
"front_matter 0.1.0", | |||
"rayon 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"rendering 0.1.0", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"slug 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"tera 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"utils 0.1.0", | |||
] | |||
[[package]] | |||
name = "dbghelp-sys" | |||
version = "0.2.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "dtoa" | |||
version = "0.4.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "either" | |||
version = "1.1.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "error-chain" | |||
version = "0.10.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"backtrace 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "errors" | |||
version = "0.1.0" | |||
dependencies = [ | |||
"error-chain 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"tera 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"toml 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "flate2" | |||
version = "0.2.19" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"miniz-sys 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "fnv" | |||
version = "1.0.5" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "front_matter" | |||
version = "0.1.0" | |||
dependencies = [ | |||
"chrono 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"errors 0.1.0", | |||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"tera 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"toml 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "futures" | |||
version = "0.1.14" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "gcc" | |||
version = "0.3.51" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "getopts" | |||
version = "0.2.14" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "glob" | |||
version = "0.2.11" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "humansize" | |||
version = "1.0.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "idna" | |||
version = "0.1.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"unicode-bidi 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"unicode-normalization 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "itoa" | |||
version = "0.3.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "kernel32-sys" | |||
version = "0.2.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "lazy_static" | |||
version = "0.2.8" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "libc" | |||
version = "0.2.24" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "matches" | |||
version = "0.1.6" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "memchr" | |||
version = "1.0.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "miniz-sys" | |||
version = "0.1.9" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "num" | |||
version = "0.1.39" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"num-integer 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"num-iter 0.1.33 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "num-integer" | |||
version = "0.1.34" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "num-iter" | |||
version = "0.1.33" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"num-integer 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "num-traits" | |||
version = "0.1.39" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "num_cpus" | |||
version = "1.6.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "onig" | |||
version = "1.3.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"onig_sys 63.0.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "onig_sys" | |||
version = "63.0.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"cmake 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "percent-encoding" | |||
version = "1.0.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "pest" | |||
version = "0.4.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "pkg-config" | |||
version = "0.3.9" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "plist" | |||
version = "0.2.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"base64 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"chrono 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"xml-rs 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "pulldown-cmark" | |||
version = "0.0.15" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "quote" | |||
version = "0.3.15" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "rand" | |||
version = "0.3.15" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "rayon" | |||
version = "0.8.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"rayon-core 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "rayon-core" | |||
version = "1.2.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"coco 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"num_cpus 1.6.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "redox_syscall" | |||
version = "0.1.19" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "regex" | |||
version = "0.2.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"aho-corasick 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"regex-syntax 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"thread_local 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "regex-syntax" | |||
version = "0.4.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "rendering" | |||
version = "0.1.0" | |||
dependencies = [ | |||
"errors 0.1.0", | |||
"front_matter 0.1.0", | |||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"pulldown-cmark 0.0.15 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"slug 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"syntect 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"templates 0.1.0", | |||
"tera 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"utils 0.1.0", | |||
] | |||
[[package]] | |||
name = "rustc-demangle" | |||
version = "0.1.4" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "safemem" | |||
version = "0.2.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "same-file" | |||
version = "0.1.3" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "scopeguard" | |||
version = "0.3.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "serde" | |||
version = "1.0.9" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "serde_derive" | |||
version = "1.0.9" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_derive_internals 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "serde_derive_internals" | |||
version = "0.15.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "serde_json" | |||
version = "1.0.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"dtoa 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"itoa 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "slug" | |||
version = "0.1.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"unidecode 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "syn" | |||
version = "0.11.11" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "synom" | |||
version = "0.11.3" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "syntect" | |||
version = "1.7.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"bincode 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"bitflags 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"flate2 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"onig 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"plist 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"regex-syntax 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"walkdir 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"yaml-rust 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "templates" | |||
version = "0.1.0" | |||
dependencies = [ | |||
"base64 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"errors 0.1.0", | |||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"pulldown-cmark 0.0.15 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"tera 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"utils 0.1.0", | |||
] | |||
[[package]] | |||
name = "tera" | |||
version = "0.10.8" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"chrono 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"error-chain 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"humansize 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"pest 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"slug 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"url 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "thread_local" | |||
version = "0.3.4" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "time" | |||
version = "0.1.37" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"redox_syscall 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "toml" | |||
version = "0.4.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "unicode-bidi" | |||
version = "0.3.3" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "unicode-normalization" | |||
version = "0.1.5" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "unicode-xid" | |||
version = "0.0.4" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "unidecode" | |||
version = "0.2.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "unreachable" | |||
version = "1.0.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "url" | |||
version = "1.5.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"idna 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"percent-encoding 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "utf8-ranges" | |||
version = "1.0.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "utils" | |||
version = "0.1.0" | |||
dependencies = [ | |||
"errors 0.1.0", | |||
] | |||
[[package]] | |||
name = "void" | |||
version = "1.0.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "walkdir" | |||
version = "1.0.7" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"same-file 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "winapi" | |||
version = "0.2.8" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "winapi-build" | |||
version = "0.1.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "xml-rs" | |||
version = "0.4.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "yaml-rust" | |||
version = "0.3.5" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[metadata] | |||
"checksum aho-corasick 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "500909c4f87a9e52355b26626d890833e9e1d53ac566db76c36faa984b889699" | |||
"checksum backtrace 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "72f9b4182546f4b04ebc4ab7f84948953a118bd6021a1b6a6c909e3e94f6be76" | |||
"checksum backtrace-sys 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "3a0d842ea781ce92be2bf78a9b38883948542749640b8378b3b2f03d1fd9f1ff" | |||
"checksum base64 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "30e93c03064e7590d0466209155251b90c22e37fab1daf2771582598b5827557" | |||
"checksum base64 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "96434f987501f0ed4eb336a411e0631ecd1afa11574fe148587adc4ff96143c9" | |||
"checksum bincode 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e103c8b299b28a9c6990458b7013dc4a8356a9b854c51b9883241f5866fac36e" | |||
"checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d" | |||
"checksum bitflags 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1370e9fc2a6ae53aea8b7a5110edbd08836ed87c88736dfabccade1c2b44bff4" | |||
"checksum bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5" | |||
"checksum byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c40977b0ee6b9885c9013cd41d9feffdd22deb3bb4dc3a71d901cc7a77de18c8" | |||
"checksum cfg-if 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d0c47d456a36ebf0536a6705c83c1cbbcb9255fbc1d905a6ded104f479268a29" | |||
"checksum chrono 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "158b0bd7d75cbb6bf9c25967a48a2e9f77da95876b858eadfabaa99cd069de6e" | |||
"checksum chrono 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7c20ebe0b2b08b0aeddba49c609fe7957ba2e33449882cb186a180bc60682fa9" | |||
"checksum cmake 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)" = "b8ebbb35d3dc9cd09497168f33de1acb79b265d350ab0ac34133b98f8509af1f" | |||
"checksum coco 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c06169f5beb7e31c7c67ebf5540b8b472d23e3eade3b2ec7d1f5b504a85f91bd" | |||
"checksum dbghelp-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "97590ba53bcb8ac28279161ca943a924d1fd4a8fb3fa63302591647c4fc5b850" | |||
"checksum dtoa 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "80c8b71fd71146990a9742fc06dcbbde19161a267e0ad4e572c35162f4578c90" | |||
"checksum either 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "18785c1ba806c258137c937e44ada9ee7e69a37e3c72077542cd2f069d78562a" | |||
"checksum error-chain 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d9435d864e017c3c6afeac1654189b06cdb491cf2ff73dbf0d73b0f292f42ff8" | |||
"checksum flate2 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)" = "36df0166e856739905cd3d7e0b210fe818592211a008862599845e012d8d304c" | |||
"checksum fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6cc484842f1e2884faf56f529f960cc12ad8c71ce96cc7abba0a067c98fee344" | |||
"checksum futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "4b63a4792d4f8f686defe3b39b92127fea6344de5d38202b2ee5a11bbbf29d6a" | |||
"checksum gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)" = "120d07f202dcc3f72859422563522b66fe6463a4c513df062874daad05f85f0a" | |||
"checksum getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9047cfbd08a437050b363d35ef160452c5fe8ea5187ae0a624708c91581d685" | |||
"checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb" | |||
"checksum humansize 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "92d211e6e70b05749dce515b47684f29a3c8c38bbbb21c50b30aff9eca1b0bd3" | |||
"checksum idna 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2233d4940b1f19f0418c158509cd7396b8d70a5db5705ce410914dc8fa603b37" | |||
"checksum itoa 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "eb2f404fbc66fd9aac13e998248505e7ecb2ad8e44ab6388684c5fb11c6c251c" | |||
"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" | |||
"checksum lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3b37545ab726dd833ec6420aaba8231c5b320814b9029ad585555d2a03e94fbf" | |||
"checksum libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)" = "38f5c2b18a287cf78b4097db62e20f43cace381dc76ae5c0a3073067f78b7ddc" | |||
"checksum matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "100aabe6b8ff4e4a7e32c1c13523379802df0772b82466207ac25b013f193376" | |||
"checksum memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1dbccc0e46f1ea47b9f17e6d67c5a96bd27030519c519c9c91327e31275a47b4" | |||
"checksum miniz-sys 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "28eaee17666671fa872e567547e8428e83308ebe5808cdf6a0e28397dbe2c726" | |||
"checksum num 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "2c3a3dc9f30bf824141521b30c908a859ab190b76e20435fcd89f35eb6583887" | |||
"checksum num-integer 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)" = "ef1a4bf6f9174aa5783a9b4cc892cacd11aebad6c69ad027a0b65c6ca5f8aa37" | |||
"checksum num-iter 0.1.33 (registry+https://github.com/rust-lang/crates.io-index)" = "f7d1891bd7b936f12349b7d1403761c8a0b85a18b148e9da4429d5d102c1a41e" | |||
"checksum num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "1708c0628602a98b52fad936cf3edb9a107af06e52e49fdf0707e884456a6af6" | |||
"checksum num_cpus 1.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "aec53c34f2d0247c5ca5d32cca1478762f301740468ee9ee6dcb7a0dd7a0c584" | |||
"checksum onig 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee619da9cf707b167098e84fb00f10db61d5a662d1d29b59822bcac3a81553dd" | |||
"checksum onig_sys 63.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "531682ab45a2cd40eff91f29340dae975f25336d2b61e624adabed39e61d7fb3" | |||
"checksum percent-encoding 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "de154f638187706bde41d9b4738748933d64e6b37bdbffc0b47a97d16a6ae356" | |||
"checksum pest 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3e2e823a5967bb4cdc6d3e46f47baaf4ecfeae44413a642b74ad44e59e49c7f6" | |||
"checksum pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "3a8b4c6b8165cd1a1cd4b9b120978131389f64bdaf456435caa41e630edba903" | |||
"checksum plist 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1e2f7e9574aabcf57bc5e9f602caabdffffa8179b0c130a039f7895fea3dbdb5" | |||
"checksum pulldown-cmark 0.0.15 (registry+https://github.com/rust-lang/crates.io-index)" = "378e941dbd392c101f2cb88097fa4d7167bc421d4b88de3ff7dbee503bc3233b" | |||
"checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a" | |||
"checksum rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "022e0636ec2519ddae48154b028864bdce4eaf7d35226ab8e65c611be97b189d" | |||
"checksum rayon 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b614fe08b6665cb9a231d07ac1364b0ef3cb3698f1239ee0c4c3a88a524f54c8" | |||
"checksum rayon-core 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7febc28567082c345f10cddc3612c6ea020fc3297a1977d472cf9fdb73e6e493" | |||
"checksum redox_syscall 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)" = "e4a357d14a12e90a37d658725df0e6468504750b5948b9710f83f94a0c5818e8" | |||
"checksum regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1731164734096285ec2a5ec7fea5248ae2f5485b3feeb0115af4fda2183b2d1b" | |||
"checksum regex-syntax 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ad890a5eef7953f55427c50575c680c42841653abd2b028b68cd223d157f62db" | |||
"checksum rustc-demangle 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3058a43ada2c2d0b92b3ae38007a2d0fa5e9db971be260e0171408a4ff471c95" | |||
"checksum safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e27a8b19b835f7aea908818e871f5cc3a5a186550c30773be987e155e8163d8f" | |||
"checksum same-file 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d931a44fdaa43b8637009e7632a02adc4f2b2e0733c08caa4cf00e8da4a117a7" | |||
"checksum scopeguard 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c79eb2c3ac4bc2507cda80e7f3ac5b88bd8eae4c0914d5663e6a8933994be918" | |||
"checksum serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)" = "6a7c6b751a2e8d5df57a5ff71b5b4fc8aaee9ee28ff1341d640dd130bb5f4f7a" | |||
"checksum serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)" = "2f6ca58905ebd3c3b285a8a6d4f3ac92b92c0d7951d5649b1bdd212549c06639" | |||
"checksum serde_derive_internals 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)" = "37aee4e0da52d801acfbc0cc219eb1eda7142112339726e427926a6f6ee65d3a" | |||
"checksum serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "48b04779552e92037212c3615370f6bd57a40ebba7f20e554ff9f55e41a69a7b" | |||
"checksum slug 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f6f5ff4b43cb07b86c5f9236c92714a22cdf9e5a27a7d85e398e2c9403328cb8" | |||
"checksum syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad" | |||
"checksum synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a393066ed9010ebaed60b9eafa373d4b1baac186dd7e008555b0f702b51945b6" | |||
"checksum syntect 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2f436345e5b6ebbfdf51b20b95cd9bcb82576262c340bad9cf815078d76b082a" | |||
"checksum tera 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)" = "62736a6d748fd2c5a8b4be21010e37d79f78aea3c2e07a9e13ff5c70864a3129" | |||
"checksum thread_local 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "1697c4b57aeeb7a536b647165a2825faddffb1d3bad386d507709bd51a90bb14" | |||
"checksum time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)" = "ffd7ccbf969a892bf83f1e441126968a07a3941c24ff522a26af9f9f4585d1a3" | |||
"checksum toml 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b0601da6c97135c8d330c7a13a013ca6cd4143221b01de2f8d4edc50a9e551c7" | |||
"checksum unicode-bidi 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a6a2c4e3710edd365cd7e78383153ed739fa31af19f9172f72d3575060f5a43a" | |||
"checksum unicode-normalization 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "51ccda9ef9efa3f7ef5d91e8f9b83bbe6955f9bf86aec89d5cce2c874625920f" | |||
"checksum unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc" | |||
"checksum unidecode 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d2adb95ee07cd579ed18131f2d9e7a17c25a4b76022935c7f2460d2bfae89fd2" | |||
"checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" | |||
"checksum url 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "eeb819346883532a271eb626deb43c4a1bb4c4dd47c519bd78137c3e72a4fe27" | |||
"checksum utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "662fab6525a98beff2921d7f61a39e7d59e0b425ebc7d0d9e66d316e55124122" | |||
"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" | |||
"checksum walkdir 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "bb08f9e670fab86099470b97cd2b252d6527f0b3cc1401acdb595ffc9dd288ff" | |||
"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" | |||
"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" | |||
"checksum xml-rs 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b46ee689ba7a669c08a1170c2348d2516c62dc461135c9e86b2f1f476e07be4a" | |||
"checksum yaml-rust 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e66366e18dc58b46801afbf2ca7661a9f59cc8c5962c29892b6039b4f86fa992" |
@@ -0,0 +1,15 @@ | |||
[package] | |||
name = "taxonomies" | |||
version = "0.1.0" | |||
authors = ["Vincent Prouillet <vincent@wearewizards.io>"] | |||
[dependencies] | |||
tera = "0.10" | |||
slug = "0.1" | |||
serde = "1.0" | |||
serde_derive = "1.0" | |||
errors = { path = "../errors" } | |||
config = { path = "../config" } | |||
content = { path = "../content" } | |||
front_matter = { path = "../front_matter" } |
@@ -1,3 +1,13 @@ | |||
#[macro_use] | |||
extern crate serde_derive; | |||
extern crate tera; | |||
extern crate slug; | |||
extern crate errors; | |||
extern crate config; | |||
extern crate content; | |||
extern crate front_matter; | |||
use std::collections::HashMap; | |||
use slug::slugify; | |||
@@ -5,8 +15,8 @@ use tera::{Context, Tera}; | |||
use config::Config; | |||
use errors::{Result, ResultExt}; | |||
use content::Page; | |||
use content::sorting::{SortBy, sort_pages}; | |||
use content::{Page, sort_pages}; | |||
use front_matter::SortBy; | |||
#[derive(Debug, Copy, Clone, PartialEq)] | |||
@@ -27,6 +37,7 @@ impl TaxonomyItem { | |||
pub fn new(name: &str, pages: Vec<Page>) -> TaxonomyItem { | |||
// We shouldn't have any pages without dates there | |||
let (sorted_pages, _) = sort_pages(pages, SortBy::Date); | |||
TaxonomyItem { | |||
name: name.to_string(), | |||
slug: slugify(name), | |||
@@ -45,7 +56,7 @@ pub struct Taxonomy { | |||
impl Taxonomy { | |||
// TODO: take a Vec<&'a Page> if it makes a difference in terms of perf for actual sites | |||
pub fn find_tags_and_categories(all_pages: Vec<Page>) -> (Taxonomy, Taxonomy) { | |||
pub fn find_tags_and_categories(all_pages: &[Page]) -> (Taxonomy, Taxonomy) { | |||
let mut tags = HashMap::new(); | |||
let mut categories = HashMap::new(); | |||
@@ -102,6 +113,10 @@ impl Taxonomy { | |||
self.items.len() | |||
} | |||
pub fn is_empty(&self) -> bool { | |||
self.len() == 0 | |||
} | |||
pub fn get_single_item_name(&self) -> String { | |||
match self.kind { | |||
TaxonomyKind::Tags => "tag".to_string(), |
@@ -0,0 +1,798 @@ | |||
[root] | |||
name = "templates" | |||
version = "0.1.0" | |||
dependencies = [ | |||
"base64 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"content 0.1.0", | |||
"errors 0.1.0", | |||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"pulldown-cmark 0.0.15 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"tera 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"utils 0.1.0", | |||
] | |||
[[package]] | |||
name = "aho-corasick" | |||
version = "0.6.3" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "backtrace" | |||
version = "0.3.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"backtrace-sys 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"cfg-if 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"dbghelp-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"rustc-demangle 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "backtrace-sys" | |||
version = "0.1.11" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "base64" | |||
version = "0.5.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "base64" | |||
version = "0.6.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "bincode" | |||
version = "0.8.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "bitflags" | |||
version = "0.7.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "bitflags" | |||
version = "0.8.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "bitflags" | |||
version = "0.9.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "byteorder" | |||
version = "1.0.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "cfg-if" | |||
version = "0.1.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "chrono" | |||
version = "0.3.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"num 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "chrono" | |||
version = "0.4.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"num 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "cmake" | |||
version = "0.1.24" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "coco" | |||
version = "0.1.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"either 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"scopeguard 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "config" | |||
version = "0.1.0" | |||
dependencies = [ | |||
"errors 0.1.0", | |||
"rendering 0.1.0", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"toml 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "content" | |||
version = "0.1.0" | |||
dependencies = [ | |||
"config 0.1.0", | |||
"errors 0.1.0", | |||
"front_matter 0.1.0", | |||
"rayon 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"rendering 0.1.0", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"slug 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"tera 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"utils 0.1.0", | |||
] | |||
[[package]] | |||
name = "dbghelp-sys" | |||
version = "0.2.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "dtoa" | |||
version = "0.4.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "either" | |||
version = "1.1.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "error-chain" | |||
version = "0.10.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"backtrace 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "errors" | |||
version = "0.1.0" | |||
dependencies = [ | |||
"error-chain 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"tera 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"toml 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "flate2" | |||
version = "0.2.19" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"miniz-sys 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "fnv" | |||
version = "1.0.5" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "front_matter" | |||
version = "0.1.0" | |||
dependencies = [ | |||
"chrono 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"errors 0.1.0", | |||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"tera 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"toml 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "futures" | |||
version = "0.1.14" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "gcc" | |||
version = "0.3.51" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "getopts" | |||
version = "0.2.14" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "glob" | |||
version = "0.2.11" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "humansize" | |||
version = "1.0.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "idna" | |||
version = "0.1.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"unicode-bidi 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"unicode-normalization 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "itoa" | |||
version = "0.3.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "kernel32-sys" | |||
version = "0.2.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "lazy_static" | |||
version = "0.2.8" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "libc" | |||
version = "0.2.24" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "matches" | |||
version = "0.1.6" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "memchr" | |||
version = "1.0.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "miniz-sys" | |||
version = "0.1.9" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "num" | |||
version = "0.1.39" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"num-integer 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"num-iter 0.1.33 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "num-integer" | |||
version = "0.1.34" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "num-iter" | |||
version = "0.1.33" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"num-integer 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "num-traits" | |||
version = "0.1.39" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "num_cpus" | |||
version = "1.6.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "onig" | |||
version = "1.3.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"onig_sys 63.0.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "onig_sys" | |||
version = "63.0.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"cmake 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "percent-encoding" | |||
version = "1.0.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "pest" | |||
version = "0.4.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "pkg-config" | |||
version = "0.3.9" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "plist" | |||
version = "0.2.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"base64 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"chrono 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"xml-rs 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "pulldown-cmark" | |||
version = "0.0.15" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "quote" | |||
version = "0.3.15" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "rand" | |||
version = "0.3.15" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "rayon" | |||
version = "0.8.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"rayon-core 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "rayon-core" | |||
version = "1.2.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"coco 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"num_cpus 1.6.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "redox_syscall" | |||
version = "0.1.19" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "regex" | |||
version = "0.2.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"aho-corasick 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"regex-syntax 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"thread_local 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "regex-syntax" | |||
version = "0.4.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "rendering" | |||
version = "0.1.0" | |||
dependencies = [ | |||
"errors 0.1.0", | |||
"front_matter 0.1.0", | |||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"pulldown-cmark 0.0.15 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"slug 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"syntect 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"tera 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"utils 0.1.0", | |||
] | |||
[[package]] | |||
name = "rustc-demangle" | |||
version = "0.1.4" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "safemem" | |||
version = "0.2.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "same-file" | |||
version = "0.1.3" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "scopeguard" | |||
version = "0.3.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "serde" | |||
version = "1.0.9" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "serde_derive" | |||
version = "1.0.9" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_derive_internals 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "serde_derive_internals" | |||
version = "0.15.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "serde_json" | |||
version = "1.0.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"dtoa 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"itoa 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "slug" | |||
version = "0.1.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"unidecode 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "syn" | |||
version = "0.11.11" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "synom" | |||
version = "0.11.3" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "syntect" | |||
version = "1.7.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"bincode 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"bitflags 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"flate2 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"onig 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"plist 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"regex-syntax 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"walkdir 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"yaml-rust 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "tera" | |||
version = "0.10.8" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"chrono 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"error-chain 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"humansize 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"pest 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"slug 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"url 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "thread_local" | |||
version = "0.3.4" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "time" | |||
version = "0.1.37" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"redox_syscall 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "toml" | |||
version = "0.4.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "unicode-bidi" | |||
version = "0.3.3" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "unicode-normalization" | |||
version = "0.1.5" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "unicode-xid" | |||
version = "0.0.4" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "unidecode" | |||
version = "0.2.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "unreachable" | |||
version = "1.0.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "url" | |||
version = "1.5.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"idna 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"percent-encoding 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "utf8-ranges" | |||
version = "1.0.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "utils" | |||
version = "0.1.0" | |||
dependencies = [ | |||
"errors 0.1.0", | |||
] | |||
[[package]] | |||
name = "void" | |||
version = "1.0.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "walkdir" | |||
version = "1.0.7" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"same-file 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "winapi" | |||
version = "0.2.8" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "winapi-build" | |||
version = "0.1.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "xml-rs" | |||
version = "0.4.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "yaml-rust" | |||
version = "0.3.5" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[metadata] | |||
"checksum aho-corasick 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "500909c4f87a9e52355b26626d890833e9e1d53ac566db76c36faa984b889699" | |||
"checksum backtrace 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "72f9b4182546f4b04ebc4ab7f84948953a118bd6021a1b6a6c909e3e94f6be76" | |||
"checksum backtrace-sys 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "3a0d842ea781ce92be2bf78a9b38883948542749640b8378b3b2f03d1fd9f1ff" | |||
"checksum base64 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "30e93c03064e7590d0466209155251b90c22e37fab1daf2771582598b5827557" | |||
"checksum base64 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "96434f987501f0ed4eb336a411e0631ecd1afa11574fe148587adc4ff96143c9" | |||
"checksum bincode 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e103c8b299b28a9c6990458b7013dc4a8356a9b854c51b9883241f5866fac36e" | |||
"checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d" | |||
"checksum bitflags 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1370e9fc2a6ae53aea8b7a5110edbd08836ed87c88736dfabccade1c2b44bff4" | |||
"checksum bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5" | |||
"checksum byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c40977b0ee6b9885c9013cd41d9feffdd22deb3bb4dc3a71d901cc7a77de18c8" | |||
"checksum cfg-if 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d0c47d456a36ebf0536a6705c83c1cbbcb9255fbc1d905a6ded104f479268a29" | |||
"checksum chrono 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "158b0bd7d75cbb6bf9c25967a48a2e9f77da95876b858eadfabaa99cd069de6e" | |||
"checksum chrono 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7c20ebe0b2b08b0aeddba49c609fe7957ba2e33449882cb186a180bc60682fa9" | |||
"checksum cmake 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)" = "b8ebbb35d3dc9cd09497168f33de1acb79b265d350ab0ac34133b98f8509af1f" | |||
"checksum coco 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c06169f5beb7e31c7c67ebf5540b8b472d23e3eade3b2ec7d1f5b504a85f91bd" | |||
"checksum dbghelp-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "97590ba53bcb8ac28279161ca943a924d1fd4a8fb3fa63302591647c4fc5b850" | |||
"checksum dtoa 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "80c8b71fd71146990a9742fc06dcbbde19161a267e0ad4e572c35162f4578c90" | |||
"checksum either 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "18785c1ba806c258137c937e44ada9ee7e69a37e3c72077542cd2f069d78562a" | |||
"checksum error-chain 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d9435d864e017c3c6afeac1654189b06cdb491cf2ff73dbf0d73b0f292f42ff8" | |||
"checksum flate2 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)" = "36df0166e856739905cd3d7e0b210fe818592211a008862599845e012d8d304c" | |||
"checksum fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6cc484842f1e2884faf56f529f960cc12ad8c71ce96cc7abba0a067c98fee344" | |||
"checksum futures 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "4b63a4792d4f8f686defe3b39b92127fea6344de5d38202b2ee5a11bbbf29d6a" | |||
"checksum gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)" = "120d07f202dcc3f72859422563522b66fe6463a4c513df062874daad05f85f0a" | |||
"checksum getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9047cfbd08a437050b363d35ef160452c5fe8ea5187ae0a624708c91581d685" | |||
"checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb" | |||
"checksum humansize 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "92d211e6e70b05749dce515b47684f29a3c8c38bbbb21c50b30aff9eca1b0bd3" | |||
"checksum idna 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2233d4940b1f19f0418c158509cd7396b8d70a5db5705ce410914dc8fa603b37" | |||
"checksum itoa 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "eb2f404fbc66fd9aac13e998248505e7ecb2ad8e44ab6388684c5fb11c6c251c" | |||
"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" | |||
"checksum lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3b37545ab726dd833ec6420aaba8231c5b320814b9029ad585555d2a03e94fbf" | |||
"checksum libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)" = "38f5c2b18a287cf78b4097db62e20f43cace381dc76ae5c0a3073067f78b7ddc" | |||
"checksum matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "100aabe6b8ff4e4a7e32c1c13523379802df0772b82466207ac25b013f193376" | |||
"checksum memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1dbccc0e46f1ea47b9f17e6d67c5a96bd27030519c519c9c91327e31275a47b4" | |||
"checksum miniz-sys 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "28eaee17666671fa872e567547e8428e83308ebe5808cdf6a0e28397dbe2c726" | |||
"checksum num 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "2c3a3dc9f30bf824141521b30c908a859ab190b76e20435fcd89f35eb6583887" | |||
"checksum num-integer 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)" = "ef1a4bf6f9174aa5783a9b4cc892cacd11aebad6c69ad027a0b65c6ca5f8aa37" | |||
"checksum num-iter 0.1.33 (registry+https://github.com/rust-lang/crates.io-index)" = "f7d1891bd7b936f12349b7d1403761c8a0b85a18b148e9da4429d5d102c1a41e" | |||
"checksum num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "1708c0628602a98b52fad936cf3edb9a107af06e52e49fdf0707e884456a6af6" | |||
"checksum num_cpus 1.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "aec53c34f2d0247c5ca5d32cca1478762f301740468ee9ee6dcb7a0dd7a0c584" | |||
"checksum onig 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee619da9cf707b167098e84fb00f10db61d5a662d1d29b59822bcac3a81553dd" | |||
"checksum onig_sys 63.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "531682ab45a2cd40eff91f29340dae975f25336d2b61e624adabed39e61d7fb3" | |||
"checksum percent-encoding 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "de154f638187706bde41d9b4738748933d64e6b37bdbffc0b47a97d16a6ae356" | |||
"checksum pest 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3e2e823a5967bb4cdc6d3e46f47baaf4ecfeae44413a642b74ad44e59e49c7f6" | |||
"checksum pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "3a8b4c6b8165cd1a1cd4b9b120978131389f64bdaf456435caa41e630edba903" | |||
"checksum plist 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1e2f7e9574aabcf57bc5e9f602caabdffffa8179b0c130a039f7895fea3dbdb5" | |||
"checksum pulldown-cmark 0.0.15 (registry+https://github.com/rust-lang/crates.io-index)" = "378e941dbd392c101f2cb88097fa4d7167bc421d4b88de3ff7dbee503bc3233b" | |||
"checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a" | |||
"checksum rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "022e0636ec2519ddae48154b028864bdce4eaf7d35226ab8e65c611be97b189d" | |||
"checksum rayon 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b614fe08b6665cb9a231d07ac1364b0ef3cb3698f1239ee0c4c3a88a524f54c8" | |||
"checksum rayon-core 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7febc28567082c345f10cddc3612c6ea020fc3297a1977d472cf9fdb73e6e493" | |||
"checksum redox_syscall 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)" = "e4a357d14a12e90a37d658725df0e6468504750b5948b9710f83f94a0c5818e8" | |||
"checksum regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1731164734096285ec2a5ec7fea5248ae2f5485b3feeb0115af4fda2183b2d1b" | |||
"checksum regex-syntax 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ad890a5eef7953f55427c50575c680c42841653abd2b028b68cd223d157f62db" | |||
"checksum rustc-demangle 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3058a43ada2c2d0b92b3ae38007a2d0fa5e9db971be260e0171408a4ff471c95" | |||
"checksum safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e27a8b19b835f7aea908818e871f5cc3a5a186550c30773be987e155e8163d8f" | |||
"checksum same-file 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d931a44fdaa43b8637009e7632a02adc4f2b2e0733c08caa4cf00e8da4a117a7" | |||
"checksum scopeguard 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c79eb2c3ac4bc2507cda80e7f3ac5b88bd8eae4c0914d5663e6a8933994be918" | |||
"checksum serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)" = "6a7c6b751a2e8d5df57a5ff71b5b4fc8aaee9ee28ff1341d640dd130bb5f4f7a" | |||
"checksum serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)" = "2f6ca58905ebd3c3b285a8a6d4f3ac92b92c0d7951d5649b1bdd212549c06639" | |||
"checksum serde_derive_internals 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)" = "37aee4e0da52d801acfbc0cc219eb1eda7142112339726e427926a6f6ee65d3a" | |||
"checksum serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "48b04779552e92037212c3615370f6bd57a40ebba7f20e554ff9f55e41a69a7b" | |||
"checksum slug 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f6f5ff4b43cb07b86c5f9236c92714a22cdf9e5a27a7d85e398e2c9403328cb8" | |||
"checksum syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad" | |||
"checksum synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a393066ed9010ebaed60b9eafa373d4b1baac186dd7e008555b0f702b51945b6" | |||
"checksum syntect 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2f436345e5b6ebbfdf51b20b95cd9bcb82576262c340bad9cf815078d76b082a" | |||
"checksum tera 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)" = "62736a6d748fd2c5a8b4be21010e37d79f78aea3c2e07a9e13ff5c70864a3129" | |||
"checksum thread_local 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "1697c4b57aeeb7a536b647165a2825faddffb1d3bad386d507709bd51a90bb14" | |||
"checksum time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)" = "ffd7ccbf969a892bf83f1e441126968a07a3941c24ff522a26af9f9f4585d1a3" | |||
"checksum toml 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b0601da6c97135c8d330c7a13a013ca6cd4143221b01de2f8d4edc50a9e551c7" | |||
"checksum unicode-bidi 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a6a2c4e3710edd365cd7e78383153ed739fa31af19f9172f72d3575060f5a43a" | |||
"checksum unicode-normalization 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "51ccda9ef9efa3f7ef5d91e8f9b83bbe6955f9bf86aec89d5cce2c874625920f" | |||
"checksum unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc" | |||
"checksum unidecode 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d2adb95ee07cd579ed18131f2d9e7a17c25a4b76022935c7f2460d2bfae89fd2" | |||
"checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" | |||
"checksum url 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "eeb819346883532a271eb626deb43c4a1bb4c4dd47c519bd78137c3e72a4fe27" | |||
"checksum utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "662fab6525a98beff2921d7f61a39e7d59e0b425ebc7d0d9e66d316e55124122" | |||
"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" | |||
"checksum walkdir 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "bb08f9e670fab86099470b97cd2b252d6527f0b3cc1401acdb595ffc9dd288ff" | |||
"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" | |||
"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" | |||
"checksum xml-rs 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b46ee689ba7a669c08a1170c2348d2516c62dc461135c9e86b2f1f476e07be4a" | |||
"checksum yaml-rust 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e66366e18dc58b46801afbf2ca7661a9f59cc8c5962c29892b6039b4f86fa992" |
@@ -0,0 +1,14 @@ | |||
[package] | |||
name = "templates" | |||
version = "0.1.0" | |||
authors = ["Vincent Prouillet <vincent@wearewizards.io>"] | |||
[dependencies] | |||
tera = "0.10" | |||
base64 = "0.6" | |||
lazy_static = "0.2" | |||
pulldown-cmark = "0" | |||
errors = { path = "../errors" } | |||
utils = { path = "../utils" } | |||
content = { path = "../content" } |
@@ -14,12 +14,12 @@ | |||
{% endfor %} | |||
{% for category in categories %} | |||
<url> | |||
<loc>{{ category | safe }}</loc> | |||
<loc>{{ category.permalink | safe }}</loc> | |||
</url> | |||
{% endfor %} | |||
{% for tag in tags %} | |||
<url> | |||
<loc>{{ tag | safe }}</loc> | |||
<loc>{{ tag.permalink | safe }}</loc> | |||
</url> | |||
{% endfor %} | |||
</urlset> |
@@ -1,10 +1,9 @@ | |||
use std::collections::{HashMap}; | |||
use std::collections::HashMap; | |||
use base64::{encode, decode}; | |||
use pulldown_cmark as cmark; | |||
use tera::{Value, to_value, Result as TeraResult}; | |||
// fn(Value, HashMap<String, Value>) -> Result<Value> | |||
pub fn markdown(value: Value, _: HashMap<String, Value>) -> TeraResult<Value> { | |||
let s = try_get_value!("markdown", "value", String, value); |
@@ -4,7 +4,7 @@ use std::path::{PathBuf}; | |||
use tera::{GlobalFn, Value, from_value, to_value, Result}; | |||
use content::{Page, Section}; | |||
use site::resolve_internal_link; | |||
use utils::site::resolve_internal_link; | |||
pub fn make_get_page(all_pages: &HashMap<PathBuf, Page>) -> GlobalFn { |
@@ -1,10 +1,21 @@ | |||
use tera::{Tera, Context}; | |||
#[macro_use] | |||
extern crate lazy_static; | |||
#[macro_use] | |||
extern crate tera; | |||
extern crate base64; | |||
extern crate pulldown_cmark; | |||
use errors::{Result, ResultExt}; | |||
extern crate errors; | |||
extern crate utils; | |||
extern crate content; | |||
pub mod filters; | |||
pub mod global_fns; | |||
use tera::{Tera, Context}; | |||
use errors::{Result, ResultExt}; | |||
lazy_static! { | |||
pub static ref GUTENBERG_TERA: Tera = { | |||
let mut tera = Tera::default(); |
@@ -0,0 +1,404 @@ | |||
[root] | |||
name = "utils" | |||
version = "0.1.0" | |||
dependencies = [ | |||
"errors 0.1.0", | |||
"tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "aho-corasick" | |||
version = "0.6.3" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "backtrace" | |||
version = "0.3.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"backtrace-sys 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"cfg-if 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"dbghelp-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"rustc-demangle 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "backtrace-sys" | |||
version = "0.1.11" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "cfg-if" | |||
version = "0.1.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "chrono" | |||
version = "0.4.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"num 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "dbghelp-sys" | |||
version = "0.2.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "dtoa" | |||
version = "0.4.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "error-chain" | |||
version = "0.10.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"backtrace 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "errors" | |||
version = "0.1.0" | |||
dependencies = [ | |||
"error-chain 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"tera 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"toml 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "gcc" | |||
version = "0.3.51" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "glob" | |||
version = "0.2.11" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "humansize" | |||
version = "1.0.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "idna" | |||
version = "0.1.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"unicode-bidi 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"unicode-normalization 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "itoa" | |||
version = "0.3.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "kernel32-sys" | |||
version = "0.2.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "lazy_static" | |||
version = "0.2.8" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "libc" | |||
version = "0.2.24" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "matches" | |||
version = "0.1.6" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "memchr" | |||
version = "1.0.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "num" | |||
version = "0.1.39" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"num-integer 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"num-iter 0.1.33 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "num-integer" | |||
version = "0.1.34" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "num-iter" | |||
version = "0.1.33" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"num-integer 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "num-traits" | |||
version = "0.1.39" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "percent-encoding" | |||
version = "1.0.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "pest" | |||
version = "0.4.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "rand" | |||
version = "0.3.15" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "redox_syscall" | |||
version = "0.1.19" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "regex" | |||
version = "0.2.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"aho-corasick 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"regex-syntax 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"thread_local 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "regex-syntax" | |||
version = "0.4.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "rustc-demangle" | |||
version = "0.1.4" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "serde" | |||
version = "1.0.9" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "serde_json" | |||
version = "1.0.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"dtoa 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"itoa 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "slug" | |||
version = "0.1.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"unidecode 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "tempdir" | |||
version = "0.3.5" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "tera" | |||
version = "0.10.8" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"chrono 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"error-chain 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"humansize 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"pest 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"slug 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"url 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "thread_local" | |||
version = "0.3.4" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "time" | |||
version = "0.1.37" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"redox_syscall 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "toml" | |||
version = "0.4.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "unicode-bidi" | |||
version = "0.3.3" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "unicode-normalization" | |||
version = "0.1.5" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "unidecode" | |||
version = "0.2.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "unreachable" | |||
version = "1.0.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "url" | |||
version = "1.5.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
dependencies = [ | |||
"idna 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", | |||
"percent-encoding 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | |||
] | |||
[[package]] | |||
name = "utf8-ranges" | |||
version = "1.0.0" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "void" | |||
version = "1.0.2" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "winapi" | |||
version = "0.2.8" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[[package]] | |||
name = "winapi-build" | |||
version = "0.1.1" | |||
source = "registry+https://github.com/rust-lang/crates.io-index" | |||
[metadata] | |||
"checksum aho-corasick 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "500909c4f87a9e52355b26626d890833e9e1d53ac566db76c36faa984b889699" | |||
"checksum backtrace 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "72f9b4182546f4b04ebc4ab7f84948953a118bd6021a1b6a6c909e3e94f6be76" | |||
"checksum backtrace-sys 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "3a0d842ea781ce92be2bf78a9b38883948542749640b8378b3b2f03d1fd9f1ff" | |||
"checksum cfg-if 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d0c47d456a36ebf0536a6705c83c1cbbcb9255fbc1d905a6ded104f479268a29" | |||
"checksum chrono 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7c20ebe0b2b08b0aeddba49c609fe7957ba2e33449882cb186a180bc60682fa9" | |||
"checksum dbghelp-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "97590ba53bcb8ac28279161ca943a924d1fd4a8fb3fa63302591647c4fc5b850" | |||
"checksum dtoa 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "80c8b71fd71146990a9742fc06dcbbde19161a267e0ad4e572c35162f4578c90" | |||
"checksum error-chain 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d9435d864e017c3c6afeac1654189b06cdb491cf2ff73dbf0d73b0f292f42ff8" | |||
"checksum gcc 0.3.51 (registry+https://github.com/rust-lang/crates.io-index)" = "120d07f202dcc3f72859422563522b66fe6463a4c513df062874daad05f85f0a" | |||
"checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb" | |||
"checksum humansize 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "92d211e6e70b05749dce515b47684f29a3c8c38bbbb21c50b30aff9eca1b0bd3" | |||
"checksum idna 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2233d4940b1f19f0418c158509cd7396b8d70a5db5705ce410914dc8fa603b37" | |||
"checksum itoa 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "eb2f404fbc66fd9aac13e998248505e7ecb2ad8e44ab6388684c5fb11c6c251c" | |||
"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" | |||
"checksum lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3b37545ab726dd833ec6420aaba8231c5b320814b9029ad585555d2a03e94fbf" | |||
"checksum libc 0.2.24 (registry+https://github.com/rust-lang/crates.io-index)" = "38f5c2b18a287cf78b4097db62e20f43cace381dc76ae5c0a3073067f78b7ddc" | |||
"checksum matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "100aabe6b8ff4e4a7e32c1c13523379802df0772b82466207ac25b013f193376" | |||
"checksum memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1dbccc0e46f1ea47b9f17e6d67c5a96bd27030519c519c9c91327e31275a47b4" | |||
"checksum num 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "2c3a3dc9f30bf824141521b30c908a859ab190b76e20435fcd89f35eb6583887" | |||
"checksum num-integer 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)" = "ef1a4bf6f9174aa5783a9b4cc892cacd11aebad6c69ad027a0b65c6ca5f8aa37" | |||
"checksum num-iter 0.1.33 (registry+https://github.com/rust-lang/crates.io-index)" = "f7d1891bd7b936f12349b7d1403761c8a0b85a18b148e9da4429d5d102c1a41e" | |||
"checksum num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "1708c0628602a98b52fad936cf3edb9a107af06e52e49fdf0707e884456a6af6" | |||
"checksum percent-encoding 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "de154f638187706bde41d9b4738748933d64e6b37bdbffc0b47a97d16a6ae356" | |||
"checksum pest 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3e2e823a5967bb4cdc6d3e46f47baaf4ecfeae44413a642b74ad44e59e49c7f6" | |||
"checksum rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "022e0636ec2519ddae48154b028864bdce4eaf7d35226ab8e65c611be97b189d" | |||
"checksum redox_syscall 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)" = "e4a357d14a12e90a37d658725df0e6468504750b5948b9710f83f94a0c5818e8" | |||
"checksum regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1731164734096285ec2a5ec7fea5248ae2f5485b3feeb0115af4fda2183b2d1b" | |||
"checksum regex-syntax 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ad890a5eef7953f55427c50575c680c42841653abd2b028b68cd223d157f62db" | |||
"checksum rustc-demangle 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3058a43ada2c2d0b92b3ae38007a2d0fa5e9db971be260e0171408a4ff471c95" | |||
"checksum serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)" = "6a7c6b751a2e8d5df57a5ff71b5b4fc8aaee9ee28ff1341d640dd130bb5f4f7a" | |||
"checksum serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "48b04779552e92037212c3615370f6bd57a40ebba7f20e554ff9f55e41a69a7b" | |||
"checksum slug 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f6f5ff4b43cb07b86c5f9236c92714a22cdf9e5a27a7d85e398e2c9403328cb8" | |||
"checksum tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "87974a6f5c1dfb344d733055601650059a3363de2a6104819293baff662132d6" | |||
"checksum tera 0.10.8 (registry+https://github.com/rust-lang/crates.io-index)" = "62736a6d748fd2c5a8b4be21010e37d79f78aea3c2e07a9e13ff5c70864a3129" | |||
"checksum thread_local 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "1697c4b57aeeb7a536b647165a2825faddffb1d3bad386d507709bd51a90bb14" | |||
"checksum time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)" = "ffd7ccbf969a892bf83f1e441126968a07a3941c24ff522a26af9f9f4585d1a3" | |||
"checksum toml 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b0601da6c97135c8d330c7a13a013ca6cd4143221b01de2f8d4edc50a9e551c7" | |||
"checksum unicode-bidi 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a6a2c4e3710edd365cd7e78383153ed739fa31af19f9172f72d3575060f5a43a" | |||
"checksum unicode-normalization 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "51ccda9ef9efa3f7ef5d91e8f9b83bbe6955f9bf86aec89d5cce2c874625920f" | |||
"checksum unidecode 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d2adb95ee07cd579ed18131f2d9e7a17c25a4b76022935c7f2460d2bfae89fd2" | |||
"checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" | |||
"checksum url 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "eeb819346883532a271eb626deb43c4a1bb4c4dd47c519bd78137c3e72a4fe27" | |||
"checksum utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "662fab6525a98beff2921d7f61a39e7d59e0b425ebc7d0d9e66d316e55124122" | |||
"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" | |||
"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" | |||
"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" |
@@ -0,0 +1,11 @@ | |||
[package] | |||
name = "utils" | |||
version = "0.1.0" | |||
authors = ["Vincent Prouillet <vincent@wearewizards.io>"] | |||
[dependencies] | |||
errors = { path = "../errors" } | |||
[dev-dependencies] | |||
tempdir = "0.3" |