add 404 error

This commit is contained in:
Mathieu PATUREL
2017-01-01 20:58:05 +11:00
parent e4a5ea886a
commit b44151ed69
4 changed files with 9 additions and 5 deletions

BIN
404.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

View File

@ -1,11 +1,10 @@
todo:
☐ add message in status bar @notGoodIdea
☐ add **custom css** feature
☐ sync scroll
☐ sync scroll @needsUpdate
☐ load images from internet (`https:`)
☐ regive focus to the right markdown view
☐ set the title of the preview
☐ disable previewing when the preview is closed
☐ preview.set_scratch(True)
☐ add 404 image

View File

@ -34,6 +34,9 @@ def get_content_till(string, char_to_look_for, start=0):
return string[start:i], i
def to_base64(path):
if not os.path.exists(path):
return to_base64(os.path.join(os.path.dirname(__file__), '404.png'))
with open(path, 'rb') as fp:
content = fp.read()
return base64.standard_b64encode(content)

View File

@ -1 +1,3 @@
![my_img](C:\Users\math\Pictures\Img-style\ASCII.png)
![my_img](C:\Users\math\Pictures\Img-style\Fencedf.png)
this is a test