diff --git a/lib/main.coffee b/lib/main.coffee index 69c1033..9be7bb9 100644 --- a/lib/main.coffee +++ b/lib/main.coffee @@ -27,6 +27,10 @@ module.exports = openPreviewInSplitPane: type: 'boolean' default: true + customCSSFile: + title: 'Custom CSS File' + type: 'string' + default: '' grammars: type: 'array' default: [ diff --git a/lib/renderer.coffee b/lib/renderer.coffee index acbb0e6..73370be 100644 --- a/lib/renderer.coffee +++ b/lib/renderer.coffee @@ -47,6 +47,14 @@ render = (text, filePath, callback) -> html = sanitize(html) html = resolveImagePaths(html, filePath) + + customCSSPath = atom.config.get('markdown-preview.customCSSFile') + if customCSSPath + customCSSPath = customCSSPath + .replace(/^~?\//, (process.env.HOME or '')+'/') + customCSS = fs.readFileSync(customCSSPath, 'utf8') + html += "" + callback(null, html.trim()) sanitize = (html) ->