Browse Source

Some intellij reformatting

index-subcmd
Vincent Prouillet 5 years ago
parent
commit
60a52fd2cc
26 changed files with 174 additions and 260 deletions
  1. +54
    -134
      Cargo.lock
  2. +1
    -1
      components/config/src/lib.rs
  3. +2
    -2
      components/config/src/theme.rs
  4. +2
    -2
      components/content/benches/all.rs
  5. +5
    -6
      components/content/src/page.rs
  6. +1
    -1
      components/content/src/section.rs
  7. +8
    -9
      components/content/src/sorting.rs
  8. +0
    -1
      components/front_matter/src/lib.rs
  9. +4
    -4
      components/front_matter/src/page.rs
  10. +2
    -2
      components/highlighting/src/lib.rs
  11. +13
    -13
      components/imageproc/src/lib.rs
  12. +2
    -2
      components/link_checker/src/lib.rs
  13. +6
    -6
      components/pagination/src/lib.rs
  14. +13
    -13
      components/rebuild/src/lib.rs
  15. +0
    -1
      components/rendering/src/context.rs
  16. +1
    -1
      components/rendering/src/lib.rs
  17. +11
    -11
      components/rendering/src/markdown.rs
  18. +19
    -21
      components/rendering/src/shortcode.rs
  19. +3
    -3
      components/rendering/src/table_of_contents.rs
  20. +15
    -15
      components/site/src/lib.rs
  21. +4
    -4
      components/taxonomies/src/lib.rs
  22. +1
    -1
      components/templates/src/filters.rs
  23. +1
    -1
      components/templates/src/global_fns.rs
  24. +2
    -2
      components/utils/src/fs.rs
  25. +1
    -1
      components/utils/src/site.rs
  26. +3
    -3
      components/utils/src/templates.rs

+ 54
- 134
Cargo.lock View File

@@ -1,9 +1,9 @@
[[package]]
name = "actix"
version = "0.7.1"
version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"actix_derive 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"actix_derive 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"bytes 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)",
"crossbeam-channel 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -28,15 +28,15 @@ dependencies = [

[[package]]
name = "actix-web"
version = "0.7.1"
version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"actix 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
"actix 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)",
"base64 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)",
"bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
"bytes 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)",
"cookie 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)",
"cookie 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
"dtoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"encoding 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -44,7 +44,7 @@ dependencies = [
"futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
"h2 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
"htmlescape 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"http 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
"http 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
"httparse 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"itoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -77,13 +77,12 @@ dependencies = [

[[package]]
name = "actix_derive"
version = "0.2.0"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)",
"version_check 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"proc-macro2 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.14.5 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
@@ -178,7 +177,7 @@ name = "base64"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
"safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
]

@@ -187,7 +186,7 @@ name = "base64"
version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
"safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
]

@@ -196,7 +195,7 @@ name = "bincode"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)",
]

@@ -227,7 +226,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"

[[package]]
name = "byteorder"
version = "1.2.3"
version = "1.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"

[[package]]
@@ -240,7 +239,7 @@ name = "bytes"
version = "0.4.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
"iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
]

@@ -256,7 +255,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"

[[package]]
name = "chrono"
version = "0.4.4"
version = "0.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"num-integer 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -286,14 +285,6 @@ dependencies = [
"bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "cmake"
version = "0.1.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cc 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "color_quant"
version = "1.0.1"
@@ -303,9 +294,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
name = "config"
version = "0.1.0"
dependencies = [
"chrono 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
"chrono 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
"errors 0.1.0",
"globset 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"globset 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"highlighting 0.1.0",
"serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -316,11 +307,11 @@ dependencies = [
name = "content"
version = "0.1.0"
dependencies = [
"chrono 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
"chrono 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
"config 0.1.0",
"errors 0.1.0",
"front_matter 0.1.0",
"globset 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"globset 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rayon 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
"rendering 0.1.0",
"serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -333,7 +324,7 @@ dependencies = [

[[package]]
name = "cookie"
version = "0.10.1"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -480,7 +471,7 @@ version = "0.7.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"adler32 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
@@ -488,17 +479,6 @@ name = "dtoa"
version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"

[[package]]
name = "duct"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"lazycell 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
"os_pipe 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
"shared_child 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "either"
version = "1.5.0"
@@ -678,7 +658,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
name = "front_matter"
version = "0.1.0"
dependencies = [
"chrono 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
"chrono 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
"errors 0.1.0",
"lazy_static 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
"regex 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -777,22 +757,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index"

[[package]]
name = "globset"
version = "0.4.0"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"aho-corasick 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)",
"fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
"regex 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "gutenberg"
version = "0.4.0"
dependencies = [
"actix-web 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
"chrono 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
"actix-web 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
"chrono 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
"clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)",
"content 0.1.0",
"ctrlc 3.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -813,11 +793,11 @@ name = "h2"
version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
"bytes 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)",
"fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
"futures 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)",
"http 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
"http 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
"indexmap 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"slab 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -862,7 +842,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"

[[package]]
name = "http"
version = "0.1.7"
version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bytes 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -935,7 +915,7 @@ name = "image"
version = "0.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
"gif 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
"jpeg-decoder 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
"lzw 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1012,7 +992,7 @@ name = "jpeg-decoder"
version = "0.1.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
"rayon 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
]

@@ -1061,7 +1041,7 @@ version = "0.1.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"adler32 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
"crc 1.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
]

@@ -1299,19 +1279,6 @@ dependencies = [
"libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "nix"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"bytes 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)",
"cfg-if 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"gcc 0.3.54 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
"void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "nix"
version = "0.11.0"
@@ -1404,16 +1371,15 @@ dependencies = [
"bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
"onig_sys 68.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"onig_sys 68.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "onig_sys"
version = "68.0.1"
version = "68.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cmake 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)",
"duct 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
"cc 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -1441,15 +1407,6 @@ dependencies = [
"vcpkg 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "os_pipe"
version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"nix 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "owning_ref"
version = "0.3.3"
@@ -1553,7 +1510,7 @@ name = "phf_shared"
version = "0.7.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"siphasher 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"siphasher 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
]

@@ -1568,8 +1525,8 @@ version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"base64 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"chrono 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
"chrono 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)",
"xml-rs 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -1725,18 +1682,6 @@ dependencies = [
"redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "regex"
version = "0.2.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"aho-corasick 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)",
"memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"regex-syntax 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)",
"thread_local 0.3.5 (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"
version = "1.0.2"
@@ -1754,14 +1699,6 @@ name = "regex-syntax"
version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"

[[package]]
name = "regex-syntax"
version = "0.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"ucd-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "regex-syntax"
version = "0.6.2"
@@ -1983,19 +1920,9 @@ name = "sha1"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"

[[package]]
name = "shared_child"
version = "0.3.2"
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.42 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "siphasher"
version = "0.2.2"
version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"

[[package]]
@@ -2268,7 +2195,7 @@ name = "tera"
version = "0.11.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"chrono 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
"chrono 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
"error-chain 0.12.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.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -2535,7 +2462,7 @@ name = "trust-dns-proto"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
"error-chain 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
"futures 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)",
"idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -2778,7 +2705,7 @@ name = "ws"
version = "0.7.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
"bytes 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)",
"httparse 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -2815,9 +2742,9 @@ dependencies = [
]

[metadata]
"checksum actix 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "28b4c697e6e63280f874c1d3e30c476de1cc589efd91b32b748a17808cb4adc3"
"checksum actix-web 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1bf2bc88dea9c852b9e2fc1c509a422907e05e83d06bef510e8f493b3396f01a"
"checksum actix_derive 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c4b1dc922654b9aca7a8a31eab875fde804fa9fbd67f220f2e457787b23590f2"
"checksum actix 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0470f5163ac229ed0329f6abbd6f775591b06ec5ecbf2f2589c16ab8bd6f76b8"
"checksum actix-web 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2b79aac53ea4922b114768413037f2d75d4ab039646bbf700ce152bb2678b6eb"
"checksum actix_derive 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5b9d1525ef45e5e021f0b93dace157dcab5d792acb4cc78f3213787d65e2bb92"
"checksum adler32 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7e522997b529f05601e05166c07ed17789691f562762c7f3b987263d2dedee5c"
"checksum aho-corasick 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c1c6d463cbe7ed28720b5b489e7c083eeb8f90d08be2a0d6bb9e1ffea9ce1afa"
"checksum ammonia 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a8b93ecb80665873703bf3b0a77f369c96b183d8e0afaf30a3ff5ff07dfc6409"
@@ -2835,17 +2762,16 @@ dependencies = [
"checksum bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5"
"checksum bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d0c54bb8f454c567f21197eefcdbf5679d0bd99f2ddbe52e84c77061952e6789"
"checksum build_const 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "39092a32794787acd8525ee150305ff051b0aa6cc2abaf193924f5ab05425f39"
"checksum byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "74c0b906e9446b0a2e4f760cdb3fa4b2c48cdc6db8766a845c54b6ff063fd2e9"
"checksum byteorder 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8389c509ec62b9fe8eca58c502a0acaf017737355615243496cde4994f8fa4f9"
"checksum bytes 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c129aff112dcc562970abb69e2508b40850dd24c274761bb50fb8a0067ba6c27"
"checksum bytes 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e178b8e0e239e844b083d5a0d4a156b2654e67f9f80144d48398fcd736a24fb8"
"checksum cc 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)" = "2119ea4867bd2b8ed3aecab467709720b2d55b1bcfe09f772fd68066eaf15275"
"checksum cfg-if 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "efe5c877e17a9c717a0bf3613b2709f723202c4e4675cc8f12926ded29bcb17e"
"checksum chrono 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "6962c635d530328acc53ac6a955e83093fedc91c5809dfac1fa60fa470830a37"
"checksum chrono 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e48d85528df61dc964aa43c5f6ca681a19cfa74939b2348d204bd08a981f2fb0"
"checksum clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b957d88f4b6a63b9d70d5f454ac8011819c6efa7727858f458ab71c756ce2d3e"
"checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f"
"checksum cmake 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)" = "95470235c31c726d72bf2e1f421adc1e65b9d561bf5529612cbe1a72da1467b3"
"checksum color_quant 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0dbbb57365263e881e805dc77d94697c9118fd94d8da011240555aa7b23445bd"
"checksum cookie 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "746858cae4eae40fff37e1998320068df317bc247dc91a67c6cfa053afdc2abb"
"checksum cookie 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1465f8134efa296b4c19db34d909637cb2bf0f7aaf21299e23e18fa29ac557cf"
"checksum core-foundation 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "25bfd746d203017f7d5cbd31ee5d8e17f94b6521c7af77ece6c9e4b2d4b16c67"
"checksum core-foundation-sys 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "065a5d7ffdcbc8fa145d6f0746f3555025b9097a9e9cda59f7467abae670c78d"
"checksum crc 1.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d663548de7f5cca343f1e0a48d14dcfb0e9eb4e079ec58883b7251539fa10aeb"
@@ -2862,7 +2788,6 @@ dependencies = [
"checksum dbghelp-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "97590ba53bcb8ac28279161ca943a924d1fd4a8fb3fa63302591647c4fc5b850"
"checksum deflate 0.7.18 (registry+https://github.com/rust-lang/crates.io-index)" = "32c8120d981901a9970a3a1c97cf8b630e0fa8c3ca31e75b6fd6fd5f9f427b31"
"checksum dtoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6d301140eb411af13d3115f9a562c85cc6b541ade9dfa314132244aaee7489dd"
"checksum duct 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "166298c17c5b4fe5997b962c2f22e887c7c5adc44308eb9103ce5b66af45a423"
"checksum either 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3be565ca5c557d7f59e7cfcf1844f9e3033650c929c6566f511e8005f205c1d0"
"checksum elasticlunr-rs 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4837d77a1e157489a3933b743fd774ae75074e0e390b2b7f071530048a0d87ee"
"checksum encoding 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "6b0d943856b990d12d3b55b359144ff341533e516d94098b1d3fc1ac666d36ec"
@@ -2895,12 +2820,12 @@ dependencies = [
"checksum getopts 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)" = "0a7292d30132fb5424b354f5dc02512a86e4c516fe544bb7a25e7f266951b797"
"checksum gif 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ff3414b424657317e708489d2857d9575f4403698428b040b609b9d1c1a84a2c"
"checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb"
"checksum globset 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "142754da2c9b3722affd909f9e27f2a6700a7a303f362971e0a74c652005a43d"
"checksum globset 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8e49edbcc9c7fc5beb8c0a54e7319ff8bed353a2b55e85811c6281188c2a6c84"
"checksum h2 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "6229ac66d3392dd83288fe04defd4b353354b15bbe07820d53dda063a736afcc"
"checksum hostname 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "21ceb46a83a85e824ef93669c8b390009623863b5c195d1ba747292c0c72f94e"
"checksum html5ever 0.22.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b04478cf718862650a0bf66acaf8f2f8c906fbc703f35c916c1f4211b069a364"
"checksum htmlescape 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e9025058dae765dee5070ec375f591e2ba14638c63feff74f13805a72e523163"
"checksum http 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "4fbced8864b04c030eebcb7d0dc3a81ba5231ac559f5116a29a8ba83ecee22cd"
"checksum http 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "0d7f7b919d476c052ff46833ac89aaf205726da8133dae61facad50ec4c9eaec"
"checksum httparse 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7b6288d7db100340ca12873fd4d08ad1b8f206a9457798dfb17c018a33fee540"
"checksum humansize 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b6cab2627acfc432780848602f3f558f7e9dd427352224b0d9324025796d2a5e"
"checksum hyper 0.11.27 (registry+https://github.com/rust-lang/crates.io-index)" = "34a590ca09d341e94cddf8e5af0bbccde205d5fbc2fa3c09dd67c7f85cea59d7"
@@ -2946,7 +2871,6 @@ dependencies = [
"checksum native-tls 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f74dbadc8b43df7864539cedb7bc91345e532fdd913cfdc23ad94f4d2d40fbc0"
"checksum net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "42550d9fb7b6684a6d404d9fa7250c2eb2646df731d1c06afc06dcee9e1bcf88"
"checksum new_debug_unreachable 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0cdc457076c78ab54d5e0d6fa7c47981757f1e34dc39ff92787f217dede586c4"
"checksum nix 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b7fd5681d13fda646462cfbd4e5f2051279a89a544d50eb98c365b507246839f"
"checksum nix 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d37e713a259ff641624b6cb20e3b12b2952313ba36b6823c0f16e6cfd9e5de17"
"checksum nix 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bfb3ddedaa14746434a02041940495bf11325c22f6d36125d3bdd56090d50a79"
"checksum nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "9a2228dca57108069a5262f2ed8bd2e82496d2e074a06d1ccc7ce1687b6ae0a2"
@@ -2958,10 +2882,9 @@ dependencies = [
"checksum num-traits 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "630de1ef5cc79d0cdd78b7e33b81f083cbfe90de0f4b2b2f07f905867c70e9fe"
"checksum num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c51a3322e4bca9d212ad9a158a02abc6934d005490c054a2778df73a70aa0a30"
"checksum onig 3.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f5eeb268a4620c74ea5768c6d2ccd492d60a47a8754666b91a46bfc35cd4d1ba"
"checksum onig_sys 68.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5c6be7c4f985508684e54f18dd37f71e66f3e1ad9318336a520d7e42f0d3ea8e"
"checksum onig_sys 68.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "48b1fc88a091cf46a8ec67a3cd3ffd55f75d3bed741c76f253d78746ec43602b"
"checksum openssl 0.9.24 (registry+https://github.com/rust-lang/crates.io-index)" = "a3605c298474a3aa69de92d21139fb5e2a81688d308262359d85cdd0d12a7985"
"checksum openssl-sys 0.9.33 (registry+https://github.com/rust-lang/crates.io-index)" = "d8abc04833dcedef24221a91852931df2f63e3369ae003134e70aff3645775cc"
"checksum os_pipe 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "934868c3f86ed7a39ef63d88edeac5bd49a0c843192651900e9ce1178cbbf157"
"checksum owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cdf84f41639e037b484f93433aa3897863b561ed65c6e59c7073d7c561710f37"
"checksum parking_lot 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d4d05f1349491390b1730afba60bb20d55761bef489a954546b58b4b34e1e2ac"
"checksum parking_lot 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "69376b761943787ebd5cc85a5bc95958651a22609c5c1c2b65de21786baec72b"
@@ -2992,10 +2915,8 @@ dependencies = [
"checksum rayon-core 1.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b055d1e92aba6877574d8fe604a63c8b5df60f60e5982bf7ccbb1338ea527356"
"checksum redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "c214e91d3ecf43e9a4e41e578973adeb14b474f2bee858742d127af75a0112b1"
"checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76"
"checksum regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9329abc99e39129fcceabd24cf5d85b4671ef7c29c50e972bc5afe32438ec384"
"checksum regex 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "5bbbea44c5490a1e84357ff28b7d518b4619a159fed5d25f6c1de2d19cc42814"
"checksum regex-syntax 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "8e931c58b93d86f080c734bfd2bce7dd0079ae2331235818133c8be7f422e20e"
"checksum regex-syntax 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7d707a4fa2637f2dca2ef9fd02225ec7661fe01a53623c1e6515b6916511f7a7"
"checksum regex-syntax 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "747ba3b235651f6e2f67dfa8bcdcd073ddb7c243cb21c442fc12395dfcac212d"
"checksum relay 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1576e382688d7e9deecea24417e350d3062d97e32e45d70b1cde65994ff1489a"
"checksum remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3488ba1b9a2084d38645c4c08276a1752dcbf2c7130d74f1569681ad5d2799c5"
@@ -3018,8 +2939,7 @@ dependencies = [
"checksum serde_json 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)" = "c3c6908c7b925cd6c590358a4034de93dbddb20c45e1d021931459fd419bf0e2"
"checksum serde_urlencoded 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e703cef904312097cfceab9ce131ff6bbe09e8c964a0703345a5f49238757bc1"
"checksum sha1 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d"
"checksum shared_child 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bcd5e483b3475af9bc2a35311c2f3bbf0bd98fde91410ab15a0d4ba3c3127b4e"
"checksum siphasher 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0df90a788073e8d0235a67e50441d47db7c8ad9debd91cbf43736a2a92d36537"
"checksum siphasher 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0b8de496cf83d4ed58b6be86c3a275b8602f6ffe98d3024a869e124147a9a3ac"
"checksum slab 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d807fd58c4181bbabed77cb3b891ba9748241a552bcc5be698faaebefc54f46e"
"checksum slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "17b4fcaed89ab08ef143da37bc52adbcc04d4a69014f4c1208d6b51f0c47bc23"
"checksum slab 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fdeff4cd9ecff59ec7e3744cbca73dfe5ac35c2aedb2cfba8a1c715a18912e9d"


+ 1
- 1
components/config/src/lib.rs View File

@@ -12,7 +12,7 @@ use std::fs::File;
use std::io::prelude::*;
use std::path::{Path, PathBuf};

use toml::{Value as Toml};
use toml::Value as Toml;
use chrono::Utc;
use globset::{Glob, GlobSet, GlobSetBuilder};



+ 2
- 2
components/config/src/theme.rs View File

@@ -3,7 +3,7 @@ use std::fs::File;
use std::io::prelude::*;
use std::path::PathBuf;

use toml::{Value as Toml};
use toml::Value as Toml;

use errors::{Result, ResultExt};

@@ -37,7 +37,7 @@ impl Theme {
}


Ok(Theme {extra})
Ok(Theme { extra })
}

/// Parses a theme file from the given path


+ 2
- 2
components/content/benches/all.rs View File

@@ -23,8 +23,8 @@ fn create_pages(number: usize, sort_by: SortBy) -> Vec<Page> {
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); },
SortBy::Weight => { page.meta.weight = Some(i); }
SortBy::Order => { page.meta.order = Some(i); }
_ => (),
};
page.raw_content = r#"


+ 5
- 6
components/content/src/page.rs View File

@@ -162,7 +162,6 @@ impl Page {
}

Ok(page)

}

/// We need access to all pages url to render links relative to content
@@ -173,14 +172,14 @@ impl Page {
config,
&self.permalink,
permalinks,
anchor_insert
anchor_insert,
);

context.tera_context.add("page", self);

let res = render_content(
&self.raw_content.replacen("<!-- more -->", "<a name=\"continue-reading\"></a>", 1),
&context
&context,
).chain_err(|| format!("Failed to render content of {}", self.file.path.display()))?;
self.content = res.0;
self.toc = res.1;
@@ -437,7 +436,7 @@ Hello world

let res = Page::from_file(
nested_path.join("index.md").as_path(),
&Config::default()
&Config::default(),
);
assert!(res.is_ok());
let page = res.unwrap();
@@ -463,7 +462,7 @@ Hello world

let res = Page::from_file(
nested_path.join("index.md").as_path(),
&Config::default()
&Config::default(),
);
assert!(res.is_ok());
let page = res.unwrap();
@@ -494,7 +493,7 @@ Hello world

let res = Page::from_file(
nested_path.join("index.md").as_path(),
&config
&config,
);

assert!(res.is_ok());


+ 1
- 1
components/content/src/section.rs View File

@@ -91,7 +91,7 @@ impl Section {
return "index.html".to_string();
}
"section.html".to_string()
},
}
}
}



