Retoca formato pendiente del código vía cargo fmt
This commit is contained in:
parent
592cd9ccda
commit
0e974d6d59
9 changed files with 36 additions and 31 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
use pagetop::prelude::*;
|
use pagetop::prelude::*;
|
||||||
|
|
||||||
|
#[rustfmt::skip]
|
||||||
#[derive(Iden)]
|
#[derive(Iden)]
|
||||||
enum NodeType {
|
enum NodeType {
|
||||||
Table, // node_type: Stores information about all defined Node types.
|
Table, // node_type: Stores information about all defined Node types.
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
use pagetop::prelude::*;
|
use pagetop::prelude::*;
|
||||||
|
|
||||||
|
#[rustfmt::skip]
|
||||||
#[derive(Iden)]
|
#[derive(Iden)]
|
||||||
enum Node {
|
enum Node {
|
||||||
Table, // node: The base table for nodes.
|
Table, // node: The base table for nodes.
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
use pagetop::prelude::*;
|
use pagetop::prelude::*;
|
||||||
|
|
||||||
|
#[rustfmt::skip]
|
||||||
#[derive(Iden)]
|
#[derive(Iden)]
|
||||||
enum NodeAccess {
|
enum NodeAccess {
|
||||||
Table, // node_access: Identifies which realm/grant pairs a user must possess in
|
Table, // node_access: Identifies which realm/grant pairs a user must possess in
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
use pagetop::prelude::*;
|
use pagetop::prelude::*;
|
||||||
|
|
||||||
|
#[rustfmt::skip]
|
||||||
#[derive(Iden)]
|
#[derive(Iden)]
|
||||||
enum NodeRevision {
|
enum NodeRevision {
|
||||||
Table, // node_revision: Stores information about each saved version of a Node.
|
Table, // node_revision: Stores information about each saved version of a Node.
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
use pagetop::prelude::*;
|
use pagetop::prelude::*;
|
||||||
|
|
||||||
|
#[rustfmt::skip]
|
||||||
#[derive(Iden)]
|
#[derive(Iden)]
|
||||||
enum Role {
|
enum Role {
|
||||||
Table, // role: Store user roles.
|
Table, // role: Store user roles.
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
use pagetop::prelude::*;
|
use pagetop::prelude::*;
|
||||||
|
|
||||||
|
#[rustfmt::skip]
|
||||||
#[derive(Iden)]
|
#[derive(Iden)]
|
||||||
enum RolePermission {
|
enum RolePermission {
|
||||||
Table, // role_permission: Stores the permissions assigned to user roles.
|
Table, // role_permission: Stores the permissions assigned to user roles.
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
use pagetop::prelude::*;
|
use pagetop::prelude::*;
|
||||||
|
|
||||||
|
#[rustfmt::skip]
|
||||||
#[derive(Iden)]
|
#[derive(Iden)]
|
||||||
enum User {
|
enum User {
|
||||||
Table, // user: Stores user data.
|
Table, // user: Stores user data.
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
use pagetop::prelude::*;
|
use pagetop::prelude::*;
|
||||||
|
|
||||||
|
#[rustfmt::skip]
|
||||||
#[derive(Iden)]
|
#[derive(Iden)]
|
||||||
enum UserRole {
|
enum UserRole {
|
||||||
Table, // user_role: Maps users to roles.
|
Table, // user_role: Maps users to roles.
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,7 @@ use std::collections::HashMap;
|
||||||
|
|
||||||
include!(concat!(env!("OUT_DIR"), "/mdbook.rs"));
|
include!(concat!(env!("OUT_DIR"), "/mdbook.rs"));
|
||||||
|
|
||||||
static MDBOOK: LazyStatic<HashMap<&'static str, Resource>> = LazyStatic::new(||
|
static MDBOOK: LazyStatic<HashMap<&'static str, Resource>> = LazyStatic::new(|| generate());
|
||||||
generate()
|
|
||||||
);
|
|
||||||
|
|
||||||
pub_const_handler!(MODULE_MDBOOK);
|
pub_const_handler!(MODULE_MDBOOK);
|
||||||
|
|
||||||
|
|
@ -24,7 +22,7 @@ impl ModuleTrait for MdBook {
|
||||||
cfg.service(
|
cfg.service(
|
||||||
app::web::scope("/doc")
|
app::web::scope("/doc")
|
||||||
.route("{tail:.*html$}", app::web::get().to(mdbook_page))
|
.route("{tail:.*html$}", app::web::get().to(mdbook_page))
|
||||||
.route("{tail:.*$}", app::web::get().to(mdbook_resource))
|
.route("{tail:.*$}", app::web::get().to(mdbook_resource)),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -35,7 +33,6 @@ async fn mdbook_page(request: app::HttpRequest) -> ResultPage<Markup, FatalError
|
||||||
|
|
||||||
if let Some(content) = MDBOOK.get(path) {
|
if let Some(content) = MDBOOK.get(path) {
|
||||||
if let Ok(html) = std::str::from_utf8(content.data) {
|
if let Ok(html) = std::str::from_utf8(content.data) {
|
||||||
|
|
||||||
let _lang = extract("Lang", html);
|
let _lang = extract("Lang", html);
|
||||||
let title = match extract("Title", html) {
|
let title = match extract("Title", html) {
|
||||||
Some(title) => title,
|
Some(title) => title,
|
||||||
|
|
@ -60,38 +57,38 @@ async fn mdbook_page(request: app::HttpRequest) -> ResultPage<Markup, FatalError
|
||||||
Page::new()
|
Page::new()
|
||||||
.with_title(title)
|
.with_title(title)
|
||||||
.with_context(PageOp::AddMetadata("theme-color", "#ffffff"))
|
.with_context(PageOp::AddMetadata("theme-color", "#ffffff"))
|
||||||
|
.with_context(PageOp::AddStyleSheet(StyleSheet::located(
|
||||||
|
"/doc/css/variables.css",
|
||||||
|
)))
|
||||||
|
.with_context(PageOp::AddStyleSheet(StyleSheet::located(
|
||||||
|
"/doc/css/general.css",
|
||||||
|
)))
|
||||||
|
.with_context(PageOp::AddStyleSheet(StyleSheet::located(
|
||||||
|
"/doc/css/chrome.css",
|
||||||
|
)))
|
||||||
.with_context(PageOp::AddStyleSheet(
|
.with_context(PageOp::AddStyleSheet(
|
||||||
StyleSheet::located("/doc/css/variables.css")
|
StyleSheet::located("/doc/css/print.css").for_media(TargetMedia::Print),
|
||||||
))
|
|
||||||
.with_context(PageOp::AddStyleSheet(
|
|
||||||
StyleSheet::located("/doc/css/general.css")
|
|
||||||
))
|
|
||||||
.with_context(PageOp::AddStyleSheet(
|
|
||||||
StyleSheet::located("/doc/css/chrome.css")
|
|
||||||
))
|
|
||||||
.with_context(PageOp::AddStyleSheet(
|
|
||||||
StyleSheet::located("/doc/css/print.css").for_media(TargetMedia::Print)
|
|
||||||
))
|
|
||||||
.with_context(PageOp::AddStyleSheet(
|
|
||||||
StyleSheet::located("/doc/FontAwesome/css/font-awesome.css")
|
|
||||||
))
|
|
||||||
.with_context(PageOp::AddStyleSheet(
|
|
||||||
StyleSheet::located("/doc/fonts/fonts.css")
|
|
||||||
))
|
|
||||||
.with_context(PageOp::AddStyleSheet(
|
|
||||||
StyleSheet::located("/doc/highlight.css")
|
|
||||||
))
|
|
||||||
.with_context(PageOp::AddStyleSheet(
|
|
||||||
StyleSheet::located("/doc/tomorrow-night.css")
|
|
||||||
))
|
|
||||||
.with_context(PageOp::AddStyleSheet(
|
|
||||||
StyleSheet::located("/doc/ayu-highlight.css")
|
|
||||||
))
|
))
|
||||||
|
.with_context(PageOp::AddStyleSheet(StyleSheet::located(
|
||||||
|
"/doc/FontAwesome/css/font-awesome.css",
|
||||||
|
)))
|
||||||
|
.with_context(PageOp::AddStyleSheet(StyleSheet::located(
|
||||||
|
"/doc/fonts/fonts.css",
|
||||||
|
)))
|
||||||
|
.with_context(PageOp::AddStyleSheet(StyleSheet::located(
|
||||||
|
"/doc/highlight.css",
|
||||||
|
)))
|
||||||
|
.with_context(PageOp::AddStyleSheet(StyleSheet::located(
|
||||||
|
"/doc/tomorrow-night.css",
|
||||||
|
)))
|
||||||
|
.with_context(PageOp::AddStyleSheet(StyleSheet::located(
|
||||||
|
"/doc/ayu-highlight.css",
|
||||||
|
)))
|
||||||
.add_to(
|
.add_to(
|
||||||
"region-content",
|
"region-content",
|
||||||
Container::new()
|
Container::new()
|
||||||
.with_id("mdbook")
|
.with_id("mdbook")
|
||||||
.with_component(Html::with(html! { (PreEscaped(&html[beginning..])) }))
|
.with_component(Html::with(html! { (PreEscaped(&html[beginning..])) })),
|
||||||
)
|
)
|
||||||
.render()
|
.render()
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue