diff --git a/.sublime/Main.sublime-menu b/.sublime/Main.sublime-menu index efaa3a9..e0f88bc 100644 --- a/.sublime/Main.sublime-menu +++ b/.sublime/Main.sublime-menu @@ -7,14 +7,27 @@ "children": [ { "caption": "MarkdownLivePreview", - "command": "open_file", - "args": { - "file": "$packages/User/MarkdownLivePreview.css", - "contents": "/* See http://www.sublimetext.com/docs/3/minihtml.html#css to know which property you're able to use */\n\n$0" - } - } - ] - } + "children": [ + { + "caption": "Settings", + "command": "edit_settings", + "args": { + "base_file": "$packages/MarkdownLivePreview/.sublime/MarkdownLivePreview.sublime-settings", + "default": "// Your settings for MarkdownLivePreview. See the default file to see the different options. \n{\n\t\n}\n" + } + }, + { + "caption": "Style - CSS", + "command": "open_file", + "args": { + "file": "$packages/User/MarkdownLivePreview.css", + "contents": "/* See http://www.sublimetext.com/docs/3/minihtml.html#css to know which property you're able to use */\n\n$0" + } + }, + ] + }, + ], + }, ] } ] diff --git a/MarkdownLivePreview.tasks b/MarkdownLivePreview.tasks index 7f0ceac..d41b052 100644 --- a/MarkdownLivePreview.tasks +++ b/MarkdownLivePreview.tasks @@ -1,19 +1,12 @@ Fast: - ☐ sync scroll @needsUpdate(because of images) ☐ cache image in object when used, so that it's faster @needsTest - ☐ add clear cache command - ☐ update README for settings in view - ☐ add edit settings Medium: ☐ auto refresh preview if loading images ☐ use alt attribute for 404 error - ☐ use MarkdownLivePreview syntax, so we can use syntax's settings - ☐ listen for settings to change Long: - ☐ fix #4 @high ☐ support hanchor (TOC) @big Unknown: @@ -22,6 +15,12 @@ Unknown: ___________________ Archive: + ✔ 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) + ✔ update README for settings in view @done Mon 09 Jan 2017 at 18:41 @project(Fast) + ✔ add edit settings @done Mon 09 Jan 2017 at 18:41 @project(Fast) + ✘ listen for settings to change @cancelled Mon 09 Jan 2017 at 18:41 @project(Medium) ✘ call settings listener on_new too - might be too heavy @cancelled Sun 08 Jan 2017 at 19:33 @project(Fast) ✔ fix relative source @done Sun 08 Jan 2017 at 19:22 @project(Medium) ✔ add settings for the preview @done Sun 08 Jan 2017 at 17:36 @project(Fast) diff --git a/README.md b/README.md index 7bbe1d6..7a42b39 100644 --- a/README.md +++ b/README.md @@ -21,18 +21,58 @@ to have MarkdownLivePreview working on your computer. Cool right? You can [thank You can choose to enable MarkdownLivePreview by pressing alt+m or selecting in the command palette `MarkdownLivePreview: Edit Current File`. Note that you need to be editing (simply having the focus on) a markdown file. Because [Markdown Extended][markdown-extended] did a good job, it's compatible with this plugin. -It will open a new window, with only your markdown file, with the preview. Once your done, close whichever file and it'll close the entire window. +So, once you've run it, it will open a new window, with only your markdown file, with the preview. Once you're done, close whichever file and it'll close the entire window. -*Notice that it will close the entire window if you close **whichever** file. It means that if you open a random file in this window, and then close it, it'll close the entire window still* +*Notice that it will close the entire window if you close __whichever__ file. It means that if you open a random file in this window, and then close it, it'll close the entire window still* ### Settings -- `markdown_live_preview_on_open`: if set to `true`, as soon as you open a markdown file, the preview window will popup (thanks to [@ooing](https://github.com/ooing) for it's [suggestion](https://github.com/math2001/MarkdownLivePreview/issues/7#issue-199464852)). Default to `false` +- `markdown_live_preview_on_open`: if set to `true`, as soon as you open a markdown file, the preview window will popup (thanks to [@ooing](https://github.com/ooing) for its [suggestion](https://github.com/math2001/MarkdownLivePreview/issues/7#issue-199464852)). Default to `false` - `load_from_internet_when_starts`: every images that starts with any of the string specified in this list will be loaded from internet. Default to `["http://", "https://"]` -### In dev +Note: To edit your settings, search up in the command palette `Preferences: MarkdownLivePreview Settings`, or by using the menu: `Preferences → Packages Settings → MarkdownLivePreview → Settings` ;. It's not your global settings, but only the `MarkdownLivePreview`'s one -This plugin is not finished, there's still some things to fix (custom css, focus, etc). So, don't run away if you have any trouble, just submit an issue [here](http://github.com/math2001/MarkdownLivePreview/issues). +### Syntax Specific Settings + +This in an other "type" of setting. :laughing: If you have a look at the syntax of the preview file (not the markdown one, really the preview), you'll see that the syntax is `MarkdownLivePreviewSyntax`. This mean that you can specify specific settings for this specific syntax (such as `word_wrap: true`, `rulers: []`, etc). + +To do so, you can + +1. focus the *preview* (ctrl+2 to focus the second group, so, by default, the preview's group) +2. search up in the command palette `Preferences: Settings Syntax Specific`. It's in the *right* file that you can add the settings you want (not the left one). + +Note: MarkdownLivePreview will actualy look in this file for settings that aren't supported by default. Here they are: + +- `show_tabs` +- `show_minimap` +- `show_status_bar` +- `show_sidebar` +- `show_menus` + +They talk for themself, don't they? All of them takes a boolean (`true` or `false`). Note that those settings are *window* specific, not just view specific (that's why they aren't supported). It means that they'll affect the entire window, and every view in it. + +Here is an example of syntax specific settings for MarkdownLivePreviewSyntax: + +```json +{ + "show_menus": false, + "show_tabs": false, + "show_minimap": false, + "gutter": false, + "rulers": [], + "word_wrap": true +} +``` + +And here's what you'll get: + +![MarkdownLivePreview Screenshoot](screenshoots/syntax-specific-settings.png) + +*Note: to close a file, you can do ctrl+w (on Mac OS, it's cmd+w)* + +### Clear the cache + +MarkdownLivePreview caches every images it loads from internet (otherwise, you'd never see your images, or you'd need to have a *really* fast internet connection :smile:). So, if for some reason you want to clear the cache (a simple file), you can do so from the command palette by running ` ### Demo @@ -40,7 +80,11 @@ This plugin is not finished, there's still some things to fix (custom css, focus ### Custom css -It is possible to set your own css. But, be carefull, you have to respect [those rules](http://www.sublimetext.com/docs/3/minihtml.html#css). Just go to `Preferences -> Package Settings -> MarkdownLivePreview`. It will open a css file, here: `$packages/User/MarkdownLivePreview.css`. Just save it and it will automatically use it instead of the default one. +It is possible to set your own css. But, be carefull, you have to respect [those rules](http://www.sublimetext.com/docs/3/minihtml.html#css). Just go to `Preferences → Package Settings → MarkdownLivePreview → Style - CSS`. It will open a css file, here: `$packages/User/MarkdownLivePreview.css`. Just save it and it will automatically use it instead of the default one. + +### Somethings wrong!! + +If you find that something's wrong with this package, you can let me know by raising an issue on the [GitHub issue tracker][github-issue-tracker] ### How to open the [README](http://github.com/math2001/MarkdownLivePreview/README.md) @@ -49,3 +93,4 @@ Some of the package add a command in the menus, others in the command palette, o [markdown-extended]: https://packagecontrol.io/packages/Markdown%20Extended +[github-issue-tracker]: https://github.com/math2001/MarkdownLivePreview/issues diff --git a/screenshoots/syntax-specific-settings.png b/screenshoots/syntax-specific-settings.png new file mode 100644 index 0000000..dc0dccf Binary files /dev/null and b/screenshoots/syntax-specific-settings.png differ