+ 8
- 9
components/content/src/sorting.rs View File

@@ -11,7 +11,7 @@ use front_matter::SortBy;
/// will be ignored.
pub fn sort_pages(pages: Vec<Page>, sort_by: SortBy) -> (Vec<Page>, Vec<Page>) {
if sort_by == SortBy::None {
return (pages, vec![]);
return (pages, vec![]);
}

let (mut can_be_sorted, cannot_be_sorted): (Vec<_>, Vec<_>) = pages
@@ -34,7 +34,7 @@ pub fn sort_pages(pages: Vec<Page>, sort_by: SortBy) -> (Vec<Page>, Vec<Page>) {
ord
}
})
},
}
SortBy::Weight => {
can_be_sorted.par_sort_unstable_by(|a, b| {
let ord = a.meta.weight().cmp(&b.meta.weight());
@@ -44,7 +44,7 @@ pub fn sort_pages(pages: Vec<Page>, sort_by: SortBy) -> (Vec<Page>, Vec<Page>) {
ord
}
})
},
}
_ => unreachable!()
};

@@ -86,13 +86,13 @@ pub fn populate_siblings(input: &[Page], sort_by: SortBy) -> Vec<Page> {
next_page.lighter = None;
next_page.heavier = None;
new_page.lighter = Some(Box::new(next_page));
},
}
SortBy::Date => {
next_page.earlier = None;
next_page.later = None;
new_page.later = Some(Box::new(next_page));
},
SortBy::None => {}
}
SortBy::None => ()
}
break;
}
@@ -118,14 +118,13 @@ pub fn populate_siblings(input: &[Page], sort_by: SortBy) -> Vec<Page> {
previous_page.lighter = None;
previous_page.heavier = None;
new_page.heavier = Some(Box::new(previous_page));
},
}
SortBy::Date => {
previous_page.earlier = None;
previous_page.later = None;
new_page.earlier = Some(Box::new(previous_page));
},
SortBy::None => {
}
SortBy::None => {}
}
break;
}


+ 0
- 1
components/front_matter/src/lib.rs View File

@@ -149,5 +149,4 @@ date = 2002-10-12"#;
let res = split_page_content(Path::new(""), content);
assert!(res.is_err());
}

}

+ 4
- 4
components/front_matter/src/page.rs View File

@@ -1,5 +1,5 @@
use std::collections::HashMap;
use std::result::{Result as StdResult};
use std::result::Result as StdResult;

use chrono::prelude::*;
use tera::{Map, Value};
@@ -35,7 +35,7 @@ fn convert_toml_date(table: Map<String, Value>) -> Value {
return Value::Object(new);
}
new.insert(k, convert_toml_date(o));
},
}
_ => { new.insert(k, v); }
}
}
@@ -52,8 +52,8 @@ fn fix_toml_dates(table: Map<String, Value>) -> Value {
match value {
Value::Object(mut o) => {
new.insert(key, convert_toml_date(o));
},
_ => { new.insert(key, value); },
}
_ => { new.insert(key, value); }
}
}



+ 2
- 2
components/highlighting/src/lib.rs View File

@@ -7,7 +7,7 @@ use syntect::parsing::SyntaxSet;
use syntect::highlighting::{ThemeSet, Theme};
use syntect::easy::HighlightLines;

thread_local!{
thread_local! {
pub static SYNTAX_SET: SyntaxSet = {
let mut ss: SyntaxSet = from_binary(include_bytes!("../../../sublime_syntaxes/newlines.packdump"));
ss.link_syntaxes();
@@ -15,7 +15,7 @@ thread_local!{
};
}

lazy_static!{
lazy_static! {
pub static ref THEME_SET: ThemeSet = from_binary(include_bytes!("../../../sublime_themes/all.themedump"));
}



+ 13
- 13
components/imageproc/src/lib.rs View File

@@ -25,7 +25,7 @@ use errors::{Result, ResultExt};

static RESIZED_SUBDIR: &'static str = "_processed_images";

lazy_static!{
lazy_static! {
pub static ref RESIZED_FILENAME: Regex = Regex::new(r#"([0-9a-f]{16})([0-9a-f]{2})[.]jpg"#).unwrap();
}

@@ -58,13 +58,13 @@ impl ResizeOp {
// Validate args:
match op {
"fit_width" => if width.is_none() {
return Err("op=\"fit_width\" requires a `width` argument".to_string().into())
return Err("op=\"fit_width\" requires a `width` argument".to_string().into());
},
"fit_height" => if height.is_none() {
return Err("op=\"fit_height\" requires a `height` argument".to_string().into())
return Err("op=\"fit_height\" requires a `height` argument".to_string().into());
},
"scale" | "fit" | "fill" => if width.is_none() || height.is_none() {
return Err(format!("op={} requires a `width` and `height` argument", op).into())
return Err(format!("op={} requires a `width` and `height` argument", op).into());
},
_ => return Err(format!("Invalid image resize operation: {}", op).into())
};
@@ -121,7 +121,7 @@ impl From<ResizeOp> for u8 {
impl Hash for ResizeOp {
fn hash<H: Hasher>(&self, hasher: &mut H) {
hasher.write_u8(u8::from(*self));
if let Some(w) = self.width() { hasher.write_u32(w); }
if let Some(w) = self.width() { hasher.write_u32(w); }
if let Some(h) = self.height() { hasher.write_u32(h); }
}
}
@@ -168,7 +168,7 @@ impl ImageOp {

let src_path = content_path.join(&self.source);
if !ufs::file_stale(&src_path, target_path) {
return Ok(())
return Ok(());
}

let mut img = image::open(&src_path)?;
@@ -210,7 +210,7 @@ impl ImageOp {
img.crop(offset_w, offset_h, crop_w, crop_h)
.resize_exact(w, h, RESIZE_FILTER)
}
},
}
};

let mut f = File::create(target_path)?;
@@ -251,9 +251,9 @@ impl Processor {

fn resized_url(base_url: &str) -> String {
if base_url.ends_with('/') {
format!("{}{}", base_url, RESIZED_SUBDIR)
format!("{}{}", base_url, RESIZED_SUBDIR)
} else {
format!("{}/{}", base_url, RESIZED_SUBDIR)
format!("{}/{}", base_url, RESIZED_SUBDIR)
}
}

@@ -275,7 +275,7 @@ impl Processor {
HEntry::Vacant(entry) => {
entry.insert(img_op);
return 0;
},
}
}

// If we get here, that means a hash collision.
@@ -342,7 +342,7 @@ impl Processor {
if let Some(capts) = RESIZED_FILENAME.captures(filename.as_ref()) {
let hash = u64::from_str_radix(capts.get(1).unwrap().as_str(), 16).unwrap();
let collision_id = u32::from_str_radix(
capts.get(2).unwrap().as_str(), 16
capts.get(2).unwrap().as_str(), 16,
).unwrap();

if collision_id > 0 || !self.img_ops.contains_key(&hash) {
@@ -364,8 +364,8 @@ impl Processor {
op.perform(&self.content_path, &target)
.chain_err(|| format!("Failed to process image: {}", op.source))
})
.fold(|| Ok(()), Result::and)
.reduce(|| Ok(()), Result::and)
.fold(|| Ok(()), Result::and)
.reduce(|| Ok(()), Result::and)
}
}



+ 2
- 2
components/link_checker/src/lib.rs View File

@@ -5,7 +5,7 @@ extern crate lazy_static;
use std::collections::HashMap;
use std::error::Error;
use std::sync::{Arc, RwLock};
use reqwest::{StatusCode};
use reqwest::StatusCode;


#[derive(Clone, Debug, PartialEq)]
@@ -48,7 +48,7 @@ lazy_static! {

pub fn check_url(url: &str) -> LinkResult {
{
let guard = LINKS.read().unwrap();
let guard = LINKS.read().unwrap();
if let Some(res) = guard.get(url) {
return res.clone();
}


+ 6
- 6
components/pagination/src/lib.rs View File

@@ -39,7 +39,7 @@ pub struct Pager<'a> {
/// Path to that page
path: String,
/// All pages for the pager
pages: Vec<&'a Page>
pages: Vec<&'a Page>,
}

impl<'a> Pager<'a> {
@@ -187,7 +187,7 @@ impl<'a> Paginator<'a> {
"pagers",
to_value(
&self.pagers.iter().map(|p| p.clone_without_pages()).collect::<Vec<_>>()
).unwrap()
).unwrap(),
);

// Variables for this specific page
@@ -217,11 +217,11 @@ impl<'a> Paginator<'a> {
PaginationRoot::Section(s) => {
context.add("section", &s);
s.get_template_name()
},
}
PaginationRoot::Taxonomy(t) => {
context.add("taxonomy", &t.kind);
format!("{}/single.html", t.kind.name)
},
}
};
context.add("current_url", &pager.permalink);
context.add("current_path", &pager.path);
@@ -238,7 +238,7 @@ mod tests {

use front_matter::SectionFrontMatter;
use content::{Page, Section};
use config::{Taxonomy as TaxonomyConfig};
use config::Taxonomy as TaxonomyConfig;
use taxonomies::{Taxonomy, TaxonomyItem};

use super::Paginator;
@@ -348,7 +348,7 @@ mod tests {
permalink: "https://vincent.is/tags/something/".to_string(),
pages,
};
let taxonomy = Taxonomy {kind: taxonomy_def, items: vec![taxonomy_item.clone()]};
let taxonomy = Taxonomy { kind: taxonomy_def, items: vec![taxonomy_item.clone()] };
let paginator = Paginator::from_taxonomy(&taxonomy, &taxonomy_item);
assert_eq!(paginator.pagers.len(), 2);



+ 13
- 13
components/rebuild/src/lib.rs View File

@@ -16,7 +16,7 @@ use front_matter::{PageFrontMatter, SectionFrontMatter};
pub fn find_parent_section<'a>(site: &'a Site, page: &Page) -> Option<&'a Section> {
for section in site.sections.values() {
if section.is_child_page(&page.file.path) {
return Some(section)
return Some(section);
}
}

@@ -149,18 +149,18 @@ fn handle_section_editing(site: &mut Site, path: &Path) -> Result<()> {
SectionChangesNeeded::Sort => {
site.sort_sections_pages(Some(path));
site.register_tera_global_fns();
},
}
SectionChangesNeeded::Render => site.render_section(&site.sections[path], false)?,
SectionChangesNeeded::RenderWithPages => site.render_section(&site.sections[path], true)?,
// not a common enough operation to make it worth optimizing
SectionChangesNeeded::Delete => {
site.populate_sections();
site.build()?;
},
}
};
}
return Ok(());
},
}
// New section, only render that one
None => {
site.populate_sections();
@@ -198,7 +198,7 @@ fn handle_page_editing(site: &mut Site, path: &Path) -> Result<()> {
// I can't think of a valid usecase where you would need the content
// of a page through a global fn so it's commented out for now
// site.register_tera_global_fns();
return site.render_page(& site.pages[path]);
return site.render_page(&site.pages[path]);
}

// Front matter changed
@@ -210,7 +210,7 @@ fn handle_page_editing(site: &mut Site, path: &Path) -> Result<()> {
site.populate_taxonomies()?;
site.register_tera_global_fns();
site.render_taxonomies()?;
},
}
PageChangesNeeded::Sort => {
let section_path = match find_parent_section(site, &site.pages[path]) {
Some(s) => s.file.path.clone(),
@@ -223,7 +223,7 @@ fn handle_page_editing(site: &mut Site, path: &Path) -> Result<()> {
site.sort_sections_pages(Some(&section_path));
site.register_tera_global_fns();
site.render_index()?;
},
}
PageChangesNeeded::Render => {
if !sections_populated {
site.populate_sections();
@@ -232,11 +232,11 @@ fn handle_page_editing(site: &mut Site, path: &Path) -> Result<()> {
site.register_tera_global_fns();
render_parent_section!(site, path);
site.render_page(&site.pages[path])?;
},
}
};
}
Ok(())
},
}
// It's a new page!
None => {
site.populate_sections();
@@ -289,7 +289,7 @@ pub fn after_content_change(site: &mut Site, path: &Path) -> Result<()> {
handle_page_editing(site, path)
}
} else {
if index.exists() {
if index.exists() {
handle_page_editing(site, &index)
} else {
Ok(())
@@ -310,7 +310,7 @@ pub fn after_template_change(site: &mut Site, path: &Path) -> Result<()> {
"page.html" => {
site.render_sections()?;
site.render_orphan_pages()
},
}
"section.html" => site.render_sections(),
// Either the index or some unknown template changed
// We can't really know what this change affects so rebuild all
@@ -327,7 +327,7 @@ pub fn after_template_change(site: &mut Site, path: &Path) -> Result<()> {
site.render_sections()?;
site.render_orphan_pages()?;
site.render_taxonomies()
},
}
}
}

