170 Commits

Author SHA1 Message Date
4d3c2a7139 Update repository.json 2025-04-24 14:05:29 +00:00
06d45e51b9 archive 2025-04-24 16:03:43 +02:00
0ddc896fc3 Merge branch 'master' of git.0x42.cloud:christian.morpurgo/MarkdownLivePreview 2025-04-24 16:03:09 +02:00
b71f83caac Vendor bs4 & soupsieve v6.0.0 2025-04-24 16:01:18 +02:00
6f488e0d64 Update repository.json 2025-04-24 13:35:51 +00:00
4eed4934ff Update repository.json 2025-04-24 13:30:58 +00:00
626793e31d Update repository.json 2025-04-24 13:22:41 +00:00
c5493db292 Update repository.json 2025-04-24 13:18:10 +00:00
e6b028506b Update repository.json 2025-04-24 13:11:23 +00:00
2973f7f138 Update repository.json v5.0.0 2025-04-24 12:41:55 +00:00
2a58c22160 Update repository.json 2025-04-24 12:41:44 +00:00
beb6cfe709 Update repository.json 2025-04-24 12:33:51 +00:00
44eb19d923 Update repository.json 2025-04-24 12:32:30 +00:00
0354ddf41d Add channel.json 2025-04-24 12:30:54 +00:00
fede6c2873 Update repository.json 2025-04-24 12:29:18 +00:00
141a7d062c Update repository.json 2025-04-24 12:25:46 +00:00
2365d6fec2 Merge branch 'master' of git.0x42.cloud:christian.morpurgo/MarkdownLivePreview v4.0.0 2025-04-24 14:19:26 +02:00
35c8a954d0 add feature:
setting to increase font scale
2025-04-24 14:18:29 +02:00
e914a2d4e9 Update repository.json 2025-04-24 12:13:14 +00:00
7fbb23b480 Add repository.json 2025-04-24 12:12:04 +00:00
ec27d980a3 meta: add known limitation about ordered lists #97
Sublime Text renders ordered lists as unordered lists. I've only added it to the README.md for now, because I'm not sure about how the GitHub website and README should sync...
v0.0.0
2019-12-05 07:35:27 +11:00
9fe7369029 meta: add keybinding info @ README
Just something people can copy paste quickly
v3.0.1
2019-11-27 09:35:29 +11:00
e462e8b3bc ImageLoader: spawn one thread per image. fix #93
In the process of fixing #93, I realized that we were spawning new
threads to fetch images for each update (we only need one).
2019-11-16 15:54:22 +11:00
cf68b2c202 Set the maxwidth for images (fix #48)
It didn't look pretty when images where larger than the viewport, and it
"broke" word wrap (because it stretched the phantom, and hence lines
wrapped further, see #34)

Sublime Text's minihtml only supports width and height attributes on
img tags, therefore, we have to determine the aspect ratio of the images
ourselves if we want to set a maxsize (so that we can set the height).

We use a hacky function copy pasted from stackoverflow to determine the
size of common format of images using std lib python.
2019-11-16 14:56:03 +11:00
c10bc95e54 remove utils.py file; use a setting file for delay between updates
utils.py contained two functions. One which wasn't used, and another,
get_settings() which I moved to MarkdownLivePreview.py

Add an entry to the command palette to edit the settings
2019-11-16 14:19:46 +11:00
84fb15aec3 update stylesheet to spread pre blocks (fix #56) 2019-11-16 11:16:58 +11:00
04989f8660 Use cuddled-lists options on markdown2 (fix #82) 2019-11-16 10:41:23 +11:00
192f61bf0c improve caching of images
First, we used two caches. Turns out that lru_cache wasn't needed, the
dict works perfectly fine on it's own.

Second, we now also cache local images, so that we don't have to read
them off the filesystem and convert them to base64 on every keystroke

Maybe there should be a maximum size on that cache dict, but I doubt
anyone would actually run into any trouble this cache taking too much
ram.
v3.0.0
2019-11-16 10:16:12 +11:00
2785df74ce Format everything with black
Follow the readme's instruction haha
2019-11-16 09:57:45 +11:00
e13842ede4 Mention the FIXME's in the README.md for peole to contribute 2019-11-16 09:41:00 +11:00
c6ac821c4a Merge remote-tracking branch 'update/master'
This is a weird merge. I had re-written everything in a separate
repository, and basically wanted that new repo (update) to be the new
master of this repository, whilst preserving the history of the update
repo.

Here's what I did:

$ git remote add update <path to update>
$ git fetch update
$ git merge -X theirs --allow-unrelated-histories update/master
$ # remove extra files
$ git commit --amend
2019-11-16 09:31:39 +11:00
9ad3f25d14 add license 2019-11-16 09:04:14 +11:00
eaa357a65f don't export png's and compilers to the final users
Though they are still available to the devs, as they are just
`export-ignore`d in the .gitattributes. I've done a little bit of
research, and this attribute prevents the files from being archived by
git. So, I'm assuming that package control fetches archives of the
packages, and not the actual ones. But I haven't found any documentation
on packagecontrol.io stating that. I quickly browsed its source code
on GitHub, and couldn't really find anything. So, I'm going to contact
@jfcherng, who showed me this trick on FileManager.
2019-11-16 08:48:51 +11:00
0f5630c3dc Set the preview's name (in the tab)
just a one liner
2019-11-16 08:28:04 +11:00
c14c28b56b fix the flickering by delaying and throwing
Explanation coming on my blog, math2001.github.io, something like
"lessons learned from re writing MarkdownLivePreview"
2019-11-16 07:50:55 +11:00
0dea8afba4 fix clipping of files after pre
The aim is to replace every \n in a <pre> with a <br /> because st
doesn't support pre.

However, ST doesn't support <br/> for some reason, only <br> or <br />.
We use to add some <br>s, but BeautifulSoup automatically adds a <br/>
when it sees a <br> (close the tag), which causes the clipping of the
rest of the file by ST. But if we replace every \n with a <br />,
BeautifulSoup automatically replaces it with <br/> (= ST bug)

So, we do exactly that, except that at the very end, when markdown2html
returns, we replace every <br/> with a <br />
2019-11-15 15:19:15 +11:00
e3896a6b3d fix indentation in pre in preview
Again, this is a dodgy hack: replace spaces with dot with the color
exactly like the background, because otherwise ST ignores it, even in
pre
2019-11-15 15:02:31 +11:00
6016f07cd1 add line breaks for pre 2019-11-15 14:52:20 +11:00
c0c9867cc8 move resources.py to MarkdownLivePreview.py
Having an extra file is just a pain because you have to save it manually
for ST to reload, and it was small and created way more trouble than it
needed to... It fits really nicely in there anyway

And add some nice CSS
2019-11-15 13:33:58 +11:00
5f2cac54e8 use a resource system to load images and stylesheet 2019-11-15 07:21:41 +11:00
8c1012eb8c Remove entry in phantom_sets when markdown_view is closed
Otherwise the object would keep on growing forever. It probably would
never ever be a problem for anyone, but it just makes me feel better
2019-11-14 21:33:37 +11:00
cc28bfef96 clean up code; support code block; add few FIXMEs 2019-11-14 21:14:20 +11:00
ef9b2daf6d Load images from the internet using an in memory cache
As soon as the plugin is reloaded, or the editor restarted, the images
must be reloaded. Maybe we could use a file cache...
2019-11-14 19:30:26 +11:00
bae26fc452 Viewing images works for local files
We have to make sure that everything is converted to base64 (and
replaced in the src attribute) because otherwise ST3 messes up the
height of the images
2019-11-14 17:28:47 +11:00
5738f6b5ff render the preview as soon as the markdown file loads 2019-11-14 15:56:55 +11:00
6bb8e6ebaa update preview when the user types
We don't have any delay in between updates (because i'm scared of
threading), which has a few problem:

1. probably really sluggish on slow systems
2. probably slow for readmes with images (need to test)
3. flickers (the phantoms are updated too quickly, so sometimes it
doesn't replace the old one smoothly)

BUG: the preview doesn't load when we preview the markdown file
2019-11-14 15:56:22 +11:00
8eb6882d60 Update readme.md with contributing info
Jokes, I haven't even set black on my own editor yet...
2019-11-14 12:16:18 +11:00
61cf2984eb Fix restoration of markdown_view as an original_view for unsaved files
It use to ask for confirmation (to save) because on_pre_close is run
after this dialog. Hence, we set the markdown_view as scratch for
unsaved files. :^)
2019-11-14 11:24:31 +11:00
7f7dcd6ba8 Restore the markdown_view as an original_view
See the top of MarkdownLivePreview.py for terminology

Doesn't work well for unsaved files, as pre_close is triggered after the
confirmation dialog
2019-11-14 11:20:20 +11:00
d3d88ddb49 Add basic readme.md 2019-11-14 11:16:47 +11:00