Add a style guide for the docs (#323)
This commit is contained in:
parent
2f3d68c8a4
commit
ca860d09bd
3 changed files with 22 additions and 5 deletions
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
This directory contains the documentation for Maud.
|
This directory contains the documentation for Maud.
|
||||||
|
|
||||||
|
It is hosted at <https://maud.lambda.xyz>.
|
||||||
|
|
||||||
## Build
|
## Build
|
||||||
|
|
||||||
Build the documentation:
|
Build the documentation:
|
||||||
|
@ -14,6 +16,18 @@ You can also delete the build artifacts with:
|
||||||
|
|
||||||
make clean
|
make clean
|
||||||
|
|
||||||
|
## Style
|
||||||
|
|
||||||
|
- [Be brief][short].
|
||||||
|
- Use [semantic line breaks][sembr].
|
||||||
|
- American spelling.
|
||||||
|
- Parentheticals should use spaced en dashes –
|
||||||
|
like this –
|
||||||
|
not em dashes.
|
||||||
|
|
||||||
|
[short]: https://developers.google.com/tech-writing/one/short-sentences
|
||||||
|
[sembr]: https://sembr.org/
|
||||||
|
|
||||||
## Watch
|
## Watch
|
||||||
|
|
||||||
To ease editing,
|
To ease editing,
|
||||||
|
|
|
@ -89,9 +89,10 @@ html! {
|
||||||
|
|
||||||
## Optional attributes: `title=[Some("value")]`
|
## Optional attributes: `title=[Some("value")]`
|
||||||
|
|
||||||
Add optional attributes to an element using `attr=[value]` syntax, with *square*
|
Add optional attributes to an element using `attr=[value]` syntax,
|
||||||
brackets. These are only rendered if the value is `Some<T>`, and entirely
|
with *square* brackets.
|
||||||
omitted if the value is `None`.
|
These are only rendered if the value is `Some<T>`,
|
||||||
|
and entirely omitted if the value is `None`.
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
# let _ = maud::
|
# let _ = maud::
|
||||||
|
|
|
@ -118,8 +118,10 @@ maud = { version = "*", features = ["tide"] }
|
||||||
# ...
|
# ...
|
||||||
```
|
```
|
||||||
|
|
||||||
This adds an implementation of `From<PreEscaped<String>>` for the `Response` struct.
|
This adds an implementation of `From<PreEscaped<String>>`
|
||||||
Once provided, callers may return results of `html!` directly as responses:
|
for the `Response` struct.
|
||||||
|
Once provided,
|
||||||
|
callers may return results of `html!` directly as responses:
|
||||||
|
|
||||||
```rust,no_run
|
```rust,no_run
|
||||||
use maud::html;
|
use maud::html;
|
||||||
|
|
Loading…
Add table
Reference in a new issue