@@ -339,7 +339,7 @@ mod tests {
use front_matter::{PageFrontMatter, SectionFrontMatter, SortBy};
use super::{
find_page_front_matter_changes, find_section_front_matter_changes,
PageChangesNeeded, SectionChangesNeeded
PageChangesNeeded, SectionChangesNeeded,
};

#[test]


+ 0
- 1
components/rendering/src/context.rs View File

@@ -35,5 +35,4 @@ impl<'a> RenderContext<'a> {
config,
}
}

}

+ 1
- 1
components/rendering/src/lib.rs View File

@@ -32,7 +32,7 @@ pub use table_of_contents::Header;
pub use shortcode::render_shortcodes;
pub use context::RenderContext;

pub fn render_content(content: &str, context: &RenderContext) -> Result<(String, Vec<Header>)> {
pub fn render_content(content: &str, context: &RenderContext) -> Result<(String, Vec<Header>)> {
// Don't do anything if there is nothing like a shortcode in the content
if content.contains("{{") || content.contains("{%") {
let rendered = render_shortcodes(content, context)?;


+ 11
- 11
components/rendering/src/markdown.rs View File

@@ -90,7 +90,7 @@ pub fn markdown_to_html(content: &str, context: &RenderContext) -> Result<(Strin

// Business as usual
Event::Text(text)
},
}
Event::Start(Tag::CodeBlock(ref info)) => {
if !context.config.highlight_code {
return Event::Html(Owned("<pre><code>".to_string()));
@@ -100,15 +100,15 @@ pub fn markdown_to_html(content: &str, context: &RenderContext) -> Result<(Strin
highlighter = Some(get_highlighter(&theme, info));
let snippet = start_coloured_html_snippet(theme);
Event::Html(Owned(snippet))
},
}
Event::End(Tag::CodeBlock(_)) => {
if !context.config.highlight_code {
return Event::Html(Owned("</code></pre>\n".to_string()))
return Event::Html(Owned("</code></pre>\n".to_string()));
}
// reset highlight and close the code block
highlighter = None;
Event::Html(Owned("</pre>".to_string()))
},
}
Event::Start(Tag::Image(src, title)) => {
if is_colocated_asset_link(&src) {
return Event::Start(
@@ -120,7 +120,7 @@ pub fn markdown_to_html(content: &str, context: &RenderContext) -> Result<(Strin
}

Event::Start(Tag::Image(src, title))
},
}
Event::Start(Tag::Link(link, title)) => {
// A few situations here:
// - it could be a relative link (starting with `./`)
@@ -166,33 +166,33 @@ pub fn markdown_to_html(content: &str, context: &RenderContext) -> Result<(Strin
}

Event::Start(Tag::Link(Owned(fixed_link), title))
},
}
Event::End(Tag::Link(_, _)) => {
if in_header {
temp_header.push("</a>");
return Event::Html(Owned(String::new()));
}
event
},
}
Event::Start(Tag::Code) => {
if in_header {
temp_header.push("<code>");
return Event::Html(Owned(String::new()));
}
event
},
}
Event::End(Tag::Code) => {
if in_header {
temp_header.push("</code>");
return Event::Html(Owned(String::new()));
}
event
},
}
Event::Start(Tag::Header(num)) => {
in_header = true;
temp_header = TempHeader::new(num);
Event::Html(Owned(String::new()))
},
}
Event::End(Tag::Header(_)) => {
// End of a header, reset all the things and return the stringified
// version of the header
@@ -202,7 +202,7 @@ pub fn markdown_to_html(content: &str, context: &RenderContext) -> Result<(Strin
headers.push(temp_header.clone());
temp_header = TempHeader::default();
Event::Html(Owned(val))
},
}
_ => event,
}
});


