derive_deftly/
lib.rs

1// This is the "library" crate.
2//
3// It is conventional for proc macro crates to be wrapped up
4// in a library crate, which reexport the proc macros, mostly because
5// a proc macro crate cannot contain anything else.
6//
7// Currently our plans do not appear to include any items other than
8// proc macros.  But we shouldn't foreclose that.  So for now
9// this library crate ought to declare a dependency on the macro crate
10// and reexport the macros.
11//
12// Also this crate is where the docs live, right here as crate-level
13// docs.
14
15#![allow(clippy::style, clippy::complexity)]
16#![allow(rustdoc::invalid_html_tags)] // @derive-deftly invalid-html-tags
17#![doc=include_str!("../README.md")]
18//
19// We take some serious liberties with rustdoc's HTML, here.
20// We want this "overall TOC" to be an h1 heading
21// and we want it *not* to be within the div
22// that rustdoc puts this this whole toplevel docs in.
23// So we *close that div* and reopen a new one.
24//!
25//! </div><!-- @derive-deftly invalid-html-tags -->
26//!
27//! <h1 class="section-header main-heading" id="overall-toc"><a class="doc-anchor" href="#overall-toc">ยง</a><strong>derive-deftly documentation, overall table of contents</strong></h1>
28//!
29//! <div class="docblock">
30//!
31//! <!-- @dd-navbar overall-toc . -->
32//! <!-- this line automatically maintained by update-navbars --><nav style="text-align: right; margin-bottom: 12px;">[ <em>docs: <a href="index.html">crate top-level</a> | <strong>overall toc, macros</strong> | <a href="doc_reference/index.html">template etc. reference</a> | <a href="https://diziet.pages.torproject.net/rust-derive-deftly/latest/guide/">guide/tutorial</a></em> ]</nav>
33//!
34//! </div>
35//! <div><!-- @derive-deftly invalid-html-tags -->
36//! <p style="margin-top: 25px"></p>
37//!
38// This next part is is also unwarranted chumminess with rustdoc.
39// Some time between Rust 1.85 and 1.86, rustdoc changed from using
40// <ul> and a pair of <div> with <class>, to this <dd>, which is better.
41// This does mean this doesn't render precisely right on Stable right now.
42//
43//! <dl class="item-table">
44//! <dt><a href="https://diziet.pages.torproject.net/rust-derive-deftly/latest/guide/">Guide</a></dt>
45//! <dd>Tutorial and walkthrough, in book form</dd>
46//! </dl>
47
48pub use derive_deftly_macros::derive_deftly_engine;
49pub use derive_deftly_macros::{
50    define_derive_deftly, derive_deftly_adhoc, template_export_semver_check,
51    Deftly,
52};
53
54// We (ab)use the module system as places to hang our documentation.
55
56#[deny(rustdoc::invalid_html_tags)]
57#[doc=include_str!("../doc/reference.md")]
58pub mod doc_reference {}
59
60#[deny(rustdoc::invalid_html_tags)]
61#[doc=include_str!("../doc/implementation.md")]
62pub mod doc_implementation {}
63
64#[deny(rustdoc::invalid_html_tags)]
65#[doc=include_str!("../CHANGELOG.md")]
66pub mod doc_changelog {}
67
68#[cfg(not(feature = "minimal-1"))]
69compile_error! { "You must enable (directly or indirectly) the derive-deftly crate feature `minimal-1`!" }