-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[ZEPPELIN-1387] Support table syntax in markdown interpreter #1384
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
|
@1ambda thank you for improvement! Let me review and get back to you with it. |
|
@1ambda Thank you for the contribution! I just shortly look through the screenshot in the description, but comparing to Github markdown support it seems Zeppelin's table doesn't have a table border. If I make the below table in Github, it will be shown like this. |
|
The change of library looks great to me, 👍 for having a test case! Few things to take care of, before merging it:
|
|
I will refine this PR. Thanks for the detailed and significant review :) @AhyoungRyu @bzz |
|
Thanks @1ambda for the improvement. Regarding license, 'markdown4j' section in the Also |
|
@Leemoonsoo Thanks! I'v added missing transitive deps and removed unused markdown4j dep. I also found that Should I updated |
|
Markdown4j supports YUML and Websequence, does this support the same? |
|
@felixcheung Thanks 👍 Pegdown doesn't support YUML, Websequence and Include plugins according to Pegdown Extensions I think we have 2 options. (or more)
|
|
@AhyoungRyu In regard to table style, Using CSS (e.g github-markdown-css) would be a better solution rather than adding inline style to every DOM such as |
- Wrap parsed DOM with div which has `markdown` class attr - Style them with github flavored markdown style ([github-markdown-css](https://github.com/sindresorhus/github-markdown-css)) - add [github-markdown-css](https://github.com/sindresorhus/github-markdown-css) license to `zeppelin-distribution`
|
Personally YUML and Websequence is very handy - I use them quite a bit. |
|
@1ambda Yeah it's good idea to apply github markdown style to Zeppelin. I tested again and it works well. Definitely better than before! But I found little bit wired behavior when I made a title. This title code makes a link and it's connected to Zeppelin home. Is it intended? |
- added some markdown syntax tests
|
It was due to the |
|
Regarding @felixcheung's comment, I think keeping backward compatibility is always very important.
|
|
@1ambda Yeah tested again and it looks good👍 Thanks! |
|
I think option 2 (Adding a property) is a better solution. because
|
|
I'v restored the markdown4j parser and added Additionally, [
{
"group": "md",
"name": "md",
"className": "org.apache.zeppelin.markdown.MarkdownInterpreter",
"properties": {
"markdown.parser.type": {
"envName": "MARKDOWN_PARSER_TYPE",
"propertyName": "markdown.parser.type",
"defaultValue": "markdown4j",
"description": "Markdown Parser Type. Available values: markdown4j, pegdown. Default = markdown4j"
}
}
}
] |
|
@1ambda Great! It works well as expected 👍 If you want to add the interpreter property( Also the below sentences in Overview section need to be updated accordingly.
FYI, |
| } catch (IOException | java.lang.RuntimeException e) { | ||
| LOGGER.error("Exception in Markdown while interpret ", e); | ||
| html = parser.render(markdownText); | ||
| } catch (Exception e) { |
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 to catch general Exception instead of more specific sub-classes?
|
@1ambda 👍 fot tests, looks great to me except for licensing issue raised by Moon and small comment above. If you could let me know you user name in ASF JIRA I'll be happy to help assigning ZEPPELIN-1387 to you. |
|
@Leemoonsoo I'v fixed license description. Also, now I understand when to describe licenses in @bzz I think it is better to use more specific exception types in catch block as you pointed out. Could you review e08929a again? |
|
Thanks @1ambda. Looks great to me. |
|
@1ambda Sadly the conflict needs to be resolved first before merging. But only for |
|
I'v resolved the merge conflict with 8f344db. Could you try again? :) |
|
@1ambda Yeah tested locally and looks good. Thanks for your quick response! Now it's really ready to be merged I think 👍 |
|
That CI failure is being handled in #1444, you should be able to rebase and have a green CI soon |
|
@1ambda You can rebase now :) |
|
Close PR to re-trigger CI |
|
Open PR to re-trigger CI |
|
Usually we prefer rebase since it doesn't pollute the commit history. But its fine, the end result is the same. We sometimes have flaky tests, I will check once the build is finished |
|
Finally, CI is green! :) |
|
Awesome, Merging if there is no more discussions |
### What is this PR for? Markdown interpreter's class name have changed from `Markdown` to `MarkdownInterpreter` in #1384 and this will bring some compatibility issue in case user have `Markdown` class specified in `conf/interpreter.json` file. This PR rollbacks markdown class name from `MarkdownInterpreter` to `Markdown` to avoid side effect ### What type of PR is it? Hotfix ### Questions: * Does the licenses files need update? no * Is there breaking changes for older versions? no * Does this needs documentation? no Author: Mina Lee <[email protected]> Closes #1449 from minahlee/update/markdownClassName and squashes the following commits: 7bdad44 [Mina Lee] Change classname of MarkdownInterpreter -> Markdown
### What is this PR for? Support table markdown syntax issued by [ZEPPELIN-1387](https://issues.apache.org/jira/browse/ZEPPELIN-1387?jql=project%20%3D%20ZEPPELIN) ### What type of PR is it? [Bug Fix | Improvement] This PR can be categorized as bug fix and improvement since it not only resolves the above issue but also support other markdown syntaxes. ### Todos * [ ] - Check the license issue of the [pegdown](https://github.com/sirthias/pegdown) library introduced by this PR ### What is the Jira issue? [ZEPPELIN-1387](https://issues.apache.org/jira/browse/ZEPPELIN-1387?jql=project%20%3D%20ZEPPELIN) ### How should this be tested? Write markdown texts and compare them with expected html DOMs. I'v also included some tests for this PR. ### Screenshots (if appropriate) <img width="708" alt="markdown" src="https://cloud.githubusercontent.com/assets/4968473/18061274/1f2be526-6e5d-11e6-9f1a-3528f3958d2c.png"> ### Questions: * Does the licenses files need update? * Does coding style is appropriate? ### Additional Comments We might solve this issue by implementing custom table plugin for markdown4j by referring [the existing work of txtmark](zhenchuan/txtmark@1784868). But I think it is not good idea in regard to coverage, maintainability and efficiency since markdown4j is currently not developed actively and it costs to implement all markdown plugins which is not supported by markdown4j. Author: 1ambda <[email protected]> Closes apache#1384 from 1ambda/fix-zeppelin-1387 and squashes the following commits: 16cda72 [1ambda] fix: Merge with 3c8158 to resolve CI failure e6d41c8 [1ambda] fix: Resolve merge conflict with 8f344db e08929a [1ambda] fix: Handle more specific exception in catch block 8b1e017 [1ambda] chore: Move github-markdown-css license to bin_licenses 4d1cb3c [1ambda] fix: Typo in docs/interpreter/markdown.md 85a5e3a [1ambda] fix: Use bower to install github-markdown-css 297733f [1ambda] fix: Modify github-markdown-css license 947a92a [1ambda] chore: Add license to newly created java files d228423 [1ambda] docs: Update markdown docs config, examples 2b6516c [1ambda] feat: Support markdown.parser.type attr in md d2d4455 [1ambda] style: Reformat using intellij-java-google-style bf9100d [1ambda] chore: Restore markdown4j dependency 55a2f10 [1ambda] fix: Add MarkdownParser interface to support mulitple parsers c33c715 [1ambda] fix: Remove the ANCHORLINKS option 9cf31d0 [1ambda] fix: Use markdown-body class (default) f741949 [1ambda] fix: Add styles for markdown 603d3db [1ambda] fix: Add missing transitive deps for pegdown 7aecdcb [1ambda] chore: Add pegdown to the binary license list fa14b3e [1ambda] style: Apply google java code style guide 029f550 [1ambda] [ZEPPELIN-1387] Support table in markdown interpreter
### What is this PR for? Markdown interpreter's class name have changed from `Markdown` to `MarkdownInterpreter` in apache#1384 and this will bring some compatibility issue in case user have `Markdown` class specified in `conf/interpreter.json` file. This PR rollbacks markdown class name from `MarkdownInterpreter` to `Markdown` to avoid side effect ### What type of PR is it? Hotfix ### Questions: * Does the licenses files need update? no * Is there breaking changes for older versions? no * Does this needs documentation? no Author: Mina Lee <[email protected]> Closes apache#1449 from minahlee/update/markdownClassName and squashes the following commits: 7bdad44 [Mina Lee] Change classname of MarkdownInterpreter -> Markdown
### 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 - 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 #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 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?
Support table markdown syntax issued by ZEPPELIN-1387
What type of PR is it?
[Bug Fix | Improvement]
This PR can be categorized as bug fix and improvement since it not only resolves the above issue but also support other markdown syntaxes.
Todos
What is the Jira issue?
ZEPPELIN-1387
How should this be tested?
Write markdown texts and compare them with expected html DOMs. I'v also included some tests for this PR.
Screenshots (if appropriate)

### Questions: - Does the licenses files need update? - Does coding style is appropriate? ### Additional CommentsWe might solve this issue by implementing custom table plugin for markdown4j by referring the existing work of txtmark.
But I think it is not good idea in regard to coverage, maintainability and efficiency since markdown4j is currently not developed actively and it costs to implement all markdown plugins which is not supported by markdown4j.