Open TianBo-Timothy opened 7 years ago
This is not really a solution but more an alternative. You could use bootmark. It doesn't require you to use <xmp>
or <textarea>
, but still adds bootstrap and a bunch of other stuff. Also, it's in active development, unlike strapdown.
Disclaimer: I am the author of bootmark. ;)
Hi,
thanks for your suggestion. I tried bootmark this morning. It does not work as expected yet ...
What I did is like:
<!DOCTYPE html>
The first equation: `E = m c^2`
The second equation: `E = sum_i m_i c^2`
Both equations are shown. But the second block of markdown text is gone after rendering. And there is a navigation bar on the top of the page. Can you give any suggestion to fix it?
Best Regards Tian, Bo
On Thu, Oct 6, 2016 at 3:53 AM, obedm503 notifications@github.com wrote:
This is not really a solution but more an alternative. You could use bootmark https://obedm503.github.io/bootmark/. It doesn't require you to use
or
as of now, bootmark is intended to work with a single block of markdown, and not different segments with other text in between. The good news is that I'm working on a new version that should fix stuff regarding polyfills, and I could fix your issue in there. I really never thought of that use case (several blocks of markdown instead of one), so thanks for bringing that up. It's a great idea.
As for the navigation bar, you can disable that through config on the element with markdown. You simply need to add
<div id="bootmark" data-html="{ toc: false }">
...some markdown...
</div>
to the element with the id of markdown (remember that id's have to be unique), or add
<bootmark html="{ toc: false }">
...some markdown...
</bootmark>
if your using the <bootmark>
element.
toc stands for Table Of Contents.
Now that the idea came up of having multiple separated chunks of markdown, I might consider changin the requirement from id="bootmark"
to class="bootmark"
to allow for such a thing.
Also, I know that the docs are pretty bad right now, that should also be fixed on the new release.
So you will become the first to support AsciiMath along with markdown :)
I am also thinking about another approach: can we have some markdown directly for math, e.g.
E = sum_i m_i c^2
then you can figure out a way to use MathJax for further processing. In this way, it will feel more like a native solution.
What do you think ?
B.R. Tian, Bo
On Fri, Oct 7, 2016 at 1:58 AM, obedm503 notifications@github.com wrote:
as of now, bootmark is intended to work with a single block of markdown, and not different segments with other text in between. The good news is that I'm working on a new version that should fix stuff regarding polyfills, and I could fix your issue in there. I really never thought of that use case (several blocks of markdown instead of one), so thanks for bringing that up. It's a great idea.
As for the navigation bar, you can disable that through config on the element with markdown. You simply need to add
...some markdown...to the element with the id of markdown (remember that id's have to be unique http://stackoverflow.com/questions/7262195/several-elements-with-the-same-id-responding-to-one-css-id-selector), or add
...some markdown... if your using the
element. toc stands for Table Of Contents.
Now that the idea came up of having multiple separated chunks of markdown, I might consider changin the requirement from id="bootmark" to class="bootmark" to allow for such a thing.
Also, I know that the docs are pretty bad right now, that should also be fixed on the new release.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/arturadib/strapdown/issues/71#issuecomment-252120811, or mute the thread https://github.com/notifications/unsubscribe-auth/APcDeIH5C-IGElUOpacJgyo7UMrdBYoMks5qxYsPgaJpZM4KOgkD .
So you will become the first to support AsciiMath along with markdown :)
I am also thinking about another approach: can we have some markdown directly for math, e.g.
E = sum_i m_i c^2
then you can figure out a way to use MathJax for further processing. In this way, it will feel more like a native solution.
What do you think ?
B.R.
On Fri, Oct 7, 2016 at 1:58 AM, obedm503 notifications@github.com wrote:
as of now, bootmark is intended to work with a single block of markdown, and not different segments with other text in between. The good news is that I'm working on a new version that should fix stuff regarding polyfills, and I could fix your issue in there. I really never thought of that use case (several blocks of markdown instead of one), so thanks for bringing that up. It's a great idea.
As for the navigation bar, you can disable that through config on the element with markdown. You simply need to add
...some markdown...to the element with the id of markdown (remember that id's have to be unique http://stackoverflow.com/questions/7262195/several-elements-with-the-same-id-responding-to-one-css-id-selector), or add
...some markdown... if your using the
element. toc stands for Table Of Contents.
Now that the idea came up of having multiple separated chunks of markdown, I might consider changin the requirement from id="bootmark" to class="bootmark" to allow for such a thing.
Also, I know that the docs are pretty bad right now, that should also be fixed on the new release.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/arturadib/strapdown/issues/71#issuecomment-252120811, or mute the thread https://github.com/notifications/unsubscribe-auth/APcDeIH5C-IGElUOpacJgyo7UMrdBYoMks5qxYsPgaJpZM4KOgkD .
though it would be cool, adding a custom code block language might be overkill. (is it even possible?) You could use normal E = sum_i m_i c^2
syntax and disabling prettyprint. (prettyprint might mess up the math.) does asciimath allow for multiline math blocks? something like:
`
E = sum_i m_i c^2
`
I figured out how to use multiple bootmark elements/markdown blocks per page. This is still not on the latest stable release.
I'll look into having a custom code block language
after digging through MathJax's documentation I couln't find a simple method which would take a string of math and return html. So I looked for alternatives, and the internet gave me KaTeX. It does just what I wanted, and is alot faster than mathjax.
so, like you suggested, I created an extension for showdown (the parser used by bootmark) that uses katex to convert "latex code" to pretty math.
the syntax works like you suggested it should but instead of
```math
some math here
it uses
some math here
since the "code" is in latex.
For a demo of the extension check this https://obedm503.github.io/katex-latex/
that page is built from multiple elements. some with markdown outside and some with markdown inside. Shared config is defined in the `<script>` tag in the head of the document. Shared config is something new to version 0.5.0 of bootmark.
if you still need to use asciimath, it seems there are ways to [convert asciimath to latex](http://www.intmath.com/blog/mathematics/katex-with-asciimathml-input-and-mathjax-fallback-9456) which would then be converted by the extension but it's not clear how to accomplish that. I'll look into this tho.
TL;DR: katex-latex is a showdown extension for latex math in markdown. MathJax is slow, and KaTeX is fast (really fast compared to mathjax) with the tradeoff of latex instead of asciimath.
what do you think of the use of `latex` instead of `math` ?
It is certainly cool to be able to use Latex in Markdown. But it’s still better to use AsciiMath. The idea is to save time of writing (time of parsing is not a big issue here)
There is a Latex package called asciimth (https://github.com/judah/asciimath-tex). It is old but it works. It use similar syntax to write math. Is it possible to use this package along with KaTeX?
From: obedm503 Sent: Monday, October 10, 2016 5:50 AM To: arturadib/strapdown Cc: TianBo-Timothy ; Author Subject: Re: [arturadib/strapdown] Work with AsciiMath (#71)
after digging through MathJax's documentation I couln't find a simple method which would take a string of math and return html. So I looked for alternatives, and the internet gave me KaTeX. It does just what I wanted, and is alot faster than mathjax.
so, like you suggested, I created an extension for showdown (the parser used by bootmark) that uses katex to convert "latex code" to pretty math.
the syntax works like you suggested it should but instead of
some math here
it uses
some math here
since the "code" is in latex.
For a demo of the extension check this https://obedm503.github.io/katex-latex/ that page is built from multiple elements. some with markdown outside and some with markdown inside. Shared config is defined in the Githubissues.
Hi, I am in favor of Markdown and AsciiMath. AsciiMath is another javascript that enables something similar to Markdown that allows me to edit formula with text, see http://asciimath.org/. Unfortunately, strapdown and AsciiMath does not work properly together at the moment.
Currently, I can use AsciiMath only outside of
I am not able to propose a solution. However, I will be grateful if strapdown can solve this issue. So that we can use simple text to write documents with formulas.