+ 19
- 21
components/rendering/src/shortcode.rs View File

@@ -7,7 +7,7 @@ use ::context::RenderContext;

// This include forces recompiling this source file if the grammar file changes.
// Uncomment it when doing changes to the .pest file
const _GRAMMAR: &str = include_str!("content.pest");
const _GRAMMAR: &str = include_str!("content.pest");

#[derive(Parser)]
#[grammar = "content.pest"]
@@ -35,10 +35,10 @@ fn parse_literal(pair: Pair<Rule>) -> Value {
Rule::string => val = Some(Value::String(replace_string_markers(p.as_str()))),
Rule::float => {
val = Some(to_value(p.as_str().parse::<f64>().unwrap()).unwrap());
},
}
Rule::int => {
val = Some(to_value(p.as_str().parse::<i64>().unwrap()).unwrap());
},
}
_ => unreachable!("Unknown literal: {:?}", p)
};
}
@@ -53,14 +53,14 @@ fn parse_shortcode_call(pair: Pair<Rule>) -> (String, Map<String, Value>) {

for p in pair.into_inner() {
match p.as_rule() {
Rule::ident => { name = Some(p.into_span().as_str().to_string()); },
Rule::ident => { name = Some(p.into_span().as_str().to_string()); }
Rule::kwarg => {
let mut arg_name = None;
let mut arg_val = None;
for p2 in p.into_inner() {
match p2.as_rule() {
Rule::ident => { arg_name = Some(p2.into_span().as_str().to_string()); },
Rule::literal => { arg_val = Some(parse_literal(p2)); },
Rule::ident => { arg_name = Some(p2.into_span().as_str().to_string()); }
Rule::literal => { arg_val = Some(parse_literal(p2)); }
Rule::array => {
let mut vals = vec![];
for p3 in p2.into_inner() {
@@ -70,13 +70,13 @@ fn parse_shortcode_call(pair: Pair<Rule>) -> (String, Map<String, Value>) {
}
}
arg_val = Some(Value::Array(vals));
},
}
_ => unreachable!("Got something unexpected in a kwarg: {:?}", p2),
}
}

args.insert(arg_name.unwrap(), arg_val.unwrap());
},
}
_ => unreachable!("Got something unexpected in a shortcode: {:?}", p)
}
}
@@ -129,7 +129,7 @@ pub fn render_shortcodes(content: &str, context: &RenderContext) -> Result<Strin
}
});
bail!("{}", fancy_e);
},
}
};

// We have at least a `page` pair
@@ -139,7 +139,7 @@ pub fn render_shortcodes(content: &str, context: &RenderContext) -> Result<Strin
Rule::inline_shortcode => {
let (name, args) = parse_shortcode_call(p);
res.push_str(&render_shortcode(name, args, context, None)?);
},
}
Rule::shortcode_with_body => {
let mut inner = p.into_inner();
// 3 items in inner: call, body, end
@@ -147,14 +147,14 @@ pub fn render_shortcodes(content: &str, context: &RenderContext) -> Result<Strin
let (name, args) = parse_shortcode_call(inner.next().unwrap());
let body = inner.next().unwrap().into_span().as_str();
res.push_str(&render_shortcode(name, args, context, Some(body))?);
},
}
Rule::ignored_inline_shortcode => {
res.push_str(
&p.into_span().as_str()
.replacen("{{/*", "{{", 1)
.replacen("*/}}", "}}", 1)
);
},
res.push_str(
&p.into_span().as_str()
.replacen("{{/*", "{{", 1)
.replacen("*/}}", "}}", 1)
);
}
Rule::ignored_shortcode_with_body => {
for p2 in p.into_inner() {
match p2.as_rule() {
@@ -164,12 +164,12 @@ pub fn render_shortcodes(content: &str, context: &RenderContext) -> Result<Strin
.replacen("{%/*", "{%", 1)
.replacen("*/%}", "%}", 1)
);
},
}
Rule::text_in_ignored_body_sc => res.push_str(p2.into_span().as_str()),
_ => unreachable!("Got something weird in an ignored shortcode: {:?}", p2),
}
}
},
}
_ => unreachable!("unexpected page rule: {:?}", p.as_rule()),
}
}
@@ -244,7 +244,6 @@ mod tests {
r#"{% youtube() %}
Some text
{% end %}"#,

r#"{% youtube(id=1,
autoplay=true, url='hey') %}
Some text
@@ -261,7 +260,6 @@ mod tests {
r#"{%/* youtube() */%}
Some text
{%/* end */%}"#,

r#"{%/* youtube(id=1,
autoplay=true, url='hey') */%}
Some text


+ 3
- 3
components/rendering/src/table_of_contents.rs View File

@@ -58,9 +58,9 @@ impl TempHeader {
};

match insert_anchor {
InsertAnchor::None => format!("<h{lvl} id=\"{id}\">{t}</h{lvl}>\n", lvl=self.level, t=self.title, id=self.id),
InsertAnchor::Left => format!("<h{lvl} id=\"{id}\">{a}{t}</h{lvl}>\n", lvl=self.level, a=anchor_link, t=self.title, id=self.id),
InsertAnchor::Right => format!("<h{lvl} id=\"{id}\">{t}{a}</h{lvl}>\n", lvl=self.level, a=anchor_link, t=self.title, id=self.id),
InsertAnchor::None => format!("<h{lvl} id=\"{id}\">{t}</h{lvl}>\n", lvl = self.level, t = self.title, id = self.id),
InsertAnchor::Left => format!("<h{lvl} id=\"{id}\">{a}{t}</h{lvl}>\n", lvl = self.level, a = anchor_link, t = self.title, id = self.id),
InsertAnchor::Right => format!("<h{lvl} id=\"{id}\">{t}{a}</h{lvl}>\n", lvl = self.level, a = anchor_link, t = self.title, id = self.id),
}
}
}


+ 15
- 15
components/site/src/lib.rs View File

