| Crates.io | mystical-runic |
| lib.rs | mystical-runic |
| version | 0.5.3 |
| created_at | 2025-08-17 08:51:43.226047+00 |
| updated_at | 2025-08-20 01:14:56.962213+00 |
| description | High-performance templating engine for Rust with enterprise security, advanced monitoring, comprehensive developer tools, and ecosystem integration. Zero-dependency core with optional async, web framework, WASM, and CLI features. |
| homepage | https://github.com/yrbane/mystical-runic |
| repository | https://github.com/yrbane/mystical-runic.git |
| max_upload_size | |
| id | 1799248 |
| size | 532,079 |
Zero-dependency, high-performance templating engine for Rust with enterprise-grade features
Mystical-Runic is a high-performance templating engine that combines the simplicity of Mustache syntax with powerful enterprise features. Built for production use with zero external dependencies, comprehensive security, and exceptional performance.
| Type | Description | Lien |
|---|---|---|
| ๐ฆ API Reference | Complete technical documentation | docs.rs/mystical-runic |
| ๐ซ๐ท Guide Utilisateur | Documentation franรงaise avec tutoriels | Documentation HTML |
| ๐ Quick Start | cargo doc --open --all-features |
Documentation locale |
| ๐ฏ Examples | Real-world demos and usage examples | examples/ |
๐ก Tip: Start with the French user guide for tutorials and examples, then use the API reference for technical details.
TemplateEngine) or mystical (RuneEngine) naming{{user.profile.stats.level}}){{super}}upper, lower, currency, truncate with chaining supportadd, multiply, divide, percentage, round{{t "key"}} syntax and locale switching{{plural count "item" "items"}}../ attacks{{name}} - HTML-escaped variable output for XSS protection{{& html}} - Unescaped HTML output (use with caution){{if condition}}...{{/if}} - Conditional rendering with comparison operators{{for item in items}}...{{/for}} - Iterate over arrays and objects{{include "template.html"}} - Template composition and reuse{{! comment }} - Template comments (not rendered){{user.profile.stats.level}} - Unlimited depth object property access{{extends "base.html"}} - Inherit the power of ancestral templates{{block content}}...{{/block}} - Define regions of power in your layouts{{super}} - Channel the content of parent templates{{name|upper|truncate:10}} - Transform values with ancient filters{{macro spell(power)}}...{{/macro}} - Create reusable incantations{{spell("lightning")}} - Call upon your defined macros{{for category in shops}}{{for item in category.items}}...{{/for}}{{/for}} - Complex nested iterations with stack-based parsing../../../etc/passwd and C:\Windows\System32 attacks{{t "welcome" name=user}} - Full i18n with variable interpolation{{plural count "item" "items"}} - Automatic singular/plural forms{{price|multiply:1.2|add:shipping|round:2|currency}} - Complex calculations with filter chainingengine.register_filter(){{t "welcome"}} - Speak all tongues with i18n supportengine.set_locale("en"){{plural count "item" "items"}} - Smart pluralization magic{{price|add:10|multiply:2|percentage}} - Advanced math transformationsengine.register_filter("reverse", |input, _| Ok(input.chars().rev().collect())) - Forge your own filtersParseWithLocation - Precise line/column error reporting with contextengine.enable_debug_mode() - Variable tracking and execution step analysisrender_string_with_debug() - Step-through debugging with performance metricsengine.enable_hot_reload() - Automatic template reloading during developmentparse_for_lsp() - Full LSP support for template editingrender_string_async() - Non-blocking template rendering with tokioengine.render_axum() - Direct HTML responsesengine.render_warp() - Reply trait integrationengine.render_actix() - HttpResponse integrationWasmRuneEngine - Browser-ready template renderingengine.render_string(template, json) for web appsprocess_template() - Direct string processingprocess_files() - File-based template renderingbatch_process() - Multiple template processingTemplateWatcher - File system watching with hot reloadget_definition_at_position() - Navigate to macro definitions๐ Complete setup guide: See our detailed installation documentation for comprehensive instructions and examples.
[dependencies]
mystical-runic = "0.5.2"
[dependencies]
# Async support for high-performance web apps
mystical-runic = { version = "0.5.2", features = ["async"] }
# Web framework integration
mystical-runic = { version = "0.5.2", features = ["web-frameworks"] }
# Or specific frameworks:
# mystical-runic = { version = "0.5.2", features = ["axum-integration"] }
# mystical-runic = { version = "0.5.2", features = ["warp-integration"] }
# mystical-runic = { version = "0.5.2", features = ["actix-integration"] }
# WASM browser compatibility
mystical-runic = { version = "0.5.2", features = ["wasm"] }
# CLI tools and utilities
mystical-runic = { version = "0.5.2", features = ["cli"] }
# All ecosystem features
mystical-runic = { version = "0.5.2", features = ["full"] }
Available Features:
| Feature | Description | Category |
|---|---|---|
async |
Async template rendering with Tokio | ๐ Performance |
axum-integration |
Axum web framework support | ๐ Web Frameworks |
warp-integration |
Warp web framework support | ๐ Web Frameworks |
actix-integration |
Actix-web framework support | ๐ Web Frameworks |
web-frameworks |
All web framework integrations | ๐ Web Frameworks |
wasm |
WebAssembly browser compatibility | ๐ธ๏ธ Browser/WASM |
cli |
Command-line tools and utilities | ๐ ๏ธ Developer Tools |
full |
All ecosystem integration features | ๐ฆ Complete Package |
Perfect for corporate environments, team projects, and those who prefer explicit naming:
use mystical_runic::{TemplateEngine, TemplateContext, TemplateValue};
let mut engine = TemplateEngine::new("templates");
let mut context = TemplateContext::new();
// Set variables in your template context
context.set("hero", TemplateValue::String("Rust Developer".to_string()));
context.set("level", TemplateValue::Number(99));
context.set("has_coffee", TemplateValue::Bool(true));
let result = engine.render_string(
"Hello {{hero}} of level {{level}}! {{if has_coffee}}โ Ready to work!{{/if}}",
&context
).unwrap();
For the adventurous, creative projects, and those who enjoy a touch of magic:
use mystical_runic::{RuneEngine, RuneScroll, RuneSymbol};
// Summon the ancient engine from the template realm
let mut engine = RuneEngine::new("sacred_scrolls");
let mut scroll = RuneScroll::new();
// Inscribe your desires upon the scroll
scroll.set("hero", RuneSymbol::String("Mystical Sorcerer".to_string()));
scroll.set("level", RuneSymbol::Number(99));
scroll.set("has_coffee", RuneSymbol::Bool(true));
// Speak the incantation and witness the transformation
let result = engine.render_string(
"Behold! {{hero}} of level {{level}} embarks upon their quest! {{if has_coffee}}โ{{/if}}",
&scroll
).unwrap();
๐ก Pro Tip: Both styles are completely interchangeable! Use whichever feels right for your project. You can even mix them in the same codebase - they're just aliases for the same underlying types.
use mystical_runic::{RuneEngine, RuneScroll, RuneSymbol};
use std::collections::HashMap;
let mut engine = RuneEngine::new(".");
let mut scroll = RuneScroll::new();
// Create a magical character
let mut character = HashMap::new();
character.insert("name".to_string(), RuneSymbol::String("Gandalf the Grey".to_string()));
character.insert("class".to_string(), RuneSymbol::String("Wizard".to_string()));
character.insert("level".to_string(), RuneSymbol::Number(85));
character.insert("mana".to_string(), RuneSymbol::Number(9999));
character.insert("has_staff".to_string(), RuneSymbol::Bool(true));
scroll.set("character", RuneSymbol::Object(character));
// โ๏ธ Create spell list
let spells = vec![
create_spell("Fireball", 50, "๐ฅ"),
create_spell("Lightning Bolt", 75, "โก"),
create_spell("Ice Shard", 40, "โ๏ธ"),
];
scroll.set("spells", RuneSymbol::Array(spells));
let character_sheet = r#"
๐งโโ๏ธ Name: {{character.name}}
๐ Class: {{character.class}} (Level {{character.level}})
๐ฎ Mana: {{character.mana}}
{{if character.has_staff}}
๐ช Equipment: Magical Staff of Power
{{/if}}
โก KNOWN SPELLS:
{{for spell in spells}}
{{spell.icon}} {{spell.name}} - Power: {{spell.damage}}
{{/for}}
"#;
let result = engine.render_string(character_sheet, &scroll).unwrap();
println!("{}", result);
fn create_spell(name: &str, damage: i64, icon: &str) -> RuneSymbol {
let mut spell = HashMap::new();
spell.insert("name".to_string(), RuneSymbol::String(name.to_string()));
spell.insert("damage".to_string(), RuneSymbol::Number(damage));
spell.insert("icon".to_string(), RuneSymbol::String(icon.to_string()));
RuneSymbol::Object(spell)
}
use mystical_runic::{RuneEngine, RuneScroll, RuneSymbol};
use std::collections::HashMap;
let mut engine = RuneEngine::new(".");
let mut scroll = RuneScroll::new();
// Create deeply nested game data structure
let mut stats = HashMap::new();
stats.insert("level".to_string(), RuneSymbol::Number(42));
stats.insert("health".to_string(), RuneSymbol::Number(100));
stats.insert("mana".to_string(), RuneSymbol::Number(75));
let mut equipment = HashMap::new();
equipment.insert("weapon".to_string(), RuneSymbol::String("Mystical Sword".to_string()));
equipment.insert("armor".to_string(), RuneSymbol::String("Dragon Scale".to_string()));
let mut character = HashMap::new();
character.insert("name".to_string(), RuneSymbol::String("Aragorn".to_string()));
character.insert("class".to_string(), RuneSymbol::String("Ranger".to_string()));
character.insert("stats".to_string(), RuneSymbol::Object(stats));
character.insert("equipment".to_string(), RuneSymbol::Object(equipment));
let mut game_data = HashMap::new();
game_data.insert("character".to_string(), RuneSymbol::Object(character));
scroll.set("game", RuneSymbol::Object(game_data));
// Use deep dot notation to access nested values
let template = r#"
๐ฎ GAME CHARACTER SHEET ๐ฎ
๐ค Name: {{game.character.name}}
๐ญ Class: {{game.character.class}}
๐ STATS:
โค๏ธ Health: {{game.character.stats.health}}
๐ Mana: {{game.character.stats.mana}}
โญ Level: {{game.character.stats.level}}
โ๏ธ EQUIPMENT:
{{if game.character.equipment.weapon}}
๐ก๏ธ Weapon: {{game.character.equipment.weapon}}
{{/if}}
{{if game.character.equipment.armor}}
๐ก๏ธ Armor: {{game.character.equipment.armor}}
{{/if}}
{{if game.character.stats.level}}
๐ Status: {{if game.character.stats.health}}Combat Ready{{/if}}
{{/if}}
"#;
let result = engine.render_string(template, &scroll).unwrap();
println!("{}", result);
// ๐ฅ NEW v0.4.0: Debug Mode for Development
engine.enable_debug_mode();
let debug_result = engine.render_string_with_debug(template, &scroll).unwrap();
println!("Rendered: {}", debug_result.output);
println!("Variables accessed: {:?}", debug_result.debug_info.variables_accessed);
println!("Execution time: {}ms", debug_result.debug_info.performance_metrics.total_time_nanos / 1_000_000);
use mystical_runic::{RuneEngine, RuneScroll, RuneSymbol};
let mut engine = RuneEngine::new(".");
let mut context = RuneScroll::new();
context.set_string("user_name", "Alice");
context.set_number("user_level", 42);
let template = r#"
{{macro greeting(name, level)}}
<h1>Hello {{name}}! Level: {{level}}</h1>
{{/macro}}
{{greeting(user_name, user_level)}}
{{if user_level}}
{{user_name|upper}} is ready!
{{/if}}
"#;
// ๐ NEW v0.4.1: Language Server Protocol Support
let lsp_info = engine.parse_for_lsp(template, "greeting.html").unwrap();
println!("Variables found: {:?}", lsp_info.variables);
println!("Macros found: {:?}", lsp_info.macros);
// ๐ก NEW v0.4.1: Auto-completion at cursor position
let position = 95; // Position in "{{user_na|"
let completions = engine.get_completions_at_position(template, position, &context).unwrap();
for completion in completions {
println!("Suggestion: {} ({})", completion.label, completion.completion_type);
}
// ๐จ NEW v0.4.1: Syntax highlighting tokens
let tokens = engine.tokenize_for_syntax_highlighting(template).unwrap();
for token in tokens.iter().take(5) {
println!("Token: '{}' ({})", token.content, token.token_type);
}
// ๐จ NEW v0.4.1: Real-time error diagnostics
let invalid_template = "{{name}} {{unknown_variable}} {{name|nonexistent_filter}}";
let diagnostics = engine.get_diagnostics_for_editor(invalid_template, &context).unwrap();
for diagnostic in diagnostics {
println!("โ ๏ธ {}: {} (line {})", diagnostic.severity, diagnostic.message, diagnostic.line);
}
// โน๏ธ NEW v0.4.1: Hover information
let hover_position = 50; // Position over a variable
if let Ok(hover_info) = engine.get_hover_info_at_position(template, hover_position, &context) {
println!("Hover: {} ({}) = {}", hover_info.variable_name, hover_info.variable_type, hover_info.current_value);
}
// ๐ NEW v0.4.1: Go to definition
let macro_position = 200; // Position over a macro call
if let Ok(definition) = engine.get_definition_at_position(template, macro_position) {
println!("Definition: {} at line {} column {}", definition.name, definition.line, definition.column);
}
use mystical_runic::{RuneEngine, RuneScroll, AsyncTemplateEngine};
use tokio;
#[tokio::main]
async fn main() {
let mut engine = RuneEngine::new("templates");
let mut context = RuneScroll::new();
context.set_string("user", "Async Wizard");
// Non-blocking template rendering
let result = engine.render_string_async(
"Hello {{user}}! Processing your request...",
&context
).await.unwrap();
println!("{}", result);
}
use axum::{response::Html, routing::get, Router};
use mystical_runic::{RuneEngine, RuneScroll, AxumTemplateEngine};
async fn render_page(mut engine: RuneEngine) -> Result<Html<String>, String> {
let mut context = RuneScroll::new();
context.set_string("title", "My Axum App");
engine.render_axum("<h1>{{title}}</h1>", &context)
.await
.map_err(|e| e.to_string())
}
#[tokio::main]
async fn main() {
let app = Router::new()
.route("/", get(|| render_page(RuneEngine::new("templates"))));
// Serve your app...
}
use mystical_runic::WasmRuneEngine;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
pub fn render_in_browser() -> Result<String, JsValue> {
let mut engine = WasmRuneEngine::new();
engine.enable_console_logging(true);
let template = r#"
<div class="user-card">
<h2>{{user.name}}</h2>
<p>Level: {{user.level}}</p>
</div>
"#;
let context_json = r#"{"user": {"name": "Web Wizard", "level": 42}}"#;
engine.render_string(template, context_json)
}
use mystical_runic::{process_template, process_files, batch_process};
fn main() -> Result<(), Box<dyn std::error::Error>> {
// Direct template processing
let template = "Hello {{name}}!";
let data = r#"{"name": "CLI User"}"#;
let result = process_template(template, data)?;
println!("{}", result);
// File-based processing
let output = process_files("template.html", "data.json")?;
println!("File result: {}", output);
// Batch processing
let templates = vec!["template1.html", "template2.html"];
let context_json = r#"{"theme": "dark", "version": "v0.5.0"}"#;
let results = batch_process(templates, context_json)?;
for (i, result) in results.iter().enumerate() {
println!("Template {}: {}", i + 1, result);
}
Ok(())
}
Experience ALL features of Mystical-Runic v0.5.0 with our comprehensive demonstration application!
# Run the complete feature showcase
cd examples/real_world_demo
./run_demo.sh
# OR manually
cargo run
Our demo application is a full-featured e-commerce/blog site that demonstrates every single feature:
../../../etc/passwd attacksbase.html โ shop.htmluser.profile.settings.theme๐ฎ MYSTICAL-RUNIC v0.3.4 - DรMONSTRATION COMPLรTE!
โ
Main template rendered successfully! (10KB+ HTML)
โ
Nested loops work perfectly!
โ
Nested includes work perfectly!
โ
All path traversal attempts blocked!
โ
XSS protection working
โ
Rendered 100 times in 1-2ms
โ
HTML file generated: output_demo.html
๐ All 173+ tests pass! Production ready!
The demo creates output_demo.html - a complete working website showcasing:
๐ Location: examples/real_world_demo/ - Complete application with 7+ templates, realistic data, and full documentation.
Create sophisticated layouts with template inheritance:
<!-- base.html -->
<!DOCTYPE html>
<html>
<head>
<title>{{block title}}My Site{{/block}}</title>
</head>
<body>
<header>{{block header}}Default Header{{/block}}</header>
<main>{{block content}}{{/block}}</main>
<footer>{{block footer}}ยฉ 2024 My Site{{/block}}</footer>
</body>
</html>
<!-- admin.html -->
{{extends "base.html"}}
{{block title}}Admin Panel - {{block page_title}}{{/block}}{{/block}}
{{block content}}
<div class="admin-layout">
<nav>{{block sidebar}}Default Sidebar{{/block}}</nav>
<main>{{block admin_content}}{{/block}}</main>
</div>
{{/block}}
<!-- admin_users.html -->
{{extends "admin.html"}}
{{block page_title}}User Management{{/block}}
{{block admin_content}}
<h1>Users</h1>
{{for user in users}}
<div class="user-card">{{user.name}} - {{user.role}}</div>
{{/for}}
{{/block}}
Transform your data with built-in filters:
<h1>{{title|upper}}</h1> <!-- HELLO WORLD -->
<p>{{description|lower}}</p> <!-- hello world -->
<span>${{price|currency}}</span> <!-- $12.99 -->
<div>{{content|truncate:50}}</div> <!-- Truncated text... -->
<time>{{date|date:"Y-m-d"}}</time> <!-- 2024-01-15 -->
<!-- Chain multiple filters -->
<p>{{name|lower|capitalize}}</p> <!-- John Doe -->
<span>{{text|strip|truncate:20|upper}}</span> <!-- TRIMMED TEXT... -->
Create reusable template components:
<!-- Define macros -->
{{macro button(text, type="button", class="btn")}}
<button type="{{type}}" class="{{class}}">{{text}}</button>
{{/macro}}
{{macro card(title, content, class="card")}}
<div class="{{class}}">
<h3 class="card-title">{{title}}</h3>
<div class="card-body">{{content}}</div>
</div>
{{/macro}}
{{macro user_card(user)}}
<div class="user-card">
<h4>{{user.name}}</h4>
<p>{{user.email}}</p>
{{if user.active}}
<span class="status active">Online</span>
{{/if}}
</div>
{{/macro}}
<!-- Use macros -->
{{button("Save", type="submit", class="btn btn-primary")}}
{{card("Welcome", "This is a welcome message", class="card highlight")}}
{{for user in users}}
{{user_card(user)}}
{{/for}}
<!-- Safe HTML escaping (default) -->
<p>{{user_input}}</p>
<!-- Raw HTML output (use with caution) -->
<div>{{& trusted_html}}</div>
<!-- Object properties -->
<span>{{user.name}} ({{user.email}})</span>
<!-- Deep nested properties -->
<div>Level: {{player.character.stats.level}}</div>
<p>{{config.database.connection.host}}:{{config.database.connection.port}}</p>
{{if user.is_admin}}
<button class="admin-panel">Admin Controls</button>
{{/if}}
{{if items}}
<ul class="item-list">
<!-- items exist -->
</ul>
{{/if}}
<!-- Deep conditionals -->
{{if user.settings.notifications.email.enabled}}
<p>Email notifications are on</p>
{{/if}}
{{if config.features.advanced.enabled}}
<div class="advanced-features">Advanced mode active</div>
{{/if}}
Truthiness Rules:
{{for product in products}}
<div class="product">
<h3>{{product.name}}</h3>
<p>Price: ${{product.price}}</p>
{{if product.on_sale}}
<span class="sale-badge">ON SALE!</span>
{{/if}}
</div>
{{/for}}
<!-- main.html -->
<!DOCTYPE html>
<html>
<head>
{{include "partials/head.html"}}
</head>
<body>
{{include "partials/header.html"}}
<main>{{content}}</main>
{{include "partials/footer.html"}}
</body>
</html>
{{! This comment will not appear in the output }}
<div>
{{!
Multi-line comments
are also supported
}}
<p>Visible content</p>
</div>
Mystical-Runic takes security seriously and provides multiple layers of protection:
let mut context = RuneScroll::new();
context.set_string("user_input", "<script>alert('xss')</script>");
let result = engine.render_string("{{user_input}}", &context).unwrap();
// Output: <script>alert('xss')</script>
// These will safely fail:
engine.render("../../../etc/passwd", &context); // โ Blocked
engine.render("..\\windows\\system32", &context); // โ Blocked
context.set_string("malicious", "{{admin_password}}");
let result = engine.render_string("{{malicious}}", &context).unwrap();
// Output: {{admin_password}} (literal text, not executed)
let mut engine = RuneEngine::new("path/to/templates");
// Render from file
let result = engine.render("template.html", &context)?;
// Render from string
let result = engine.render_string("Hello {{name}}!", &context)?;
// Load template (with caching)
let template_content = engine.load_template("header.html")?;
let mut scroll = RuneScroll::new();
// Set different value types
scroll.set_string("name", "value");
scroll.set_number("count", 42);
scroll.set_bool("active", true);
// Set complex values
scroll.set("array", RuneSymbol::Array(vec![...]));
scroll.set("object", RuneSymbol::Object(hashmap));
// Retrieve values
let value = scroll.get_string("name");
// Create different value types
let string_val = RuneSymbol::String("text".to_string());
let number_val = RuneSymbol::Number(42);
let bool_val = RuneSymbol::Bool(true);
let array_val = RuneSymbol::Array(vec![...]);
let object_val = RuneSymbol::Object(hashmap);
Run the comprehensive test suite:
# Run all tests
cargo test
# Run specific test categories
cargo test integration_tests
cargo test unit_tests
cargo test security_tests
# Run with output
cargo test -- --nocapture
use mystical_runic::{RuneEngine, RuneScroll, RuneSymbol};
use std::collections::HashMap;
let mut engine = RuneEngine::new("./templates");
let mut context = RuneScroll::new();
context.set("name", RuneSymbol::String("Alice".to_string()));
// Set up English translations
let mut en_translations = HashMap::new();
en_translations.insert("welcome".to_string(), "Welcome {{name}}!".to_string());
engine.set_translations("en", en_translations);
// Set up French translations
let mut fr_translations = HashMap::new();
fr_translations.insert("welcome".to_string(), "Bienvenue {{name}}!".to_string());
engine.set_translations("fr", fr_translations);
// Use English
engine.set_locale("en");
let welcome_en = engine.render_string("{{t \"welcome\"}}", &context).unwrap();
// Output: "Welcome Alice!"
// Switch to French
engine.set_locale("fr");
let welcome_fr = engine.render_string("{{t \"welcome\"}}", &context).unwrap();
// Output: "Bienvenue Alice!"
use mystical_runic::{RuneEngine, RuneScroll, RuneSymbol};
let mut engine = RuneEngine::new("./templates");
let mut context = RuneScroll::new();
context.set("text", RuneSymbol::String("hello world".to_string()));
// Register custom filters
engine.register_filter("reverse", |input: &str, _args: &[&str]| {
Ok(input.chars().rev().collect())
});
engine.register_filter("repeat", |input: &str, args: &[&str]| {
let times = args.get(0).map_or("1", |v| v).parse::<usize>().unwrap_or(1);
Ok(input.repeat(times))
});
let result = engine.render_string("{{text|reverse|upper|repeat:2}}", &context).unwrap();
// Output: "DLROW OLLEHDLROW OLLEH"
use mystical_runic::{RuneEngine, RuneScroll, RuneSymbol};
let mut engine = RuneEngine::new("./templates");
let mut context = RuneScroll::new();
context.set("price", RuneSymbol::Number(100));
context.set("tax_rate", RuneSymbol::Number(8));
// Complex calculations with chaining
let template = "Price: ${{price}}, Total: {{price|multiply:tax_rate|divide:100|add:price|round:2}}";
let result = engine.render_string(template, &context).unwrap();
// Output: "Price: $100, Total: 108.00"
use mystical_runic::{RuneEngine, RuneScroll, RuneSymbol};
let mut engine = RuneEngine::new("./templates");
let mut context = RuneScroll::new();
let template = "You have {{count}} {{plural count \"apple\" \"apples\"}}";
context.set("count", RuneSymbol::Number(1));
let result = engine.render_string(template, &context).unwrap();
// Output: "You have 1 apple"
context.set("count", RuneSymbol::Number(5));
let result = engine.render_string(template, &context).unwrap();
// Output: "You have 5 apples"
Check out the examples/ directory for magical demonstrations:
real_world_demo/ - โญ COMPLETE DEMO APPLICATION - Full-featured e-commerce/blog showcasing ALL v0.3.4 features
cd examples/real_world_demo && ./run_demo.shspell_casting.rs - Fantasy RPG character sheet generatorMinimum Supported Rust Version (MSRV): 1.74.0+
Edition: Rust 2021 (with future Rust 2024 readiness)
Tested on: Rust 1.74.0 through latest stable
git clone https://github.com/yrbane/mystical-runic.git
cd mystical-runic
cargo build
cargo test
Mystical-Runic follows strict Test-Driven Development practices. When contributing, please observe the sacred TDD ritual:
๐ด RED - Write a Failing Test First
# Write your test before any implementation
cargo test your_new_feature_test
# โ Should fail - good!
๐ข GREEN - Write Minimal Code to Pass
# Write just enough code to make the test pass
cargo test your_new_feature_test
# โ
Should pass - excellent!
๐ต REFACTOR - Improve Without Breaking
# Clean up code while keeping tests green
cargo test # All tests should still pass
"Tests are the safety net that lets you refactor fearlessly." โ TDD Proverb
parse_for_lsp()tokenize_for_syntax_highlighting() for editor integrationget_completions_at_position()get_diagnostics_for_editor() for live error detectionget_hover_info_at_position()get_definition_at_position(){{for category in shops}}{{for item in category.items}})../../../etc/passwd and C:\Windows\System32 attacksexamples/real_world_demo/){{t "key"}} syntax{{plural count "item" "items"}}add, multiply, divide, percentage, round)engine.register_filter()TemplateEngine) or mystical (RuneEngine) stylesupper, lower, currency, truncate, date) with chaining{{game.player.stats.level}}){{t "key"}} syntax for translationsBecause templating is basically ancient magic:
{{}}) that transform into realityMystical-Runic v0.5.2 includes comprehensive performance benchmarks demonstrating enterprise-grade performance:
# Quick performance test
cargo build --release
rustc --edition 2021 benchmarks/simple_benchmark.rs -L target/release/deps --extern mystical_runic=target/release/libmystical_runic.rlib -O && ./simple_benchmark
simple_benchmark.rs - Core functionality performance โ
v0_5_2_performance_benchmark.rs - Comprehensive enterprise testing ๐งecosystem_benchmark.rs - Async and CLI integration testing ๐See benchmarks/README.md for detailed benchmark documentation and results.
This project is licensed under the MIT License - see the LICENSE file for details.
"May your templates be bug-free and your variables always defined."
โ Ancient DevOps Proverb
๐ฎโจ Happy templating! โจ๐ฎ