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

MathJax not working after update #12

Closed
zsiegel92 opened this issue May 17, 2018 · 42 comments
Closed

MathJax not working after update #12

zsiegel92 opened this issue May 17, 2018 · 42 comments

Comments

@zsiegel92
Copy link

zsiegel92 commented May 17, 2018

Adding the following to your MarkdownPreview User Settings will fix MathJax after the recent update:

"js": [
	"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js",
	        "res://MarkdownPreview/js/math_config.js",
],
"markdown_extensions": {
        "pymdownx.arithmatex": {
            "generic": true
        }
    }
@RoyiAvital
Copy link

There is issue with MathJax.
For instance this won't work:

Namely we need $ \operatorname{diag} \left( \mathcal{F} \left( g \right) \right) \operatorname{diag} \left( \mathcal{F} \left( g \right) \right) = I $ which means $ \forall i, \, {\mathcal{F} \left( g \right)}_{i} \in \left\{ -1, 1 \right\} $, namely the Fourier Transform of $ g $ has the values of -1 or 1. 

While it works in StackExchnage and MarkDown Preview Enhanced (In MathJax mode).

I'm not sure why it doesn't succeed parsing this.
Could it be something related to the configuration of mathjax.js?

@RoyiAvital
Copy link

OK, I narrowed it down.
For some reason in MarkdownPreview using \left\{ \right\} (Which is a perfect LaTeX Code) doesn't work.
It's not a MathJaX bug as it works perfectly in other MathJax Renders (See above).

Any idea?

@RoyiAvital
Copy link

RoyiAvital commented May 26, 2018

OK, I'm not sure what, but there is something in the CSS which interfere with the \{ or \} pattern.

What could it be?

@facelessuser , Could you assist finding it?

@RoyiAvital
Copy link

@facelessuser , I found the issue.
MarkDown Preview strips the \ when it encounters \{ or \}.
It could be related to MultiMarkdown Critic Marks or something but it breaks the MathJax.

Is there a way to find out what strips \ from \{ or \}?
Is there a way to turn in off or at least to not work within $ ... $ and $$ ... $$?

@facelessuser
Copy link
Owner

  1. Please open a new issue for new problems.

  2. While it works in StackExchnage and MarkDown Preview Enhanced (In MathJax mode).

    I need to be clear here, but not every Markdown parser parses the same. MathJax is not a feature native to Markdown but is usually added extra.

    So how do you protect the content between $...$? Well it is expected that the parser you are using would do this. GitHub has no protection, so no go there, but Python Markdown does via the extension pymdownx.arithmatex (if configurd) which is mentioned in Markdown Preview's documentation. But pay particular note to Arithmatex's requirements on $...$ as it won't target things like $2.00 and $3.00. Arithmatex simply preserves the content between the targeted $...$ and isolates it in a span and converts to the safer \(...\) form when using the documented generic form.

    So there is one bug in Markdown Preview (at least I consider it one). Our default config still enables MathJax's garbage $...$ support (they don't even enable it by default due to aggressive $ targeting) which will blindly target $2.00 and $3.00. So I will disable that by default in the next release.

    So if you configure things as mentioned in the documentation, you should get $...$ support, but you can't do things like $ some math $, you'd have to do something like $some math$ per Arithmatex's documentation. Though you could use \( some math \) which would be safe.

I will remove from the MathJax config detecting $...$ which is problematic. Something like Arithmatex should be used to target $...$ and covert to a safer form.

@RoyiAvital
Copy link

RoyiAvital commented May 26, 2018

@facelessuser ,
I'm not sure it has anything to do with $ ... $ or $...$ (Please don't remove it!).

The parser just removes cases like \{ and \} and leaves { and }.
I happens even if I use \( <MathJaxCode> \).

You can try:

  1. \\( \forall i, \, {\mathcal{F} \left( g \right)}_{i} \in \left\{ -1, 1 \right\} \\)
  2. \( \forall i, \, {\mathcal{F} \left( g \right)}_{i} \in \left\{ -1, 1 \right\} \)
  3. \\(\forall i, \, {\mathcal{F} \left( g \right)}_{i} \in \left\{ -1, 1 \right\}\\)
  4. \(\forall i, \, {\mathcal{F} \left( g \right)}_{i} \in \left\{ -1, 1 \right\}\)

