atom / markdown-preview

📝 Markdown preview in Atom
MIT License
1.23k stars 358 forks source link

Settings for theme #322

Open ITler opened 8 years ago

ITler commented 8 years ago

When doing Save as HTML the resulting HTML's style reflects the theme settings of my atom editor. Although I'd like to use default dark theme in atom editor, I would like to have exported HTML files in another style (obviously light). My inconvenient work-around is to temporarily switch UI-Theme and Syntax-Theme, exporting to HTML and switch back. A better approach would be, if one could add 2 dropdown options to plugin's settings, i.e. 'UI-Theme overwrite' and 'Syntax-Theme overwrite'. Default values could be atom-default. When selecting another theme, these could be used when exporting HTML.

thedaniel commented 8 years ago

The "Copy as HTML" command will copy the HTML entirely unthemed, is this more useful to you?

ITler commented 8 years ago

Good idea, thank you, but not that what I would like to see. The doctype, html, body tags and head tag for setting charset (UTF-8 taken from atom settings) are missing. Tables have no borders. It is too less style here. And it takes even more manual rework than the work-around I've initially described.

That's why I'd like to file my initial request as enhancement.

simurai commented 8 years ago

We could force the GitHub style when Save as HTML. Then it will have a white background.

I think adding the data-use-github-style attribute to this line should do it.

Or maybe even better, make it change based on the the settings.

ITler commented 8 years ago

That wouldn't be the most flexible solution, but is the best compromise between effort and effect, hopefully leading to fast feature implementation. +1

rugk commented 8 years ago

Interestingly even if I temporarily select "Use GitHub.com style" and save the HTML file afterwards it saves it in my theme design. This may be related to a general theme issue however: https://github.com/atom/atom/issues/9550

It is also interesting that the export function applies my custom font settings of Atom. At least this was the case for the code parts in a markdown file, which made them displaying badly in the exported HTML file while they were displayed correctly in the preview. (BTW to change the font there I also had to change the setting in Atom and restart Atom so this may also be related to https://github.com/atom/atom/issues/9550)