@@ -45,40 +45,41 @@ void front(const Document &document, const WritingState &state) {
4545 " width=device-width,initial-scale=1.0,user-scalable=yes" );
4646 }
4747
48- auto odr_css_file = File (
49- AbsPath (state.config ().resource_path ).join (RelPath (" odr.css" )).string ());
50- odr::HtmlResource odr_css_resource =
51- HtmlResource::create (HtmlResourceType::css, " text/css" , " odr.css" ,
52- " odr.css" , odr_css_file, true , false , true );
53- HtmlResourceLocation odr_css_location =
54- state.config ().resource_locator (odr_css_resource, state.config ());
55- state.resources ().emplace_back (std::move (odr_css_resource), odr_css_location);
56- if (odr_css_location.has_value ()) {
57- out.write_header_style (odr_css_location.value ());
48+ auto document_css_file = File (AbsPath (state.config ().resource_path )
49+ .join (RelPath (" document.css" ))
50+ .string ());
51+ odr::HtmlResource document_css_resource = HtmlResource::create (
52+ HtmlResourceType::css, " text/css" , " document.css" , " document.css" ,
53+ document_css_file, true , false , true );
54+ HtmlResourceLocation document_css_location =
55+ state.config ().resource_locator (document_css_resource, state.config ());
56+ state.resources ().emplace_back (std::move (document_css_resource),
57+ document_css_location);
58+ if (document_css_location.has_value ()) {
59+ out.write_header_style (document_css_location.value ());
5860 } else {
5961 out.write_header_style_begin ();
60- util::stream::pipe (*odr_css_file .stream (), out.out ());
62+ util::stream::pipe (*document_css_file .stream (), out.out ());
6163 out.write_header_style_end ();
6264 }
6365
6466 if (document.document_type () == DocumentType::spreadsheet) {
65- auto odr_spreadsheet_css_file =
66- File (AbsPath (state.config ().resource_path )
67- .join (RelPath (" odr_spreadsheet.css" ))
68- .string ());
69- odr::HtmlResource odr_spreadsheet_css_resource = HtmlResource::create (
70- HtmlResourceType::css, " text/css" , " odr_spreadsheet.css" ,
71- " odr_spreadsheet.css" , odr_spreadsheet_css_file, true , false , true );
72- HtmlResourceLocation odr_spreadsheet_css_location =
73- state.config ().resource_locator (odr_spreadsheet_css_resource,
67+ auto spreadsheet_css_file = File (AbsPath (state.config ().resource_path )
68+ .join (RelPath (" spreadsheet.css" ))
69+ .string ());
70+ odr::HtmlResource spreadsheet_css_resource = HtmlResource::create (
71+ HtmlResourceType::css, " text/css" , " spreadsheet.css" , " spreadsheet.css" ,
72+ spreadsheet_css_file, true , false , true );
73+ HtmlResourceLocation spreadsheet_css_location =
74+ state.config ().resource_locator (spreadsheet_css_resource,
7475 state.config ());
75- state.resources ().emplace_back (std::move (odr_spreadsheet_css_resource ),
76- odr_spreadsheet_css_location );
77- if (odr_spreadsheet_css_location .has_value ()) {
78- out.write_header_style (odr_spreadsheet_css_location .value ());
76+ state.resources ().emplace_back (std::move (spreadsheet_css_resource ),
77+ spreadsheet_css_location );
78+ if (spreadsheet_css_location .has_value ()) {
79+ out.write_header_style (spreadsheet_css_location .value ());
7980 } else {
8081 out.write_header_style_begin ();
81- util::stream::pipe (*odr_spreadsheet_css_file .stream (), out.out ());
82+ util::stream::pipe (*spreadsheet_css_file .stream (), out.out ());
8283 out.write_header_style_end ();
8384 }
8485 }
@@ -124,19 +125,21 @@ void back(const Document &document, const WritingState &state) {
124125 out.write_element_end (" div" );
125126 }
126127
127- auto odr_js_file = File (
128- AbsPath (state.config ().resource_path ).join (RelPath (" odr.js" )).string ());
129- odr::HtmlResource odr_js_resource =
130- HtmlResource::create (HtmlResourceType::js, " text/javascript" , " odr.js" ,
131- " odr.js" , odr_js_file, true , false , true );
132- HtmlResourceLocation odr_js_location =
133- state.config ().resource_locator (odr_js_resource, state.config ());
134- state.resources ().emplace_back (std::move (odr_js_resource), odr_js_location);
135- if (odr_js_location.has_value ()) {
136- out.write_script (odr_js_location.value ());
128+ auto document_js_file = File (AbsPath (state.config ().resource_path )
129+ .join (RelPath (" document.js" ))
130+ .string ());
131+ odr::HtmlResource document_js_resource = HtmlResource::create (
132+ HtmlResourceType::js, " text/javascript" , " document.js" , " document.js" ,
133+ document_js_file, true , false , true );
134+ HtmlResourceLocation document_js_location =
135+ state.config ().resource_locator (document_js_resource, state.config ());
136+ state.resources ().emplace_back (std::move (document_js_resource),
137+ document_js_location);
138+ if (document_js_location.has_value ()) {
139+ out.write_script (document_js_location.value ());
137140 } else {
138141 out.write_script_begin ();
139- util::stream::pipe (*odr_js_file .stream (), out.out ());
142+ util::stream::pipe (*document_js_file .stream (), out.out ());
140143 out.write_script_end ();
141144 }
142145
0 commit comments