@@ -96,8 +96,8 @@ impl PandocConverter {
9696 // Highlight style
9797 cmd. arg ( "--highlight-style" ) . arg ( & self . config . highlight_style ) ;
9898
99- // Add syntax definitions
100- cmd. arg ( "--syntax-definition" ) . arg ( & solidity_xml) ;
99+ // Skip broken Solidity syntax definition for now
100+ // cmd.arg("--syntax-definition").arg(&solidity_xml);
101101 for syntax_def in & self . config . syntax_definitions {
102102 cmd. arg ( "--syntax-definition" ) . arg ( syntax_def) ;
103103 }
@@ -110,16 +110,16 @@ impl PandocConverter {
110110 cmd. arg ( "--wrap=preserve" ) ;
111111 cmd. arg ( "-V" ) . arg ( "geometry:margin=1in" ) ;
112112 cmd. arg ( "-V" ) . arg ( "fontsize=10pt" ) ;
113- cmd . arg ( "-V" ) . arg ( "mainfont=DejaVu Sans Mono" ) ;
113+ // Don't force monospace font to allow syntax highlighting themes
114114 if self . config . include_toc {
115115 cmd. arg ( "--toc" ) ;
116116 }
117117 } ,
118118 OutputFormat :: Epub => {
119- // Add line wrapping for EPUB
119+ // Add line wrapping for EPUB
120120 cmd. arg ( "--wrap=preserve" ) ;
121- // Create temporary CSS file for EPUB
122- let temp_css = self . create_epub_css_file ( ) ?;
121+ // Only add minimal CSS that doesn't interfere with syntax highlighting
122+ let temp_css = self . create_minimal_epub_css_file ( ) ?;
123123 cmd. arg ( "--css" ) . arg ( & temp_css) ;
124124 if self . config . include_toc {
125125 cmd. arg ( "--toc" ) ;
@@ -128,8 +128,8 @@ impl PandocConverter {
128128 } ,
129129 OutputFormat :: Html => {
130130 cmd. arg ( "--standalone" ) ;
131- // Create temporary CSS file for HTML
132- let temp_css = self . create_html_css_file ( ) ?;
131+ // Only add minimal CSS that doesn't interfere with syntax highlighting
132+ let temp_css = self . create_minimal_html_css_file ( ) ?;
133133 cmd. arg ( "--css" ) . arg ( & temp_css) ;
134134 if self . config . include_toc {
135135 cmd. arg ( "--toc" ) ;
@@ -188,72 +188,50 @@ impl PandocConverter {
188188 Ok ( data_dir. join ( "scrollcast" ) . join ( "syntax" ) )
189189 }
190190
191- fn create_epub_css_file ( & self ) -> Result < PathBuf > {
191+ fn create_minimal_epub_css_file ( & self ) -> Result < PathBuf > {
192192 let temp_dir = std:: env:: temp_dir ( ) ;
193- let css_path = temp_dir. join ( "scrollcast_epub .css" ) ;
193+ let css_path = temp_dir. join ( "scrollcast_epub_minimal .css" ) ;
194194
195195 let css_content = r#"
196- code {
197- white-space: pre-wrap;
198- word-break: break-all;
199- font-family: 'Courier New', monospace;
200- font-size: 0.9em;
201- }
202-
196+ /* Ultra-minimal CSS for EPUB that doesn't interfere with syntax highlighting */
203197pre {
204198 white-space: pre-wrap;
205199 word-wrap: break-word;
206200 overflow-wrap: break-word;
207- background-color: #f8f8f8;
208- padding: 10px;
209- border-radius: 4px;
210- border: 1px solid #ddd;
211201}
212202"# ;
213203
214204 fs:: write ( & css_path, css_content)
215- . context ( "Failed to create EPUB CSS file" ) ?;
205+ . context ( "Failed to create minimal EPUB CSS file" ) ?;
216206
217207 Ok ( css_path)
218208 }
219209
220- fn create_html_css_file ( & self ) -> Result < PathBuf > {
210+ fn create_minimal_html_css_file ( & self ) -> Result < PathBuf > {
221211 let temp_dir = std:: env:: temp_dir ( ) ;
222- let css_path = temp_dir. join ( "scrollcast_html .css" ) ;
212+ let css_path = temp_dir. join ( "scrollcast_html_minimal .css" ) ;
223213
224214 let css_content = r#"
225- pre {
226- white-space: pre-wrap;
227- word-wrap: break-word;
228- overflow-wrap: break-word;
229- background-color: #f8f8f8;
230- padding: 15px;
231- border-radius: 6px;
232- border: 1px solid #ddd;
233- font-family: 'Courier New', Consolas, Monaco, monospace;
234- font-size: 14px;
235- line-height: 1.4;
236- overflow-x: auto;
237- }
238-
239- code {
240- font-family: 'Courier New', Consolas, Monaco, monospace;
241- background-color: #f1f1f1;
242- padding: 2px 4px;
243- border-radius: 3px;
244- }
245-
215+ /* Ultra-minimal CSS that doesn't interfere with Pandoc syntax highlighting */
246216body {
247217 font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
248218 line-height: 1.6;
249219 max-width: 1200px;
250220 margin: 0 auto;
251221 padding: 20px;
252222}
223+
224+ /* Only add line wrapping, no colors or backgrounds */
225+ pre {
226+ white-space: pre-wrap;
227+ word-wrap: break-word;
228+ overflow-wrap: break-word;
229+ overflow-x: auto;
230+ }
253231"# ;
254232
255233 fs:: write ( & css_path, css_content)
256- . context ( "Failed to create HTML CSS file" ) ?;
234+ . context ( "Failed to create minimal HTML CSS file" ) ?;
257235
258236 Ok ( css_path)
259237 }
0 commit comments