This repository has been archived by the owner. It is now read-only.
Document html composability clearly (aka partials) #6
Conversation
Thanks for the PR! I like the approach you're taking here. |
partials.md
Outdated
|
||
Maud does not have a built-in concept of partials or sub templates. Instead, you can compose your markup with any function that returns `Markup`. | ||
|
||
The following uses a `header` and `footer` function that are used in the `page` function to return a final result. |
lambda-fairy
Aug 18, 2018
Owner
The following example?
The following example?
partials.md
Outdated
} | ||
/// The final Markup, including `header` and `footer`. | ||
pub fn page(title: &str) -> Markup { |
lambda-fairy
Aug 18, 2018
Owner
I think it's worth demonstrating that functions can accept Markup
values as well as return them.
See the first few lines of https://github.com/lfairy/karkinos/blob/master/src/views.rs
What do you think?
I think it's worth demonstrating that functions can accept Markup
values as well as return them.
See the first few lines of https://github.com/lfairy/karkinos/blob/master/src/views.rs
What do you think?
phansch
Aug 20, 2018
Author
Contributor
That makes sense 👍
That makes sense
partials.md
Outdated
@@ -0,0 +1,50 @@ | |||
# Partials | |||
|
|||
Maud does not have a built-in concept of partials or sub templates. Instead, you can compose your markup with any function that returns `Markup`. |
lambda-fairy
Aug 18, 2018
Owner
Sub-templates has a hyphen I think
Sub-templates has a hyphen I think
Thanks! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
When I was evaluating maud, I ran into the same issue as @max-frai regarding partials/sub templates. This documents that it's super easy to compose the templates using plain Rust functions.
Closes lambda-fairy/maud#133