Because writing books about Rust is the kewl thing to do these days (and because I don't have the personality or ethic for a blog), it's a big brain-dump of a fair part of what I know about writing macros in Rust.
This is intended to be kind of like the Rustonomicon, but for macros: it goes through how they work, the gotchas, the weird minutiae, and contains various patterns and examples.
It is not finished, in the sense that a major part of it is meant to collect patterns, building blocks, and annotated examples. The two introductions (one methodical, one practical) should be more or less done. If you feel anything is missing from them, please let me know.
If you want to contribute, there's a few things that will help:
If there's anything in there that doesn't make sense, particularly in the introductions, let me know.
Noticed a useful parsing or expansion pattern? Also let me know.
Have a useful bit of macro code that can be factored into a stand-alone macro? See above. (Actually, if the "Building Blocks" chapter gets significantly larger, I'll be tempted to have a matching cargo crate so that they're all immediately usable).
Is there a big, complicated macro that you'd like to see explained (or better yet: you have an annotated version of a big, complicated macro)? You know the drill.
It's not the theme; at least, I can't find anything I've done to break it. As far as I know, rustbook is just crazy. Navigating back from footnotes has never worked for me, for example.
No, but I'll give it a shot and see how it does. It'll have to wait, though: my internet connection is shaped at the moment, so building Rust code is basically impossible until the quota resets.
@Azerupi I tried to build it with mdBook but it threw an error and didn't seem to copy over most of the theme files. Manually copying them over fixed it. Also, the main headers which rustbook used seem to use % header but mdbook uses # header so it probably just needs updating.
Seems to work well other than that.
[EDIT]
I did run into a build script error when running cargo build --release --features="regenerate-css" though it went away when I retried a second time. Not sure why.