@@ -287,10 +287,10 @@ impl Site {
/// Adds global fns that are to be available to shortcodes while rendering markdown
pub fn register_early_global_fns(&mut self) {
self.tera.register_global_function(
"get_url", global_fns::make_get_url(self.permalinks.clone(), self.config.clone())
"get_url", global_fns::make_get_url(self.permalinks.clone(), self.config.clone()),
);
self.tera.register_global_function(
"resize_image", global_fns::make_resize_image(self.imageproc.clone())
"resize_image", global_fns::make_resize_image(self.imageproc.clone()),
);
}

@@ -300,7 +300,7 @@ impl Site {
self.tera.register_global_function("get_section", global_fns::make_get_section(&self.sections));
self.tera.register_global_function(
"get_taxonomy",
global_fns::make_get_taxonomy(self.taxonomies.clone())
global_fns::make_get_taxonomy(self.taxonomies.clone()),
);
}

@@ -419,7 +419,7 @@ impl Site {
.filter(|p| !p.is_draft())
.cloned()
.collect::<Vec<_>>()
.as_slice()
.as_slice(),
)?;

Ok(())
@@ -430,7 +430,7 @@ impl Site {
if let Some(port) = self.live_reload {
return html.replace(
"</body>",
&format!(r#"<script src="/livereload.js?port={}&mindelay=10"></script></body>"#, port)
&format!(r#"<script src="/livereload.js?port={}&mindelay=10"></script></body>"#, port),
);
}

@@ -443,7 +443,7 @@ impl Site {
if let Some(ref theme) = self.config.theme {
copy_directory(
&self.base_path.join("themes").join(theme).join("static"),
&self.output_path
&self.output_path,
)?;
}
// We're fine with missing static folders
@@ -656,7 +656,7 @@ impl Site {
context.insert("config", &self.config);
create_file(
&self.output_path.join("404.html"),
&render_template("404.html", &self.tera, &context, &self.config.theme)?
&render_template("404.html", &self.tera, &context, &self.config.theme)?,
)
}

@@ -665,7 +665,7 @@ impl Site {
ensure_directory_exists(&self.output_path)?;
create_file(
&self.output_path.join("robots.txt"),
&render_template("robots.txt", &self.tera, &Context::new(), &self.config.theme)?
&render_template("robots.txt", &self.tera, &Context::new(), &self.config.theme)?,
)
}

@@ -681,7 +681,7 @@ impl Site {

fn render_taxonomy(&self, taxonomy: &Taxonomy) -> Result<()> {
if taxonomy.items.is_empty() {
return Ok(())
return Ok(());
}

ensure_directory_exists(&self.output_path)?;
@@ -698,7 +698,7 @@ impl Site {
// TODO: can we get rid of `clone()`?
self.render_rss_feed(
Some(item.pages.clone()),
Some(&PathBuf::from(format!("{}/{}", taxonomy.kind.name, item.slug)))
Some(&PathBuf::from(format!("{}/{}", taxonomy.kind.name, item.slug))),
)?;
}

@@ -739,9 +739,9 @@ impl Site {
context.add("pages", &pages);

let mut sections = self.sections
.values()
.map(|s| SitemapEntry::new(s.permalink.clone(), None))
.collect::<Vec<_>>();
.values()
.map(|s| SitemapEntry::new(s.permalink.clone(), None))
.collect::<Vec<_>>();
sections.sort_by(|a, b| a.permalink.cmp(&b.permalink));
context.add("sections", &sections);

@@ -789,7 +789,7 @@ impl Site {

let (sorted_pages, _) = sort_pages(pages, SortBy::Date);
context.add("last_build_date", &sorted_pages[0].meta.date.clone().map(|d| d.to_string()));
// limit to the last n elements
// limit to the last n elements
context.add("pages", &sorted_pages.iter().take(self.config.rss_limit).collect::<Vec<_>>());
context.add("config", &self.config);

@@ -866,7 +866,7 @@ impl Site {
pub fn render_index(&self) -> Result<()> {
self.render_section(
&self.sections[&self.content_path.join("_index.md")],
false
false,
)
}



+ 4
- 4
components/taxonomies/src/lib.rs View File

@@ -164,9 +164,9 @@ mod tests {
fn can_make_taxonomies() {
let mut config = Config::default();
config.taxonomies = vec![
Taxonomy {name: "categories".to_string(), ..Taxonomy::default()},
Taxonomy {name: "tags".to_string(), ..Taxonomy::default()},
Taxonomy {name: "authors".to_string(), ..Taxonomy::default()},
Taxonomy { name: "categories".to_string(), ..Taxonomy::default() },
Taxonomy { name: "tags".to_string(), ..Taxonomy::default() },
Taxonomy { name: "authors".to_string(), ..Taxonomy::default() },
];
let mut page1 = Page::default();
let mut taxo_page1 = HashMap::new();
@@ -234,7 +234,7 @@ mod tests {
fn errors_on_unknown_taxonomy() {
let mut config = Config::default();
config.taxonomies = vec![
Taxonomy {name: "authors".to_string(), ..Taxonomy::default()},
Taxonomy { name: "authors".to_string(), ..Taxonomy::default() },
];
let mut page1 = Page::default();
let mut taxo_page1 = HashMap::new();


+ 1
- 1
components/templates/src/filters.rs View File

@@ -51,7 +51,7 @@ pub fn base64_decode(value: Value, _: HashMap<String, Value>) -> TeraResult<Valu
mod tests {
use std::collections::HashMap;

use tera::{to_value};
use tera::to_value;

use super::{markdown, base64_decode, base64_encode};



+ 1
- 1
components/templates/src/global_fns.rs View File

@@ -258,7 +258,7 @@ mod tests {

#[test]
fn can_get_taxonomy() {
let taxo_config = TaxonomyConfig {name: "tags".to_string(), ..TaxonomyConfig::default()};
let taxo_config = TaxonomyConfig { name: "tags".to_string(), ..TaxonomyConfig::default() };
let tag = TaxonomyItem::new(
"Prog amming",
"tags",


+ 2
- 2
components/utils/src/fs.rs View File

@@ -99,7 +99,7 @@ pub fn file_stale<PS, PT>(p_source: PS, p_target: PT) -> bool where PS: AsRef<Pa
let p_source = p_source.as_ref();
let p_target = p_target.as_ref();

if ! p_target.exists() {
if !p_target.exists() {
return true;
}

@@ -125,7 +125,7 @@ mod tests {

use tempfile::tempdir;

use super::{find_related_assets};
use super::find_related_assets;

#[test]
fn can_find_related_assets() {


+ 1
- 1
components/utils/src/site.rs View File

@@ -26,7 +26,7 @@ pub fn resolve_internal_link(link: &str, permalinks: &HashMap<String, String>) -
} else {
Ok(p.to_string())
}
},
}
None => bail!(format!("Relative link {} not found.", link)),
}
}


+ 3
- 3
components/utils/src/templates.rs View File

@@ -37,13 +37,13 @@ pub fn render_template(name: &str, tera: &Tera, context: &Context, theme: &Optio
match name {
"index.html" | "section.html" => {
render_default_tpl!(name, "https://www.getgutenberg.io/documentation/templates/pages-sections/#section-variables")
},
}
"page.html" => {
render_default_tpl!(name, "https://www.getgutenberg.io/documentation/templates/pages-sections/#page-variables")
},
}
"single.html" | "list.html" => {
render_default_tpl!(name, "https://www.getgutenberg.io/documentation/templates/taxonomies/")
},
}
_ => bail!("Tried to render `{}` but the template wasn't found", name)
}
}


Loading…
Cancel
Save