Skip to content

Support line-based comment. #562

Answered by mitsuhiko
cathaysia asked this question in Q&A
Aug 19, 2024 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

Yes, if you enable the custom_syntax feature you can configure line comments:

use minijinja::{context, syntax::SyntaxConfig, Environment};

let mut env = Environment::new();
env.set_syntax(
    SyntaxConfig::builder()
        .line_statement_prefix("#")
        .line_comment_prefix("##")
        .build()
        .unwrap(),
);

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@cathaysia
Comment options

@cathaysia
Comment options

@mitsuhiko
Comment options

Answer selected by mitsuhiko
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #561 on August 19, 2024 08:49.