parent
c9cb58de40
commit
dc028116b8
7 changed files with 53 additions and 44 deletions
|
@ -1,14 +1,10 @@
|
|||
use comrak::nodes::AstNode;
|
||||
use comrak::{self, Arena};
|
||||
use docs::page::{Page, COMRAK_OPTIONS};
|
||||
use docs::string_writer::StringWriter;
|
||||
use comrak::{self, nodes::AstNode, Arena};
|
||||
use docs::{
|
||||
page::{Page, COMRAK_OPTIONS},
|
||||
string_writer::StringWriter,
|
||||
};
|
||||
use serde_json;
|
||||
use std::env;
|
||||
use std::error::Error;
|
||||
use std::fs;
|
||||
use std::io;
|
||||
use std::path::Path;
|
||||
use std::str;
|
||||
use std::{env, error::Error, fs, io, path::Path, str};
|
||||
|
||||
fn main() -> Result<(), Box<dyn Error>> {
|
||||
let args = env::args().collect::<Vec<_>>();
|
||||
|
|
|
@ -1,19 +1,28 @@
|
|||
use comrak::nodes::{AstNode, NodeCodeBlock, NodeHeading, NodeHtmlBlock, NodeLink, NodeValue};
|
||||
use comrak::{self, Arena};
|
||||
use docs::page::{Page, COMRAK_OPTIONS};
|
||||
use docs::views;
|
||||
use comrak::{
|
||||
self,
|
||||
nodes::{AstNode, NodeCodeBlock, NodeHeading, NodeHtmlBlock, NodeLink, NodeValue},
|
||||
Arena,
|
||||
};
|
||||
use docs::{
|
||||
page::{Page, COMRAK_OPTIONS},
|
||||
views,
|
||||
};
|
||||
use serde_json;
|
||||
use std::env;
|
||||
use std::error::Error;
|
||||
use std::fs::{self, File};
|
||||
use std::io::BufReader;
|
||||
use std::mem;
|
||||
use std::path::Path;
|
||||
use std::str::{self, Utf8Error};
|
||||
use std::string::FromUtf8Error;
|
||||
use syntect::highlighting::{Color, ThemeSet};
|
||||
use syntect::html::highlighted_html_for_string;
|
||||
use syntect::parsing::SyntaxSet;
|
||||
use std::{
|
||||
env,
|
||||
error::Error,
|
||||
fs::{self, File},
|
||||
io::BufReader,
|
||||
mem,
|
||||
path::Path,
|
||||
str::{self, Utf8Error},
|
||||
string::FromUtf8Error,
|
||||
};
|
||||
use syntect::{
|
||||
highlighting::{Color, ThemeSet},
|
||||
html::highlighted_html_for_string,
|
||||
parsing::SyntaxSet,
|
||||
};
|
||||
|
||||
fn main() -> Result<(), Box<dyn Error>> {
|
||||
let args = env::args().collect::<Vec<_>>();
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
use comrak::nodes::{AstNode, NodeHeading, NodeValue};
|
||||
use comrak::{Arena, ComrakOptions};
|
||||
use std::fs;
|
||||
use std::io;
|
||||
use std::lazy::SyncLazy;
|
||||
use std::path::Path;
|
||||
use comrak::{
|
||||
nodes::{AstNode, NodeHeading, NodeValue},
|
||||
Arena, ComrakOptions,
|
||||
};
|
||||
use std::{fs, io, lazy::SyncLazy, path::Path};
|
||||
|
||||
pub struct Page<'a> {
|
||||
pub title: Option<&'a AstNode<'a>>,
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
use std::io;
|
||||
use std::str;
|
||||
use std::{io, str};
|
||||
|
||||
pub struct StringWriter<'a>(pub &'a mut String);
|
||||
|
||||
|
|
|
@ -2,8 +2,10 @@ use comrak::nodes::AstNode;
|
|||
use maud::{html, Markup, PreEscaped, Render, DOCTYPE};
|
||||
use std::str;
|
||||
|
||||
use crate::page::{Page, COMRAK_OPTIONS};
|
||||
use crate::string_writer::StringWriter;
|
||||
use crate::{
|
||||
page::{Page, COMRAK_OPTIONS},
|
||||
string_writer::StringWriter,
|
||||
};
|
||||
|
||||
struct Comrak<'a>(&'a AstNode<'a>);
|
||||
|
||||
|
|
|
@ -176,12 +176,13 @@ mod iron_support {
|
|||
extern crate std;
|
||||
|
||||
use crate::PreEscaped;
|
||||
use alloc::boxed::Box;
|
||||
use alloc::string::String;
|
||||
use iron::headers::ContentType;
|
||||
use iron::modifier::{Modifier, Set};
|
||||
use iron::modifiers::Header;
|
||||
use iron::response::{Response, WriteBody};
|
||||
use alloc::{boxed::Box, string::String};
|
||||
use iron::{
|
||||
headers::ContentType,
|
||||
modifier::{Modifier, Set},
|
||||
modifiers::Header,
|
||||
response::{Response, WriteBody},
|
||||
};
|
||||
use std::io;
|
||||
|
||||
impl Modifier<Response> for PreEscaped<String> {
|
||||
|
@ -205,9 +206,11 @@ mod rocket_support {
|
|||
|
||||
use crate::PreEscaped;
|
||||
use alloc::string::String;
|
||||
use rocket::http::{ContentType, Status};
|
||||
use rocket::request::Request;
|
||||
use rocket::response::{Responder, Response};
|
||||
use rocket::{
|
||||
http::{ContentType, Status},
|
||||
request::Request,
|
||||
response::{Responder, Response},
|
||||
};
|
||||
use std::io::Cursor;
|
||||
|
||||
impl Responder<'static> for PreEscaped<String> {
|
||||
|
|
1
rustfmt.toml
Normal file
1
rustfmt.toml
Normal file
|
@ -0,0 +1 @@
|
|||
imports_granularity = "Crate"
|
Loading…
Add table
Reference in a new issue