| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
If you are going to add html-like syntax support it is better to use HTMLParser/html5/html5lib module for parsing instead of regular expressions and to validate it with DTD instead of hand-written validator. |
Sorry, something went wrong.
|
This would introduce further dependencies and my idea is to have a very lightweight markup, nothing too much elaborated. |
Sorry, something went wrong.
HTMLParser is the part of the Python Standard Library. |
Sorry, something went wrong.
|
Hi @rougier I think this suggestion is overall a good idea. Also, don't forget to change the MEP number of the title and to add the MEP to the index of MEPs: the documentation fails to build on your branch as the new file is not part of any tree. |
Sorry, something went wrong.
|
@Kojoley Oh, I see. Ok, I will try to convert my code. |
Sorry, something went wrong.
|
@NelleV Problem is that I'm not quite sure of the number to use since there may be other MEP's around (I know for sure MEP28). But anyway, I'll got for 29 and fix the tree. |
Sorry, something went wrong.
|
That's a good point… It's also a good reason to merge MEPs as draft quite quickly. |
Sorry, something went wrong.
|
Wouldn't it make more sense to implement this as improvements to mathtext? instead of "Hello <b>world</b>!" "Hello <span color=blue>world</span>!" "Hello <span family=serif size=x-small>world</span>" have r"$\text{Hello \textbf{world}}$"
r"$\text{Hello \textcolor{blue}{world}}$"
r"$\text{Hello \textsf{\small world}}$"
You'll be able to have a better layout this way too (basically keep using the mathtext layout engine). (Initially posted to matplotlib-devel.) |
Sorry, something went wrong.
|
@anntzer This constrains the font family and I find it too verbose compared to the markup version. |
Sorry, something went wrong.
|
In what sense is the font family constrained? The default font will be the same (DejaVu) for mathtext and non-mathtext in 2.0 (#5214), and I'd guess changing the mathtext font and the non-mathtext font is approximately as complicated... Arguably $\text{}$ is a bit verbose, but anything inside is actually less verbose (compare <span family=serif>foo</span> and \textrm{foo}
or even possibly {\rm foo}
|
Sorry, something went wrong.
|
Isn't markdown all the rage nowadays? |
Sorry, something went wrong.
|
I think supporting markdown or html-like support would be a nice additional feature. As on the other MEPs, I'd suggest merging this as soon as possible as a draft, and discuss about this on the mailing list. |
Sorry, something went wrong.
|
@rougier I suggest that you mention @anntzer's mathtext suggestion in the Alternatives sections. I would also like to see you address the question of how the html-like approach would interact with mathext. Would they be mutually exclusive? Or could one markup style occur inside another? (I suspect the former is the case.) |
Sorry, something went wrong.
|
@myyc, I don't think markdown is appropriate for mpl. Markdown concentrates on aspects that don't normally occur in plots (formatting blocks of text as lists, etc.), and lacks the types of style control addressed by this MEP (color, font). |
Sorry, something went wrong.
|
@efiring exactly nailed it: what is supposed to happen when some writes $ <span ...> $ </span>? On the other hand I like the idea of using markdown, which does allow for embedding math (at least in the pandoc dialect). |
Sorry, something went wrong.
|
@anntzer @efiring you're right. I will update the MEP with alternative and potential problems. The fact is that I did not think at all of the latex text problem and I've no idea how to handle that case. |
Sorry, something went wrong.
|
Also, following @Kojoley comments, I need to integrate the html5lib module. |
Sorry, something went wrong.
|
If we decide to use html-like syntax then you should just use the stdlib's parser. |
Sorry, something went wrong.
|
Not sure where the right place to leave this comment is, but http://matplotlib.org/devdocs/users/annotations.html#using-complex-coordinates-with-annotations item 5 has a (I think) more robust way of doing the offset (as it will recompute the offset late). |
Sorry, something went wrong.
|
I am fine merging this MEP as a draft and continuing the discussion on the mailing list. Opinions? |
Sorry, something went wrong.
|
I would rather wait until @rougier has made the improvements to it that he has in mind based on the comments to date. Discussion on the mailing list can be more productive if it starts from a more complete MEP, and that is well within reach. |
Sorry, something went wrong.
|
Hope to work on it by the end of the week. |
Sorry, something went wrong.
|
Done. |
Sorry, something went wrong.
|
Just rebased because of conflict with MEP28 on index.rst |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
This is MEP for discussing the opportunity of adding lightweight markup to text.