rshtml_core 0.6.1

RsHtml: A Template Engine for Seamless HTML and Rust Integration.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::rshtml_file::{Input, template::rust_identifier};
use proc_macro2::TokenStream;
use quote::quote;
use winnow::{
    ModalResult, Parser,
    combinator::{alt, not, peek},
};

pub fn child_content_directive<'a, 'ctx>(input: &mut Input<'a, 'ctx>) -> ModalResult<TokenStream> {
    (
        "child_content",
        alt(("()".void(), peek(not(rust_identifier)).void())),
    )
        .map(|(_, _)| quote! {child_content(__out__)?;})
        .parse_next(input)
}