None of them will work.
And the reason is something removes the \ inside Math Code.

Remark
When you let MathJax process the code, they have good heuristics so the cases you raised won't happen.
Please leave an option for $ ... $.
I moved to MarkDown Preview because of its StackExchange compatibility (They have no problem with those cases). It's not a bug, it is one of the best features!

@facelessuser
Copy link
Owner

Please read my comment again and read the documentation via the provider links. Removing $...$ from the config will not remove support for $ if you are using Arithmatex. Also, please post your extension settings for follow up conversation.

I have confirmed things are working, but I also explained there some considerations when using $ with Arithmatex. You must follow it's convention per its documentation.

@RoyiAvital
Copy link

RoyiAvital commented May 26, 2018

@facelessuser ,

Let's focus for a second on the following one line:

$ \forall i, \, {\mathcal{F} \left( g \right)}_{i} \in \left\{ -1, 1 \right\} $

When MarkdownPreview.sublime-settings is as following (Namely not enabling Arithmatex):

"js": [
        "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js",
        "res://MarkdownPreview/js/math_config.js"
    ]

The HTML body output (removing all CSS above):

<body><article class="markdown-body"><p>$ \forall i, \, {\mathcal{F} \left( g \right)}_{i} \in \left{ -1, 1 \right} $</p></article></body>

As can be seen, something removed \ in \{ and \} hence MathJax won't be able to render.

My question is (Before solving it with Arithmatex) is what removes the \ from the HTML code?
If it is a feature of the MarkDown parser, can I disable it?

On a side note, I would like to ask that Arithmatex will support $ ... $ and $$ ... $$ in advanced mode.
Like there is generic maybe add LaTeX for LaTeX users which means they know that in order to write the Dollar Sign they need to use escape \$ like in LaTeX / TeX.
This will keep compatibility fro people doing copy & paste from TeX documents and with StackExchange editor (I wrote about it in issue in the extension project).

Thank You.

@facelessuser
Copy link
Owner

I will repost this here for others to see as well:

Please create a new issue. But I will go ahead and comment here.

$$ ... $$ is already possible. There is no restriction on spaces between $$.

I can consider the advanced mode for inline, but it will need ArithMatex's non-generic mode. Discussed later in this comment.

No Issue with \}

There is no issue with }. Let me explain why.

The examples posted here worked with one understandable issue. The 1st and 3rd were not parsed as expected. This is because \ is treated as a Markdown escape, but then placed back in the HTML as a single \. Then MathJax parses it because it is looking for \(...\).

\\( \forall i, \, {\mathcal{F} \left( g \right)}_{i} \in \left\{ -1, 1 \right\} \\)

\( \forall i, \, {\mathcal{F} \left( g \right)}_{i} \in \left\{ -1, 1 \right\} \)

\\(\forall i, \, {\mathcal{F} \left( g \right)}_{i} \in \left\{ -1, 1 \right\}\\)

\(\forall i, \, {\mathcal{F} \left( g \right)}_{i} \in \left\{ -1, 1 \right\}\)

What you actually need to do is double escape because Markdown will take \\\\( and turn it into HTML like this \\( and then MathJax will ignore it. Makes sense? Even curly brackets that are escaped are expected to translate from \{ to { if not handled specially. So this does not surprise me. Take a look at how other Markdown parsers handle this: https://johnmacfarlane.net/babelmark2/?text=%5C%7Btest%5C%7D+%5C%5C.

So when escaping by properly with \\\\(...\\\\). Let's look at the results:

screenshot 2018-05-26 12 55 47

Now Markdown Preview has another extension enabled called pymdownx.escapeall which will allow any character to be escaped. So you'll probably see additional things get coverted like \f --> f. But you can disable that if you find it surprising:

screenshot 2018-05-26 13 00 39

Non Generic Mode

But here's a trick. You can use Arithmatex's non generic mode (when the generic option is set to False which is the default) to actually wrap stuff in special MathJax scripts, which MathJax looks for by default. Then you don't even need to setup your JavaScript config to look for silly things like \(...\) in your HTML. Then escaping like \\(...\\) will work fine. As mentioned earlier, this would be required when using \$. Arithmatex does not process \$ even in generic mode. It treats it special, so \$ becomes $ in HTML MathJax will process it anyways unless you let it look for the scripts instead.

You can actually configure your own config in Markdown Preview and point to it instead. This one doesn't look for plain text to convert, but looks for the special non-generic MathJax scripts.

MathJax.Hub.Config({
  config: ["MMLorHTML.js"],
  jax: ["input/TeX", "output/HTML-CSS", "output/NativeMML"],
  extensions: ["MathMenu.js", "MathZoom.js"],
  TeX: {
    extensions: ["AMSmath.js", "AMSsymbols.js"],
    TagSide: "right",
    TagIndent: ".8em",
    MultLineWidth: "85%",
    equationNumbers: {
      autoNumber: "AMS",
    },
    unicode: {
      fonts: "STIXGeneral,'Arial Unicode MS'"
    }
  },
  displayAlign: "left",
  showProcessingMessages: false,
  messageStyle: 'none'
});

I actually tried to drop generic mode originally, but users requested it back again to work with non-MathJax libs. It probably makes sense for Markdown Preview to not use generic mode by default.

@RoyiAvital
Copy link

@facelessuser ,
First, thank you for your patience, I really appreciate this.

I think I'm not explaining my self clear enough.
I'm also not an expert on those engines, I'm just a student find those tools as a god bless.

I write the following line in the md file (Single line file):

$ \left\{ -1, 1 \right\} $

Let's leave Arithmatex aside for a minute, let's say it is not configures.
What I would like to see in the HTML body is:

<article class="markdown-body"><p>$ \left\{ -1, 1 \right\} $</p></article></body>

Yet what I get is:

<article class="markdown-body"><p>$ \left{ -1, 1 \right} $</p></article></body>

Something, not related to Arithmatex removes the \ before { and }.
What I'm asking is the following, who does it and why?

@facelessuser
Copy link
Owner

@RoyiAvital, this was explained in the last post, but I'll try to be more clear. This is how Markdown handles {. etc. I showed you a tester that tests most of available Markdown parsers: Take a look at how other Markdown parsers handle this: https://johnmacfarlane.net/babelmark2/?text=%5C%7Btest%5C%7D+%5C%5C. Notice they all strip the \.

See the original Markdown spec: https://daringfireball.net/projects/markdown/syntax#backslash. Curly braces are handled special when \ precedes them. It escapes them which tells Markdown this curly bracket is not part of Markdown syntax, but is a literal { or }.

@RoyiAvital
Copy link

RoyiAvital commented May 26, 2018

@facelessuser ,
OK, So by the specification MarkDown parser which encounters \{ should output { which is what happens here.

This tells me that many parsers I use are not following specification (StackExchange, Markdown Preview Exchange, karmdown, etc...).

No I ask you, how can I protect the code inside $ ... $?
Is there a configuration of Arthimatex which can protect the case with $ ... $ (With gaps)?

As what's most important to me is that the same text will work on StackExchange, LaTeX and my Markdwon Editor (Currently your solution).

@facelessuser
Copy link
Owner

This tells me that many parsers I use are not following specification (StackExchange, Markdown Preview Exchange, karmdown, etc...).

Kramdown was actually covered in this link https://johnmacfarlane.net/babelmark2/?text=%5C%7Btest%5C%7D+%5C%5C. It follows the spec. I cannot account special extensions they add to do other things, but base Kramdown follows the spec.

No I ask you, how can I protect the code inside $ ... $?
Is there a configuration of Arthimatex which can protect the case with $ ... $ (With gaps)?

Arithmatex uses a smart detection of $, so currently, it cannot detect this. It needs $...$. Maybe, this could be added as an additional option to Arithmatex. Or if you add another 3rd party math Tex extension to your Sublime environment, you could use that if it allows it.

As what's most important to me is that the same text will work on StackExchange, LaTeX and my Markdwon Editor (Currently your solution).

This is least important to me. This will never be 1:1 with StackExchange. There will be corner cases etc. In previous posts I feel I've given details that explain a more ideal setup. I will most likely add a new config to the package and update the docs to suggest using a non-generic mode for the best user experience.

I will consider a different mode for Arithmatex to allow $ ... $. It would require explicit escapes of $.

@RoyiAvital
Copy link

RoyiAvital commented May 26, 2018

@facelessuser ,
By the way, I think a better default is displayAlign: "center",.

I'd be happy for any solution that will handle $ ... $ (Even if it means that in order to have the Dollar Sign one should so \$).
But I'm not sure what you mean by:

It would require explicit escapes of $.

Do you mean I will have to do \$ ... \$? If that so, it will miss the whole point.
I rather have \$ for the actual Dollar Sign.

Thank You!!!

@facelessuser
Copy link
Owner

What I meant was it would require explicit escape of $ to avoid it. So just $ ... $ would work and \$ ... \$ would not.

By the way, I think a better default is displayAlign: "center",.

Either way it is configurable. It's a matter of preference.

@RoyiAvital
Copy link

RoyiAvital commented May 26, 2018

OK!
What about \$, will that generate just the Dollar Sign (Assuming MathJax is only looking for elements defied to be processed)?

If so, this will be perfect.
Looking forward for that.

@facelessuser
Copy link
Owner

Yes, basically \$ behavior would not change. It'd be the same as it is now. Which means \$ converts to $.

@facelessuser
Copy link
Owner

Please create a new issue over at pymdown-extensions so I don't forget.

@RoyiAvital
Copy link

@facelessuser,

I created an issue for that - facelessuser/pymdown-extensions#297.

@facelessuser
Copy link
Owner

Thanks!

@facelessuser
Copy link
Owner

FYI, investigation as turned up some changes that will be coming up in the default MathJax config. It should work better with generic mode as is. For those who don't like the "smart" dollar behavior of MathJax, that functionality will have an off switch coming in the next Arithmatex version. Documentation will be updated accordingly.

@facelessuser
Copy link
Owner

A better default MathJax config is provided that targets just arithmatex classes. This will prevent some unexpected issues. Documentation has also been updated to be more clear.

Requested changes to disable "smart" dollar via an Arithmatex config option are still in the pipe.

@RoyiAvital
Copy link

RoyiAvital commented Jun 5, 2018

Something is wrong with the latest version (2.1.0).

Here is my MarkdownPreview Settings:

{
	"js": [
        "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js",
        "res://MarkdownPreview/js/math_config.js"
    ],
    "markdown_extensions": {
        "pymdownx.arithmatex": {
            "generic": true
        }
    }
}

I also tried "generic": false.

But I just can render the Math in this file:


I uninstalled SublimeText and started all again and still, no matter what I do it won't render the Math.
Hello

Inline Math: $\frac{1}{2}$.

What happened?

@facelessuser
Copy link
Owner

@RoyiAvital, Nothing changed. Your settings are just bad.

  1. markdown_extensions should be a list [] not a dictionary {}. This is to preserve order of extension loading.
  2. Since markdown_extensions is a list, you must wrap pymdownx.arithmatex in {} when add settings.

In your settings, the only extension you are enabling is pymdownx.arithmatex. If that is intentional, that is fine, but if you meant to add it to the existing extensions, then copy the default markdown_extensions and add arithmatex to that.

@RoyiAvital
Copy link

I just copied it from Markdown Preview Documentation - Extra.

I think that page should show the whole user settings file in a way which is a proper configuration.
I'm not an expert on those kind of Setting Files (Is that a js code or what?).
I thought I'm doing it the correct way by Copy & Paste as I did to the js part.

Should the User Settings file be like that:

{
	"js": [
        "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js",
        "res://MarkdownPreview/js/math_config.js"
    ],

    /*
        Markdown extension configuration.

        To specify a function in this JSON configuration, create an object with the key "!!python/name"
        and set it to the import path to the function "module.submodule.etc.function".
    */
    "markdown_extensions": [
        // Python Markdown Extra with SuperFences.
        // You can't include "extra" and "superfences"
        // as "fenced_code" can not be included with "superfences",
        // so we include the pieces separately.
        "markdown.extensions.smart_strong",
        "markdown.extensions.footnotes",
        "markdown.extensions.attr_list",
        "markdown.extensions.def_list",
        "markdown.extensions.tables",
        "markdown.extensions.abbr",
        {
            "markdown.extensions.codehilite": {
                "guess_lang": false
            }
        },
        // Extra's Markdown parsing in raw HTML cannot be
        // included by itself, but "pymdownx" exposes it so we can.
        "pymdownx.extrarawhtml",

        // More default Python Markdown extensions
        {
            "markdown.extensions.toc":
            {
                "permalink": "\ue157"
            }
        },
        "markdown.extensions.meta",
        "markdown.extensions.sane_lists",
        "markdown.extensions.smarty",
        "markdown.extensions.wikilinks",
        "markdown.extensions.admonition",

        // PyMdown extensions that help give a GitHub-ish feel
        "pymdownx.superfences",  // Nested fences and UML support
        {
            "pymdownx.magiclink": {   // Auto linkify URLs and email addresses
                "repo_url_shortener": true,
                "repo_url_shorthand": true
            }
        },
        "pymdownx.tasklist",     // Task lists
        {
            "pymdownx.tilde": {  // Provide ~~delete~~
                "subscript": false
            }
        },
        {
            "pymdownx.emoji": {  // Provide GitHub's emojis
                "emoji_index": {"!!python/name": "pymdownx.emoji.gemoji"},
                "emoji_generator": {"!!python/name": "pymdownx.emoji.to_png"},
                "alt": "short",
                "options": {
                    "attributes": {
                        "align": "absmiddle",
                        "height": "20px",
                        "width": "20px"
                    },
                    "image_path": "https://assets-cdn.github.com/images/icons/emoji/unicode/",
                    "non_standard_image_path": "https://assets-cdn.github.com/images/icons/emoji/"
                }
            }
        },
        {
        	"pymdownx.arithmatex":
        	{
            	"generic": true
            }
        }
    ],
}

@facelessuser
Copy link
Owner

I think that page should show the whole user settings file in a way which is a proper configuration.
I'm not an expert on those kind of Setting Files (Is that a js code or what?).
I thought I'm doing it the correct way by Copy & Paste as I did to the js part.

It comes from a general approach that the user is familiar with how Sublime settings work. I understand that some people are new though. I doubt I'm going to show the whole config as most of that information is irrelevant.

@facelessuser
Copy link
Owner

As far as your settings, I think it is good. Some of the alignment is wonky, but I think it is good.

@RoyiAvital
Copy link

I just did a Copy & Paste from the default.
So which alignment is wonky?

Waiting on the Artithmatex update to add "smart_dollar": false, and all will be perfect!

@facelessuser , Amazing Work!
I can finally drop HackMD and have most of its features in Sublime Text.

@facelessuser
Copy link
Owner

So which alignment is wonky?

Stuff like this 🙂 :

        	"pymdownx.arithmatex":
        	{
            	"generic": true
            }

Waiting on the Artithmatex update to add "smart_dollar": false, and all will be perfect!

Hopefully it will be soon. I'm waiting for the requester to make progress on the tabbed code feature in pymdown-extensions, but if that takes too long, I may just ship it.

@RoyiAvital
Copy link

On 49fedf9?diff=split#diff-ce3720e959d991a5ce99fb6f121ac498 You changed:

autoNumber: "AMS" into autoNumber: "all".
I really suggest that you'll revert that change as it makes any Display Equation to be numbered.

I would suggest the following MathJax Configuration:

MathJax.Hub.Config({
  config: ["MMLorHTML.js"],
  extensions: ["tex2jax.js"],
  jax: ["input/TeX", "output/HTML-CSS", "output/NativeMML"],
  tex2jax: {
    inlineMath: [ ['$','$'], ["\\(","\\)"] ],
    displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
    processEscapes: true,
    processEnvironments: true,
    ignoreClass: ".*|",
    processClass: "arithmatex"
  },
  TeX: {
    extensions: ["AMSmath.js", "AMSsymbols.js"],
    TagSide: "right",
    TagIndent: ".8em",
    MultLineWidth: "85%",
    equationNumbers: {
      autoNumber: "AMS",
    },
    unicode: {
      fonts: "STIXGeneral,'Arial Unicode MS'"
    }
  },
  displayAlign: "center",
  showProcessingMessages: false,
  messageStyle: 'none'
});

@facelessuser
Copy link
Owner

Please do create new issues instead commented in closed issues. While this is related to MathJax, this is a new introduced issue that should get a new issue tracker. And then I don't have to dig through the old closed issues to find it.

autoNumber: "AMS" into autoNumber: "all".
I really suggest that you'll revert that change as it makes any Display Equation to be numbered.

This was not intended to get merged, so I will revert. I was testing environments and such.

As for other changes, you are free to override the default provided. Everyone is going to have a difference of opinion on alignment and such. Since all you have to do is reference your personal config instead of the default, it is pretty easy to customize to your liking, but I will revert the all vs `AMS" autonumbering.

@facelessuser
Copy link
Owner

Okay, looking at the history, I introduced the left alignment in recent versions. To keep parity with what the default used to be, I'll set it back to the default, which I think was centered.

@RoyiAvital
Copy link

RoyiAvital commented Jun 9, 2018

I think it makes sense to have defaults as close as possible to what would one have in LaTeX as I believe most of the users who will use it have some experience with LaTeX.
Hence I chose displayAlign: "center" which matches how Display Mode Math is rendered in LaTeX (On default).

Regarding the issue, It is convenient to have all information in one place.
I'd even write some information on the effect of the parameters I chose in a Wiki.
But it seems the Wiki options for this repository is disabled hence I can create a page dedicated to MathJax related parameters.

Really appreciate your work quality.
I spread the word about what you did and at least 10 of my fellow students are now using your tools in their university work.

By the way, an idea to extension: Enable presentation mode.
Namely having the extension to generate an HTML (Maybe PDF as well?) presentation.
Something based on RevealJS or ReactJS.
You may have a look on tools in MarkDown for Slide Decks.

@facelessuser
Copy link
Owner

I'd even write some information on the effect of the parameters I chose in a Wiki.

I've enabled the Wiki. I haven't in the past used the wiki much on my repos, but if you feel there is some useful information that would benefit people, feel free to post it.

Really appreciate your work quality.
I spread the word about what you did and at least 10 of my fellow students are now using your tools in their university work.

I appreciate it.

By the way, an idea to extension: Enable presentation mode.
Namely having the extension to generate an HTML (Maybe PDF as well?) presentation.
Something based on RevealJS or ReactJS.
You may have a look on tools in MarkDown for Slide Decks.

It's an interesting idea. In my work environment it doesn't make since for me to use such a presentation framework as my employment expects powerpoint. Unfortunately I support too many repositories as is, so it is unlikely that I would have the time to do such project. But maybe someone one day will put together something like that. It wouldn't surprise me if someone else has played with such an idea.

@RoyiAvital
Copy link

OK,
I started the Wiki.
I will write there about what I understood about the configuration of the Math Display in Markdown Preview.

Regarding the Presentation Mode.
I'm not an expert but it seems one just need to wrap the MarkDown Code with some HTML Template as can be seen remark. So I think you can just easily add this template and add: Markdown Preview: Preview in Browser (Presentation) and Markdown Preview: Save to HTML (Presentation) and wrap with the template.

I might be missing the point here, but it could be a nice starting point.

@facelessuser
Copy link
Owner

FYI: smart_dollar support has been released, but I still need to merge the latest pymdown-extensions over to Sublime dependencies. Maybe later today, but definitely this week.

Regarding the Presentation Mode.
I'm not an expert but it seems one just need to wrap the MarkDown Code with some HTML Template as can be seen remark. So I think you can just easily add this template and add: Markdown Preview: Preview in Browser (Presentation) and Markdown Preview: Save to HTML (Presentation) and wrap with the template.

Remark looks like it has its own Markdown parser and such. I feel in general, something like this should be pushed to a different plugin. Mabye even something simple as a plugin that opens a new file with slideshow template, and you just fill in the Markdown content.

Markdown Preview is meant just to preview Markdown. It is kind of out of scope to provide slideshows etc. And if I add Remark, then I have to deal with other requests for X slideshow lib, or Y slideshow lib.

For the most part, Markdown Preview is pretty much feature complete FWIW. I basically took over maintenance to keep the project alive as I was pretty much the only active contributor, but I was not the original author. So basically I look at this project as fixing bugs, maintaining compatibility with the latest Sublime Text, and maybe reworking problematic things (like maybe one day having better live reload capability). As far as new features our concerned, I'd have to have a pretty compelling feature to convince me to add new stuff.

The idea with the 2.0 release was to simplify the guts of the code for easier maintenance. And to rely more on dependencies instead of us having to maintain our own vendored versions internally.

I'm much more active on repos that this relies on, such as: Python Markdown (as a contributor), Pymdown-Extensions (author), etc. Pymdown-Extensions is where most of the custom Markdown features are actually developed, such as smart_dollar disabling (as you requested), but even then, I'm picky about what I develop there as people can easily write there own extensions and include them without them having it be in that Pymdown-Extensions. Pymdown-Extensions was kind of born from my own biased document needs. Markdown Preview can actually include anyone's custom extensions, but it only requires pymdown-extensions out of the box.

@RoyiAvital
Copy link

@facelessuser ,
First, it is great you shared the information.
I also believe in simple programs which do what they should efficiently and are not bloated by features.

I thought that the presentation thing is just wrapping the MarkDown code with different template than Markdown Preview does (As it seems that remark works Online).
The only extra you can do is use Arithmatex for handling Math and configure MathJax as it is.
Once this done, I thought game over and it will work.

I wish I knew Python / JavaScript better to write such plug into your great Plug In project.

P. S.
I will try the new Plug In as soon as it is released!

@facelessuser
Copy link
Owner

I thought that the presentation thing is just wrapping the MarkDown code with different template than Markdown Preview does (As it seems that remark works Online).

Yes, that is what it seems, except I believe remark does the parsing, so you don't need MarkdownPreview to call any parsers on the source, meaning it doesn't really make sense to put it into MarkdownPreview. Just copy a template, put in your Markdown, and load it in your browser.

The only extra you can do is use Arithmatex for handling Math and configure MathJax as it is.
Once this done, I thought game over and it will work.

Not entirely sure what you are referring to here. I'm assuming it is related to the slideshows? If so, I don't think Arithmatex would work for this. As previously stated, remark seems to parse the Markdown itself; therefore, running your markdown through Python Markdown (with Arithmatex), doesn't make sense.

I will try the new Plug In as soon as it is released!

Just to clarify, as I want to make sure I understand, and am not giving off the wrong impression, I have no current plans to offer a slide show plugin. I honestly think what you need is just a template. I mentioned you could have a plugin simply create a new file with the template to make starting a slide show easy, but I wasn't planning on implementing one.

If I am mistaken, and this statement referred to the new release of the dependencies with your Arithmatex changes, then yes, that will be released soon.

@RoyiAvital
Copy link

@facelessuser ,
I meant I will test Arithmatex when it is ready.

Regarding the presentation, well Markdown Preview know how to send HTML code to the OS default HTML.
So I thought it as a driver for just wrapping the current Markdown document with the HTML template of remark and launch the browser.
Only that will be amazing.

Maybe, as you wrote, it could be a different project.
I wouldn't mind to see that mode in Markdown Preview.

@facelessuser
Copy link
Owner

So I thought it as a driver for just wrapping the current Markdown document with the HTML template of remark and launch the browser.

Yeah, Sublime knows how to do this too. Just have an HTML open, right click the view, select "Open in Browser". There really isn't need to specifically have Markdown Preview do it.

I know technically, the content is Markdown, but it is only loosely associated with Markdow Preview only because the content is Markdown, but Markdown Preview shouldn't actually send the content through any parser. Essentially, what is actually required is to just be wrap the arbitrary content in HTML and send it to the browser. It would basically need it's own path because it doesn't fit into what Markdown Preview actually does. That is why I don't think it really belongs in Markdown Preview. It is Markdown related, but it is actually moving into supporting markdown related libraries opposed to just parsing and previewing.

I meant I will test Arithmatex when it is ready.

As for Arithmatex support, the dependency as been updated, you'll have to run Satisfy Dependencies from Sublime's command palette, watch the console to see when it is finished updated the dependency, and then restart Sublime.

@RoyiAvital
Copy link

RoyiAvital commented Jun 11, 2018

Man, this is perfect!!!

Works like charm.
You have the best Markdown Environment!

@facelessuser
Copy link
Owner

Thanks! Glad it's working for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants