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
[ZEPPELIN-777] Math formula support #1606
Conversation
@@ -39,6 +39,13 @@ With `%html` directive, Zeppelin treats your output as HTML | |||
|
|||
<img src="/assets/themes/zeppelin/img/screenshots/display_html.png" /> | |||
|
|||
### Mathmetical expressions | |||
HTML display system automatically format mathmetical expression using [MathJax](https://www.mathjax.org/). You can use |
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.
format -> formats
@@ -53,6 +53,12 @@ The following example demonstrates the basic usage of Markdown in a Zeppelin not | |||
|
|||
<img src="../assets/themes/zeppelin/img/docs-img/markdown-example.png" width="70%" /> | |||
|
|||
## Mathmetical expression | |||
|
|||
Markdown interpreter leverage %html display system internally. That means you can mix mathmetical expressions with markdown syntax. For more information, please see [Mathmetical Expression](../displaysystem/basicdisplaysystem.html#mathmetical-expressions) section. |
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.
leverage -> leverages
@@ -39,6 +39,13 @@ With `%html` directive, Zeppelin treats your output as HTML | |||
|
|||
<img src="/assets/themes/zeppelin/img/screenshots/display_html.png" /> | |||
|
|||
### Mathmetical expressions |
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.
You mean mathematical
? :)
@@ -100,6 +100,20 @@ | |||
<![endif]--> | |||
<!-- endbuild --> | |||
|
|||
<script type="text/x-mathjax-config"> |
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.
Do you think we can move this part in a angular way like directive or something similar?
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 how MathJax is configured. And there's no needs to use this in anywhere else again. So i think it's better leave it as is.
@AhyoungRyu @anthonycorbacho addressed your comments. |
Tested and it works well as expected 👍 |
So cooool! 👍 |
@Leemoonsoo awesome work! so happy to see this coming through! I am running into the same problem as @minahlee Thoughts on why |
@minahlee @rawkintrevo I have fixed the problem. Now packaged one works as well. |
da87b9b
to
af8e079
Compare
@Leemoonsoo still not working for me, but it could be on my end- I have a hell of a time with git Did a fetch /hard reset within the last hour. $ git fetch leemoonsoo
$ git reset --hard leemoonsoo/zeppelin-777
$ mvn clean package -DskipTests
<build success>
$ bin/zeppelin-daemon.sh start Cleared browser cache / history / app data. |
@rawkintrevo I clean cloned this PR, build and tried with browser cache clean, but couldn't reproduce the problem. Could you find |
lgtm. +1 to merge again, awesome add @Leemoonsoo |
Thanks @rawkintrevo, @AhyoungRyu and @minahlee for the review. Merge to master if there's no further comment. |
### 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) ![image](https://cloud.githubusercontent.com/assets/1540981/20040864/3b69c540-a414-11e6-8f8a-fdf7ee1370a6.png) ### 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 <moon@apache.org> 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
I build a distribution from source code but it's failed because of missing /jax /extesions/ |
@giaosudau Hi! Thanks for sharing the issue :) Could you please share your building command line and error log? I don't know why, but I guess MathJax library wasn't downloaded from bower. |
@tae-jun |
@giaosudau Thanks for the prompt response! So you mean it doesn't happen without ZEPPELIN_SERVER_CONTEXT_PATH? But could you please check |
@tae-jun |
@giaosudau You clarified the issue! Would you like to create a JIRA ticket for that? :-) Then other developers will see the issue. Since this PR is already merged, so it seems to be handled on another PR. Thanks. |
@giaosudau Thanks! 👍 I appreciate it 😄 |
### What is this PR for? Currently `display_formula.png` (added by #1606) is broken in here: http://zeppelin.apache.org/docs/0.7.0-SNAPSHOT/displaysystem/basicdisplaysystem.html#mathematical-expressions Fixed it by using relative path for the image. But have no idea why the other image files are not broken in that page. ### What type of PR is it? Documentation | Hot Fix ### Todos * [ ] - Task ### What is the Jira issue? N/A ### How should this be tested? It can't be reproduced using docs dev mode. Needs to be tested with below steps. ``` 1) build gh-pages (website) branch JEKYLL_ENV=production bundle exec jekyll build cp -r _site/ /tmp/zeppelin_website/ mkdir -p /tmp/zeppelin_website/docs/0.7.0-SNAPSHOT 2) build this patch (docs) and copy it under docs/0.7.0-SNAPSHOT of website cd docs bundle exec jekyll build --safe cp -r _site/ /tmp/zeppelin_website/0.7.0-SNAPSHOT/ 3) start httpserver and browse http://localhost:8000/docs/0.7.0-SNAPSHOT/ cd /tmp/zeppelin_website python -m SimpleHTTPServer ``` ### Screenshots (if appropriate) **Before** - In the official website <img width="938" alt="screen shot 2016-12-13 at 7 07 27 pm" src="https://cloud.githubusercontent.com/assets/10060731/21136061/72c230b6-c167-11e6-9805-12d6f11f3270.png"> ``` GET http://zeppelin.apache.org/assets/themes/zeppelin/img/screenshots/display_formula.png 404 (Not Found) ``` **After** - test locally using same with production path <img width="877" alt="screen shot 2016-12-13 at 7 09 42 pm" src="https://cloud.githubusercontent.com/assets/10060731/21136136/bbff660e-c167-11e6-9ed3-384e609886fe.png"> ### Questions: * Does the licenses files need update? * Is there breaking changes for older versions? * Does this needs documentation? Author: AhyoungRyu <fbdkdud93@hanmail.net> Closes #1752 from AhyoungRyu/fix-img-path and squashes the following commits: 4be330b [AhyoungRyu] Fix broken display_formula.png by using relative path
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
What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-777
How should this be tested?
try run following codes.
Note MathJax works better with
markdown.parser.type
property setpegdown
, 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 #1594Screenshots (if appropriate)
Questions: