-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[ZEPPELIN-1614] Remove markdown4j dep #1594
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
Conversation
| } | ||
|
|
||
| public PegdownWebSequencelPlugin(Integer options, | ||
| Long maxParsingTimeInMillis, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, Zeppelin project Jave style guide discourage using of horizontal alignment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅
| return "http://www.websequencediagrams.com/" + json.substring(start, end); | ||
| } | ||
| } catch (IOException e) { | ||
| throw new RuntimeException("Failed to get proper response from websequencediagrams.com"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's always good idea to propagate e as cause though Constructor to aid debugging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅
| int end = json.indexOf("\"", start); | ||
|
|
||
| if (start != -1 && end != -1) { | ||
| return "http://www.websequencediagrams.com/" + json.substring(start, end); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason why url string, hardcoded in multiple places, can not be replaced with the constant field?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅
|
Websequence are awesome, thank you @1ambda for contributing this simplification of MD interpreter. Looks good to me, modulo few minor issues, commented above. As soon as CI is green and issues addressed - will be happy to merge to master, in case there is no further discussion. |
docs/interpreter/markdown.md
Outdated
| <img src="../assets/themes/zeppelin/img/docs-img/markdown-example-github-flavored-parser.png" width="70%" /> | ||
|
|
||
| <img src="../assets/themes/zeppelin/img/docs-img/markdown-example-markdown4j-parser.png" width="70%" /> | ||
| ### Supproted Plugins |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Supported"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:) ✅
|
This is awesome, thanks! |
|
Thanks for the review @bzz, @felixcheung! I'v just fixed :) |
|
Thanks @1ambda for the contribution. There could be more unknown differences. That means, existing notebook might render differently with pegdown and that could be unexpected result in some cases. So how about make pegdown default parser but still keep markdown4j parser support? That at least give user option to configure markdown interpreter with old markdown4j parser when they don't want to make change on existing notebook. |
|
And i think it'll be better mention in |
|
@Leemoonsoo Thanks for review 👍 It would be better to
Regarding to rendered output you provided, I think it is a bug of pegdown. |
df24ae9 to
25ae962
Compare
|
What should be the next steps here @1ambda? |
|
@bzz Resolving CI failure will be next step. But i think it is not problem of the markdown processor. All tests are failed in scalding interpreter test I will rebase and retrigger CI again. |
### What is this PR for? This PR adds support for formatting math formula formatting in %html display system using MathJax library. ### What type of PR is it? Feature ### Todos * [x] - Format math formula with MathJax library ### What is the Jira issue? https://issues.apache.org/jira/browse/ZEPPELIN-777 ### How should this be tested? try run following codes. ``` %md When \\(a \\ne 0\\), there are two solutions to \\(ax^2 + bx + c = 0\\) and they are $$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$ ``` Note MathJax works better with `markdown.parser.type` property set `pegdown`, in markdown interpreter. With default markdown4j parser, some formula is not well displayed. (for example, ax^2) I think this will not be a big problem because of we'll remove markdown4j #1594 ``` %sh echo -e "%html \$\$a = b\$\$" ``` ``` %spark println("%html $$b = c$$") ``` ### Screenshots (if appropriate)  ### Questions: * Does the licenses files need update? yes * Is there breaking changes for older versions? no * Does this needs documentation? yes Author: Lee moon soo <[email protected]> Closes #1606 from Leemoonsoo/ZEPPELIN-777 and squashes the following commits: af8e079 [Lee moon soo] Package MathJax resources 2afedde [Lee moon soo] Fix typo dd02bec [Lee moon soo] Add doc for mathmetical expression 174d7ad [Lee moon soo] Add license bb762c3 [Lee moon soo] Format formula using MathJax
### What is this PR for? This PR adds support for formatting math formula formatting in %html display system using MathJax library. ### What type of PR is it? Feature ### Todos * [x] - Format math formula with MathJax library ### What is the Jira issue? https://issues.apache.org/jira/browse/ZEPPELIN-777 ### How should this be tested? try run following codes. ``` %md When \\(a \\ne 0\\), there are two solutions to \\(ax^2 + bx + c = 0\\) and they are $$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$ ``` Note MathJax works better with `markdown.parser.type` property set `pegdown`, in markdown interpreter. With default markdown4j parser, some formula is not well displayed. (for example, ax^2) I think this will not be a big problem because of we'll remove markdown4j apache#1594 ``` %sh echo -e "%html \$\$a = b\$\$" ``` ``` %spark println("%html $$b = c$$") ``` ### Screenshots (if appropriate)  ### Questions: * Does the licenses files need update? yes * Is there breaking changes for older versions? no * Does this needs documentation? yes Author: Lee moon soo <[email protected]> Closes apache#1606 from Leemoonsoo/ZEPPELIN-777 and squashes the following commits: af8e079 [Lee moon soo] Package MathJax resources 2afedde [Lee moon soo] Fix typo dd02bec [Lee moon soo] Add doc for mathmetical expression 174d7ad [Lee moon soo] Add license bb762c3 [Lee moon soo] Format formula using MathJax
25ae962 to
035c1f8
Compare
|
resolve merge conflict with 777. Now CI is failing on I found the failed test related to markdown |
8346417 to
5af1607
Compare
|
@Leemoonsoo @felixcheung @bzz now CI is green :) |
|
@bzz Please let me know if you need anything to merge this PR :) |
|
Looks great to me, |
### What is this PR for? Remove unmanaged, old library markdown4j dep which exists just for Websequence and YUML plugins. (related to apache#1384) By adding Websequence and YUML plugins to pegdown - Removing markdown4j dependency which is unmanaged library currently. - Addtionally, we can remove `markdown.parser.type` options in **markdown interpreter** - Fixing some bugs in Websequence and YUML plugins - Enable others to add more plugins using pegdown sytnax. ### What type of PR is it? Improvement ### Todos Nothing ### What is the Jira issue? [JIRA - ZEPPELIN-1614](https://issues.apache.org/jira/browse/ZEPPELIN-1614) ### How should this be tested? Some functional tests are included. ### Screenshots (if appropriate) ### Questions: * Does the licenses files need update? - YES * Is there breaking changes for older versions? - NO * Does this needs documentation? - YES Author: 1ambda <[email protected]> Closes apache#1594 from 1ambda/feat/remove-markdown4j-dep and squashes the following commits: 5af1607 [1ambda] fix: Failed tests in InterpreterRestApiTest c57fdcb [1ambda] docs: Update markdown.md 5c62236 [1ambda] docs: Update upgrade.md for '%md' a1e779d [1ambda] style: Use zeppelin checkstyle.xml 13e0dc4 [1ambda] Update: interpreter setting and docs de3549d [1ambda] chore: Cleanup duplicated markdown4j license 7c5d41e [1ambda] fix: Parse style param optionally in webseq 8831ca1 [1ambda] fix: Wrap exceptions in catch stmt 9268695 [1ambda] Revert "fix: Cleanup unused Markdown4j Parser" 33fb800 [1ambda] Revert "docs: Remove markdown.parser.type option" fddc459 [1ambda] Revert "chore: Remove markdown4j dep and update license" a59ebbd [1ambda] Revert "fix: Set {} to avoid 503" 4e48933 [1ambda] Revert "fix: Parse style param optionally in webseq" 8cfb2c8 [1ambda] Revert "fix: style and misspell in docs" 73956e0 [1ambda] Revert "fix: Propagate exception in YUML plugin" 1b7787f [1ambda] fix: Propagate exception in YUML plugin c656d08 [1ambda] fix: style and misspell in docs dc4f110 [1ambda] fix: Parse style param optionally in webseq b43e14e [1ambda] fix: Set {} to avoid 503 c48cc53 [1ambda] chore: Remove markdown4j dep and update license 81fdfcc [1ambda] docs: Remove markdown.parser.type option cf19f0b [1ambda] fix: Cleanup unused Markdown4j Parser 98b2809 [1ambda] fix: Add missing docs 3e9716d [1ambda] feat: Yuml markdown plugin 3247c67 [1ambda] feat: Support webseq markdown plugin


What is this PR for?
Remove unmanaged, old library markdown4j dep which exists just for Websequence and YUML plugins.
(related to #1384)
By adding Websequence and YUML plugins to pegdown
markdown.parser.typeoptions in markdown interpreterWhat type of PR is it?
Improvement
Todos
Nothing
What is the Jira issue?
JIRA - ZEPPELIN-1614
How should this be tested?
Some functional tests are included.
Screenshots (if appropriate)
Questions: