diff --git a/.sublime/MarkdownLivePreview.sublime-commands b/.sublime/MarkdownLivePreview.sublime-commands index 9f3dfca..01ab39c 100644 --- a/.sublime/MarkdownLivePreview.sublime-commands +++ b/.sublime/MarkdownLivePreview.sublime-commands @@ -7,6 +7,13 @@ "caption": "MarkdownLivePreview: Clear the cache", "command": "markdown_live_preview_clear_cache" }, + { + "caption": "MarkdownLivePreview: Edit Custom CSS File", + "command": "open_file", + "args": { + "file": "$packages/User/MarkdownLivePreview.css" + } + }, { "caption": "Preferences: MarkdownLivePreview Settings", "command": "edit_settings", diff --git a/MLPApi.py b/MLPApi.py index 6a4acc0..4956bd4 100644 --- a/MLPApi.py +++ b/MLPApi.py @@ -15,8 +15,7 @@ from random import randint as rnd __folder__ = os.path.dirname(__file__) -STYLE_FILE = os.path.join(os.path.dirname(__folder__), 'User', - 'MarkdownLivePreview.css') +USER_STYLE_FILE = os.path.join(os.path.dirname(__folder__), 'User', 'MarkdownLivePreview.css') # used to store the phantom's set windows_phantom_set = {} @@ -44,7 +43,10 @@ def create_preview(window, file_name): def get_style(): content = ''.join([line.strip() + ' ' for line in DEFAULT_STYLE_FILE.splitlines()]) - return content + "pre code .space {color: var(--light-bg)}" + if os.path.exists(USER_STYLE_FILE): + with open(USER_STYLE_FILE) as fp: + content += '\n' + fp.read() + '\n' + return content def show_html(md_view, preview): global windows_phantom_set diff --git a/MarkdownLivePreview.tasks b/MarkdownLivePreview.tasks index 188d8f5..5ede7fe 100644 --- a/MarkdownLivePreview.tasks +++ b/MarkdownLivePreview.tasks @@ -1,21 +1,21 @@ Fast: - ☐ sync scroll @needsUpdate(because of images) ☐ cache image in object when used, so that it's faster @needsTest Medium: ☐ auto refresh preview if loading images ☐ use alt attribute for 404 error - ☐ fix custom css @bug Long: - ☐ support hanchor (TOC) @big + ☐ support anchor (TOC) @big Unknown: - ☐ check how many times is the show_html function called ___________________ Archive: + ✔ fix custom css @bug @done Sun 22 Jan 2017 at 18:40 @project(Medium) + ✘ check how many times is the show_html function called @cancelled Sun 22 Jan 2017 at 18:40 @project(Unknown) + ✔ sync scroll @needsUpdate(because of images) @done Sun 22 Jan 2017 at 18:39 @project(Fast) ✔ fix #4 @high @done Mon 09 Jan 2017 at 18:42 @project(Long) ✔ use MarkdownLivePreview syntax, so we can use syntax's settings @done Mon 09 Jan 2017 at 18:41 @project(Medium) ✔ add clear cache command @done Mon 09 Jan 2017 at 18:41 @project(Fast) diff --git a/default.css b/default.css index 16f27ab..4142fb0 100644 --- a/default.css +++ b/default.css @@ -1,6 +1,8 @@ html { --light-bg: color(var(--background) blend(#999 85%)); + --very-light-bg: color(var(--background) blend(#999 92%)); } + body { padding:10px; padding-top: 0px; @@ -38,12 +40,12 @@ pre code { padding-left: 0; } +pre code .space { + color: var(--light-bg) +} + kbd { - padding: 0 .29412em; - border-radius: .2rem; - background-color: #f5f5f5; - color: #555; - box-shadow: 0 0.1rem 0 #b0b0b0; - word-break: break-word; + padding: 0 5px; + background-color: var(--very-light-bg); font-family: "Roboto Mono","Courier New",Courier,monospace; } diff --git a/sample.md b/sample.md index 7e7428d..51bd651 100644 --- a/sample.md +++ b/sample.md @@ -4,8 +4,25 @@ Some `inline code` with *italic* and **bold** text. ```python import this -if you('are', 'curious'): +if you is moods.curious: print('then do it!') ``` ctrl+\` or *View → Show Console* and paste `import this`! + +> Perfect programmers do NOT need comments. + +- to be efficient +- you need +- todos + +![Sublime Text Logo](https://upload.wikimedia.org/wikipedia/en/4/4c/Sublime_Text_Logo.png) + +Some plugin I just *need*: + +- [PackageResourceReviewer](https://packagecontrol.io/packages/PackageResourceViewer) +- [Boxy Theme](https://packagecontrol.io/packages/Boxy%20Theme) +- [Markdown Preview](https://packagecontrol.io/packages/Markdown%20Preview) +- [FileManager](https://packagecontrol.io/packages/FileManager) +- [PlainTasks](https://packagecontrol.io/packages/PlainTasks) +- [JSONComma](https://packagecontrol.io/packages/JSONComma)