Commit graph

39 commits

Author SHA1 Message Date
Chris Wong
e0c7fcf055 Initial stab at porting to new proc macro interface 2017-07-23 13:58:42 +12:00
Chris Wong
04eb61e870 Use docs.rs for hosting API documentation 2017-06-19 21:25:19 +12:00
Chris Wong
348712f3f4 Add #![doc(html_root_url = "...")] attribute 2017-05-13 14:16:41 +12:00
Chris Wong
dde603757d Rename PResult to ParseResult 2017-04-22 17:29:56 +12:00
Chris Wong
dfe721c6b7 Update to rustc 1.18.0-nightly (1785bca51 2017-04-21)
Closes 
2017-04-22 17:29:56 +12:00
Chris Wong
fe08789e3f Make PResult type private
Not sure why it was public in the first place
2017-02-11 17:19:12 +13:00
Chris Wong
c849d9efdf Use if_chain from crates.io 2016-12-29 12:20:08 +13:00
Chris Wong
f991ebaa78 Lint against PreEscaped("<!DOCTYPE html>")
See 
2016-12-27 21:27:54 +13:00
Chris Wong
7f7deb7af5 Remove #![feature(question_mark)]
Apparently that feature is stable now
2016-10-17 21:41:33 +13:00
Chris Wong
f12efe4299 Rewrite everything to use Strings instead of writers
After fiddling around with zero-allocation solutions, I concluded that
all non-allocating approaches are too annoying to work with in realistic
code. Using closures leads to yak-shaving with lifetimes; and because
Iron needs to take ownership of the response body we often end up
cloning the input data anyway.

Removing this constraint has let me simplify the entire system, removing
a net 300 lines from the library. The `html!` macro no longer takes a
writer, and instead returns a `PreEscaped<String>`. This means that the
result of an `html!` can be spliced directly into another `html!`,
removing the need for the `impl Template` rigmarole.

To rub it in, benchmarks show the new code is in fact *faster* than it
was before. How lovely.
2016-09-23 19:22:22 +12:00
Chris Wong
aded75f01f Add some juicy impl Trait niceness 2016-08-15 20:32:39 +12:00
Chris Wong
166296db30 Update Rust 2016-07-03 16:55:45 +12:00
Chris Wong
00ec443326 Update Rust
2016-04-27 12:10:37 +12:00
Chris Wong
8492259638 Use the new ? syntax (so purty) 2016-03-22 23:31:23 +13:00
Chris Wong
8d0ad20f74 Update Rust 2016-01-01 11:43:59 +13:00
Chris Wong
7cb4d61d5b Update Rust 2015-11-28 21:15:13 +11:00
Chris Wong
05b5d099fb Update Rust 2015-11-08 18:59:11 +13:00
Chris Wong
059b82e091 DON'T PANIC
Closes 
2015-09-15 13:38:32 +12:00
Chris Wong
6030eed9f7 Rename write_html! to html_utf8!
The new name makes it clear what the macro is doing: encoding the output
to UTF-8.
2015-09-12 14:21:01 +12:00
Chris Wong
ebbd5d2e54 Add a write_html! macro
This handles the common case of wrapping the stream in a `Utf8Writer`.
2015-09-07 19:46:06 +12:00
Chris Wong
28b1624f4c Rename write_html! to html!
It's more concise
2015-09-03 11:06:05 +12:00
Chris Wong
1badbd9df2 De-closureify the API
Closes 
2015-09-01 18:26:50 +12:00
Chris Wong
4653b2e2d8 Add html_debug! macro; remove print-expansion feature 2015-04-13 20:41:12 +12:00
Chris Wong
e5711929e3 print-expansion for all your expansion printing needs 2015-04-11 10:19:28 +12:00
Chris Wong
180becbee4 Coalesce the contents of blocks as well 2015-04-10 19:02:36 +12:00
Chris Wong
2aa687fc0f Update Rust 2015-03-29 19:37:26 +13:00
Chris Wong
74475f922b Update Rust 2015-03-01 20:07:50 -05:00
Chris Wong
bc305caf17 Epic refactor of doom, the third 2015-02-27 17:26:06 +13:00
Chris Wong
1c0d5e9c31 Make the renderer owned instead of borrowed 2015-02-07 17:48:09 +13:00
Chris Wong
e01af11eaa Update Rust 2015-02-02 20:53:47 +13:00
Chris Wong
77fa50fdef Remove the boolean dance 2015-01-12 16:46:12 +13:00
Chris Wong
270781b255 Show error on unexpected end of input
Without this error, rustc would treat our dummy result as a real one,
causing much pain.
2015-01-12 16:24:53 +13:00
Chris Wong
905edd0ae0 Rewrite parser again
Now it's some one-pass monstrosity oh noes
2015-01-10 21:29:58 +13:00
Chris Wong
4a03e09cbb Update Rust 2015-01-08 11:27:40 +13:00
Chris Wong
81cbfb9267 Use shiny new slicing syntax 2015-01-07 17:54:43 +13:00
Chris Wong
05c68067dd Rewrite the parser yay 2015-01-07 17:43:37 +13:00
Chris Wong
8b199d1c03 Generate closures rather than bare fns 2014-12-19 18:25:44 +13:00
Chris Wong
225fee6681 Add escaping 2014-12-19 12:33:02 +13:00
Chris Wong
9e8e2f652e Rename htmlthing to maud
rocks
2014-12-18 19:49:49 +13:00
Renamed from htmlthing_macros/src/lib.rs (Browse further)