Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ST4: 4065+ HTMLSheet Updates #107

Closed
wants to merge 15 commits into from
Closed

ST4: 4065+ HTMLSheet Updates #107

wants to merge 15 commits into from

Conversation

TerminalFi
Copy link

@TerminalFi TerminalFi commented Apr 27, 2020

Should be a ST4 only branch

  • Requires => 4074

Will update the Package Control Channel to support ST3 and ST4 tags and set appropriate ST4 version requirement

Major Changes

  • Removes 2markdown.py in favor of Mdpopups
    • Provides proper code highlighting and handles md2html
  • Removes markdown2html.py implements ImageParser.py
    • Utilizes 95% of the same code with minor tweaks
  • Adds add_on_change for monitoring the SETTING_DELAY_BETWEEN_UPDATES
    to update the delay in real time. (Could be back ported)
  • Adds MdlpEraseCommand for erasing a view when called from on_pre_close Should probably be implemented on the ST3 branch to fix a bug in which EventListener doesn't have a edit object
    if self.file_name is None:
    total_region = sublime.Region(0, markdown_view.size())
    self.content = markdown_view.substr(total_region)
    markdown_view.erase(edit, total_region)
    else:
  • Replaces Phantoms with HTMLSheets which are implemented in ST4065
  • Implements a PREVIEW_VIEWS hash map to allow for multiple markdown previews (Could be back ported)
  • Adds a syntax setting that allows you to enable the plugin on different syntax files (Could be back ported)
  • Show only preview without edit (click for edit) #22

Fixes

fixes #94 - Fixed with ST4 Changes. Likely can fix in ST3 by using Mdpopups but not HTMLSheet
fixes #98 via facelessuser/sublime-markdown-popups@5c65d6f
fixes #103
fixes #104
fixes #106

@jrappen
Copy link

jrappen commented Apr 27, 2020

@TheSecEng: please add to the above message


fixes #98 via facelessuser/sublime-markdown-popups@5c65d6f
fixes #103
fixes #104

@TerminalFi TerminalFi marked this pull request as draft April 27, 2020 20:30
MarkdownLivePreview.py Outdated Show resolved Hide resolved
MarkdownLivePreview.py Outdated Show resolved Hide resolved
@jrappen
Copy link

jrappen commented May 4, 2020

ST Build 4074 and mdpopups v3.7.0 had breaking changes due to Sublime no longer supporting cmd and args for sublime.Window.new_html_sheet, at least breaking the 4065-4073 behavior.

Code is fine as is, but requirement should be bumped.

# FIXME: how do I choose how many workers I want?
# - Does thread pool reuse threads or does it stupidly throw them out?
# - (we could implement something of our own)
executor = concurrent.futures.ThreadPoolExecutor(max_workers=5)
Copy link

@rwols rwols Aug 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is overkill for this sort of plugin.

)
return "{}{}".format(
"data:image/png;base64,", b64encode(image_content).decode("utf-8")
)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you want to use asyncio instead of a ThreadPoolExecutor (which is IMO completely the wrong tool for this job).

@AmjadHD
Copy link

AmjadHD commented Oct 23, 2020

Why did work on this stopped ?

@TerminalFi
Copy link
Author

Why did work on this stopped ?

Why did work on this stopped ?

I just am in the middle of moving and what not. I’d be happy to get help with it.

I’ll start working on it again when I have time.

@TerminalFi TerminalFi closed this by deleting the head repository May 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants