From 51af19f61fbe6b7a266c585dc4bc573d3a7c9787 Mon Sep 17 00:00:00 2001 From: Andrew Dona-Couch Date: Mon, 6 Mar 2023 14:16:31 -0500 Subject: [PATCH] Document parser module --- askama_derive/src/parser/mod.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/askama_derive/src/parser/mod.rs b/askama_derive/src/parser/mod.rs index 843120487..efc1538ce 100644 --- a/askama_derive/src/parser/mod.rs +++ b/askama_derive/src/parser/mod.rs @@ -1,3 +1,15 @@ +//! Parser and syntax tree for Askama's template syntax. +//! +//! Askama template source is parsed into a [`node::Block`](./node/struct.Block.html), +//! which contains a sequence of [`node::Node`s](./node/enum.Node.html). +//! Each `Node` represents either a bit of literal text or one of three types of +//! template tags: comments, expressions, or statements. In turn, statements +//! can contain nested `Block`s, which form a hierarchical structure. +//! +//! The main entry point to this crate is the [`parse()`](./fn.parse.html) +//! method, which takes the template input `&str` and the configurable +//! [`syntax::Syntax`](./syntax/struct.Syntax.html) to use for parsing. + use std::cell::Cell; use std::str;