-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Possibility to add own themes and to save the HTML #92
Comments
+1 |
Would be also okay if its just semiautomagically.. Like, moving some CSS to some folder and editing some config file.. Wouldnt even need UI for that.. |
Straight forward - adding CSS themes:
...
<div class="md-settings-row">
<span class="md-settings-label">Theme</span>
<select id="markdown-preview-theme">
<option value="clean">Light</option>
<option value="dark">Dark</option>
<option value="serif">Classic</option>
<option value="markdown7">Markdown7</option> <!-- ADDED -->
<option value="screen">Screen</option> <!-- ADDED -->
</select>
</div>
Straight forward - exporting the Preview:
Though, 2 imperfections here:
Different "straight forward" solutions should work, depending on how/where you want to save or share those files... you may edit the // Make <base> tag for relative URLS
var baseUrl = window.location.protocol + "//" + FileUtils.getDirectoryPath(doc.file.fullPath);
// NEW LINE:
var themeUrl = window.location.protocol + "//" + require.toUrl("./themes/" + _prefs.get("theme") + ".css");
// Assemble the HTML source
var htmlSource = _.template(previewHTML)({
baseUrl : baseUrl,
themeUrl : themeUrl, // MODIFIED
scrollTop : scrollPos,
bodyText : bodyText
}); |
It would be great if there would be the possibility to add own themes to the themes folder, and that the plugin just scans the folder and list all entries in the directories.
Also it would be nice to have the possibility to save the preview HTML - not everyone has their own build infrastructure for markdown files, or uses it in Github or some other site - and just want to generate a HTML file easily.
The text was updated successfully, but these errors were encountered: