Organize readme a bit

This commit is contained in:
David Tolnay 2020-05-13 22:29:41 -07:00
parent b4f1671357
commit 68ff242bf2
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82

View File

@ -29,15 +29,16 @@ This crate is motivated by the procedural macro use case, but is a
general-purpose Rust quasi-quoting library and is not specific to procedural
macros.
*Version requirement: Quote supports rustc 1.31 and up.*
[*Release notes*](https://github.com/dtolnay/quote/releases)
```toml
[dependencies]
quote = "1.0"
```
*Version requirement: Quote supports rustc 1.31 and up.*<br>
[*Release notes*](https://github.com/dtolnay/quote/releases)
<br>
## Syntax
The quote crate provides a [`quote!`] macro within which you can write Rust code
@ -76,6 +77,8 @@ let tokens = quote! {
};
```
<br>
## Repetition
Repetition is done using `#(...)*` or `#(...),*` similar to `macro_rules!`. This
@ -93,6 +96,8 @@ Note that there is a difference between `#(#var ,)*` and `#(#var),*`—the latte
does not produce a trailing comma. This matches the behavior of delimiters in
`macro_rules!`.
<br>
## Returning tokens to the compiler
The `quote!` macro evaluates to an expression of type
@ -112,6 +117,8 @@ There is a [`From`]-conversion in both directions so returning the output of
[`From`]: https://doc.rust-lang.org/std/convert/trait.From.html
<br>
## Examples
### Combining quoted fragments
@ -206,6 +213,8 @@ quote! {
}
```
<br>
## Hygiene
Any interpolated tokens preserve the `Span` information provided by their