-
Notifications
You must be signed in to change notification settings - Fork 46
Improve html docs #100
base: master
Are you sure you want to change the base?
Improve html docs #100
Conversation
What do you think about changing the numbered list (1. - 5.) to a bullet list? |
Sure, sounds good! |
@teymour-aldridge did you see my last changes? |
src/concepts/html/README.md
Outdated
{% hint style="info" %} | ||
The `html!` macro can reach easily the default recursion limit of the compiler. It is advised to bump its value if you encouter compilation errors. Use an attribute like `#![recursion_limit="1024"]` to bypass the problem. See the [official documentation](https://doc.rust-lang.org/reference/attributes/limits.html#the-recursion_limit-attribute) and [this Stack Overflow question](https://stackoverflow.com/questions/27454761/what-is-a-crate-attribute-and-where-do-i-add-it) for details. | ||
The [`html!`](https://docs.rs/yew/0.16.2/yew/macro.html.html) macro can reach easily the default recursion limit of the compiler. It is advised to bump its value if you encouter compilation errors. Use an attribute like `#![recursion_limit="1024"]` to bypass the problem. See the [official documentation](https://doc.rust-lang.org/reference/attributes/limits.html#the-recursion_limit-attribute) and [this Stack Overflow question](https://stackoverflow.com/questions/27454761/what-is-a-crate-attribute-and-where-do-i-add-it) for details. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The [`html!`](https://docs.rs/yew/0.16.2/yew/macro.html.html) macro can reach easily the default recursion limit of the compiler. It is advised to bump its value if you encouter compilation errors. Use an attribute like `#![recursion_limit="1024"]` to bypass the problem. See the [official documentation](https://doc.rust-lang.org/reference/attributes/limits.html#the-recursion_limit-attribute) and [this Stack Overflow question](https://stackoverflow.com/questions/27454761/what-is-a-crate-attribute-and-where-do-i-add-it) for details. | |
The [`html!`](https://docs.rs/yew/0.16.2/yew/macro.html.html) macro can easily exceed the default recursion limit of the compiler. It is advised to bump its value if you encouter compilation errors. Use an attribute like `#![recursion_limit="1024"]` to bypass the problem. See the [official documentation](https://doc.rust-lang.org/reference/attributes/limits.html#the-recursion_limit-attribute) and [this Stack Overflow question](https://stackoverflow.com/questions/27454761/what-is-a-crate-attribute-and-where-do-i-add-it) for details. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't really see what exactly the change was here.
What do you think about introducing a fix line length limit?
It's much easier to compare lines that are not broken over several lines.
I don't know what IDE you're using but in Emacs a keyboard shortcut realigns text to fit the defined width.
I just saw that latest
works in links instead of a concrete version number.
I think that's better than to update all links with each version increment.
I added a link in another file. I intended to create a new PR for that but missed that I had a type when I tried to switch the branch so it landed in this branch as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"can reach easily" => "can easily exceed"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll create an issue (and PR) about line lengths.
@zoechi I've suggested a few more improvements (really minor). |
Otherwise LGTM (looks good to me). |
Co-authored-by: Teymour Aldridge <42674621+teymour-aldridge@users.noreply.github.com>
Co-authored-by: Teymour Aldridge <42674621+teymour-aldridge@users.noreply.github.com>
Co-authored-by: Teymour Aldridge <42674621+teymour-aldridge@users.noreply.github.com>
I added another bullet that I couldn't find documentation for. |
- Quoted attribute values are taken literally. The value is set at compile-time and does not change at run-time. | ||
* `html! { <div> id="bar"</div> }` | ||
- Unquoted attribute values are interpreted as expressions and therefore have to be valid Rust expressions. | ||
* `let foo = "bar"; html! { <div id=foo></div> }` | ||
* `html! { <div id=String::from("foo") + "bar"></div> }` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit confusing because literals are also expressions. I'd prefer if we left these notes out
- Unquoted attribute values are interpreted as expressions and therefore have to be valid Rust expressions. | ||
* `let foo = "bar"; html! { <div id=foo></div> }` | ||
* `html! { <div id=String::from("foo") + "bar"></div> }` | ||
- HTML tags names need to start with a lowercase letter. Besides that every valid HTML tag name is allowed. If the tag name starts with an uppercase letter it is interpreted as component name and attributes are passed as component properties. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- HTML tags names need to start with a lowercase letter. Besides that every valid HTML tag name is allowed. If the tag name starts with an uppercase letter it is interpreted as component name and attributes are passed as component properties. | |
- Tag names that begin with a lowercase letter will be treated as the name of a DOM elements. | |
- Tag names that begin with an uppercase letter will be treated as a type implementing the `Component` trait and the attributes will be passed as component properties. |
No description provided.