File tree Expand file tree Collapse file tree 3 files changed +13
-8
lines changed Expand file tree Collapse file tree 3 files changed +13
-8
lines changed Original file line number Diff line number Diff line change 1
- #![ feature( crate_visibility_modifier) ]
2
1
#![ feature( proc_macro_hygiene) ]
3
2
4
3
use comrak:: { self , Arena , ComrakOptions } ;
@@ -15,6 +14,10 @@ use syntect::parsing::SyntaxSet;
15
14
use syntect:: highlighting:: { Color , ThemeSet } ;
16
15
use syntect:: html:: highlighted_html_for_string;
17
16
17
+ use crate :: page:: Page ;
18
+ use crate :: string_writer:: StringWriter ;
19
+
20
+ mod page;
18
21
mod string_writer;
19
22
mod views;
20
23
@@ -86,11 +89,6 @@ fn build_page(
86
89
Ok ( ( ) )
87
90
}
88
91
89
- struct Page < ' a > {
90
- title : Option < & ' a AstNode < ' a > > ,
91
- content : & ' a AstNode < ' a > ,
92
- }
93
-
94
92
fn load_page < ' a > (
95
93
arena : & ' a Arena < AstNode < ' a > > ,
96
94
options : & ComrakOptions ,
@@ -118,7 +116,7 @@ fn load_page_title<'a>(
118
116
comrak:: format_commonmark (
119
117
title,
120
118
options,
121
- & mut string_writer :: StringWriter ( & mut buffer) ,
119
+ & mut StringWriter ( & mut buffer) ,
122
120
) . unwrap ( ) ;
123
121
buffer
124
122
} ) ;
Original file line number Diff line number Diff line change
1
+ use comrak:: nodes:: AstNode ;
2
+
3
+ pub struct Page < ' a > {
4
+ pub title : Option < & ' a AstNode < ' a > > ,
5
+ pub content : & ' a AstNode < ' a > ,
6
+ }
7
+
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ impl<'a> Render for ComrakText<'a> {
34
34
}
35
35
}
36
36
37
- crate fn main < ' a > (
37
+ pub fn main < ' a > (
38
38
options : & ' a ComrakOptions ,
39
39
slug : & str ,
40
40
page : Page < ' a > ,
You can’t perform that action at this time.
0 commit comments