sha2="0.10"
subtle="2.4"
tempfile="3"
+tera="1.10"
toml="0.5"
typetag="0.1.6"
uds="0.2"
serde = { version="1" , features=["derive", "rc"] }
strum = { version="0.24" , features=["derive" ] }
-tera_standalone = { version="1.10", package="tera" }
-
slotmap = { package="slotmap-fork-otter", version="1", git="https://github.com/ijackson/slotmap", branch="slotmap-fork-otter", features=["serde"] }
#fin.
http2 HEAD requests
fix listen
fix that /_/updates vs /_/<leaf> involves ordering
-one tera version
// SPDX-License-Identifier: AGPL-3.0-or-later
// There is NO WARRANTY.
-use crate::imports::*;
-
pub use super::*;
#[derive(Clone,Debug)]
#![feature(lint_reasons)]
#![feature(proc_macro_hygiene, decl_macro)]
-use otter::imports::thiserror;
+use otter::imports::*;
pub mod imports;
use actix_cors::Cors;
use otter::prelude::*;
-use otter::imports::tera_standalone as tera;
-use tera::Tera;
const CT_JAVASCRIPT: mime::Mime = mime::APPLICATION_JAVASCRIPT_UTF_8;
const CT_TEXT: mime::Mime = mime::TEXT_PLAIN_UTF_8;
pub type Template = HttpResponse;
pub struct Templates {
- tera: tera::Tera,
+ tera: Tera,
}
impl Templates {
pub use otter::prelude::*;
pub use otter_api_tests::Explode;
-pub use otter::imports::tera_standalone as tera;
pub use indexmap::IndexMap;
pub use indexmap::IndexSet;
for (nomfile, data) in &templates { report(nomfile, data)?; }
- let mut tera = tera_standalone::Tera::default();
+ let mut tera = Tera::default();
tera.add_raw_templates(templates).context("load")?;
let mut out: Vec<u8> = vec![];
tera.render_to("spec", &default(), &mut out).context("render")?;
// There is NO WARRANTY.
use crate::prelude::*;
-use tera_standalone as tera;
#[derive(Error,Debug)]
pub enum Fatal { // Includes _bogus_ client updates, see PROTOCOL.md
pub use rmp_serde;
pub use sha2;
pub use slotmap;
-pub use tera_standalone;
+pub use tera;
pub use toml;
pub use uds;
pub use unicode_width;
static STATE: RwLock<Option<State>> = const_rwlock(None);
struct State {
- tera: tera_standalone::Tera,
+ tera: Tera,
}
#[throws(StartupError)]
let config = config();
let nwtemplate_dir = &config.nwtemplate_dir;
let glob = format!("{}/*.tera", nwtemplate_dir);
- let tera = tera_standalone::Tera::new(&glob)
+ let tera = Tera::new(&glob)
.map_err(|e| anyhow!("{}", e))
.context("load tamplates")
.with_context(|| nwtemplate_dir.to_string())?;
pub fn render<D>(template_name: &str, data: &D) -> String
where D: Serialize + Debug
{
- fn get_tera() -> MappedRwLockReadGuard<'static, tera_standalone::Tera> {
+ fn get_tera() -> MappedRwLockReadGuard<'static, Tera> {
let g = STATE.read();
RwLockReadGuard::map(g, |g| &g.as_ref().unwrap().tera)
}
- let context = tera_standalone::Context::from_serialize(data)
+ let context = tera::Context::from_serialize(data)
.with_context(
|| format!("failed make context from serializable {:?}", data)
)
pub use strum::{IntoEnumIterator, IntoStaticStr};
pub use subtle::ConstantTimeEq;
pub use tempfile::{self, NamedTempFile};
+pub use tera::Tera;
pub use thiserror::Error;
pub use unicase::UniCase;
pub use url::Url;