custom css feature @done
This commit is contained in:
20
Main.sublime-menu
Normal file
20
Main.sublime-menu
Normal file
@ -0,0 +1,20 @@
|
||||
[
|
||||
{
|
||||
"id": "preferences",
|
||||
"children": [
|
||||
{
|
||||
"id": "package-settings",
|
||||
"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"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
@ -40,6 +40,8 @@ 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.
|
||||
|
||||
### How to open the [README](http://github.com/math2001/MarkdownLivePreview/README.md)
|
||||
|
||||
Some of the package add a command in the menus, others in the command palette, or other nowhere. None of those options are really good, especially the last one on ST3 because the packages are compressed. But, fortunately, there is plugin that exists and **will solve this problem** for us (and he has a really cute name, don't you think?): [ReadmePlease](https://packagecontrol.io/packages/ReadmePlease).
|
||||
|
||||
@ -27,7 +27,9 @@ def get_style():
|
||||
"""Of course, this is temporal, there will be an option to customize the CSS"""
|
||||
if os.path.exists(STYLE_FILE):
|
||||
with open(STYLE_FILE) as fp:
|
||||
return fp.read()
|
||||
content = fp.read()
|
||||
if content:
|
||||
return content
|
||||
|
||||
return """
|
||||
body {
|
||||
@ -63,7 +65,7 @@ def get_style():
|
||||
pre code {
|
||||
padding-left: 0;
|
||||
}
|
||||
""".replace('\n', '').replace('\t', '')
|
||||
"""
|
||||
|
||||
def pre_with_br(html):
|
||||
"""Because the phantoms of sublime text does not support <pre> blocks
|
||||
|
||||
Reference in New Issue
Block a user