Coder Social home page Coder Social logo

markdown-it-math's Introduction

Pælingar, sögur og önnur ritverk

This is my personal project. One might call it a blog page, but my goals are somewhat more ambitious than a mere blogpage might cover. Here I will not only share my thoughts, but also my projects (like my studies) and my stories.

Goals

This is not an exhaustive list, but it covers my most explicit goals...

  • To keep active a personal project that I can work on, and, at the same time experiment, and learn, the latest trends in web development
  • To keep an open platform for my project so I can share them easily
  • To document and share the many stories I have badly- or not documented at all
  • To share my latest thoghts on shit
  • To present them in an awsome way to make me look more interesting then I am

Contents

For now I'll be working on a few projecs including

  • Stories I've accumulated over the years like...

    • My hitchhiking trip trough America
    • My and Chantal`s life in the bus
    • My and Skúli`s trip around the world
  • Thinkings

    • Me trying to explain my philosophical views, like my disbelief in free will, my faith in mathematics in explaining the world, my many layman speculation in astronomy, cosmology, physics and stuff, and many more of my attemts to try to sound wise.
  • Other writings that I won't be able to fit into the previous categories, such as...

    • My masters project
    • scenes on how I've been doing this all (i.e. tutorials)

markdown-it-math's People

Contributors

leipert avatar lierdakil avatar runarberg avatar shellyln avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

markdown-it-math's Issues

Allow single line block math

Currently we ignore everything between opening block delimiters and the next newline. The reason being that future versions could use that space for arguments, as is the case with code fences. However, many people are used to write their block expressions in a single line, comming from typesetting systems like TeX, and it can be inconvenient for them to change their style when moving to markdown. Therefor we should allow single line block expressions to be allowed by default and perhaps in future versions make the code fence behavior optional.

block math syntax and generated display math block should be inline-blocks.

Thanks for this great plug-in!

I noticed that the block math have to be on separate lines. Typographically LaTeX display math are inline-blocks and they can be typed inline. So the following syntax should be supported:

some text right here $$ \alpha $$ and some more inline math. 

In addition, the generated html should be:

<p>some text right here 
    <span display math here></span>
</p>

Right now the handling is incorrect. the result atm is:

<p> some text right here</p>
<span display math></span>
<p></p>

not match some text

xxxx$$-2x<4$$

i test on dillinger which use markdown-it-math to parse latex

the result
image

but i add a space before $$, it work

xxxx $$-2x<4$$

image

```math as delimiter

Hey there,

while $ is definitely the more LaTeX way of delimiting math, I find the ```math way much more markdowny. Is there any way to make it work with markdown-it-math? I already tried the following with no luck:

this.md.use(markdownItMath, {
    inlineOpen: '`',
    inlineClose: '`',
    blockOpen: '```math',
    blockClose: '```',
});

npm install script doesn't seem to work

Hello,
Been trying to regenerate this module after making really minor changes to apply to my own use case, but the scripts fail every time. I thought after the minor change, I would just npm install again and regenerate everything, but I can't figure out why this isn't working.
Thanks,
Nick

Async math rendering callback?

I'm working on a Markdown editor, and I want to render MD with markdown-it. KaTeX supports sync call and return the rendered math, but MathJax can't. It can only accept a callback and call me when rendered.

about Inline parser

$$a$$b$$c$$

$$\mathbf{a}$$b$$c$$

The first code works fine. markdown-it-math tokenize a and c only.
But, the second code doesn't work. It try to parse \mathbf{a}$$b.

What makes this difference?
And, what should I do to parse the second code just like the first?

Error in the naming of "math_inline_close" token

The token "math_inline_close" is mistakenly named --- its name is "math_inline_close," instead (note the comma).

The error is in index.js, line L124:

token = state.push('math_inline_close,', 'math', -1);

The reason this matters is that I was implementing a custom renderer for the open and close tags; that's because I do not want the <math> tags in my output, because my output is not (necessarily) MathML.

Allow customizable opening and closing delimiters

People should be able to include math in their documents the way they are used to. For example some people only use a single $ for inline math and a double $$ for block level math (a la TeX) or \(...\) for inline and \[...\] for block.

This would replace #3

Katex version

So, my math was rendered badly due to old katex version which I fixed by
installing katex into my own project using this and then I copied the newly
installed version into markdown-it-math/node_modules which was made
to compromise different version (I think) - then it rendered everything correctly.

"dependencies": {
    "katex": "^0.6.0"
  },

In conclusion... changing the version to 0.15.1 fixex styling problem

`String.prototype.repeat` is not available in all JS engines

There is a problem with your use of String.prototype.repeat --- namely, it is not supported in all JS engines, as it is not part of standard ECMAScript (rather, it exists in the ECMAScript 6 proposal).

In my particular case, it is not available in node.js, version 0.10.29 (this is the version distributed with Debian Stable):

$ nodejs -v
v0.10.29

You are using that function in two places, both in index.js:

I was able to work around this issue with a polyfill available on the Mozilla Developer Network: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat

Of course, a polyfill might be too intrusive, since it changes String.prototype (though I don't care much, personally), but perhaps you should at least be able to modify that function to suit your needs.

Get rid of enclosing `<math>` tags

We shouldn't force people to render math into MathML. If some people want for some reason to render math into PNG, SVG, HTML/CSS or whatever they should be able to. This is possible now by meddling with the renderer for the math_inline_open, math_inline_close, math_block_open and math_block_close. But the amount of hacking required for something this simple should be necessary.

There are tons of good math-rendering tools out there that have a wide variety of rendering options. We should be able to use them out of the box without meddling with the renderer.

Make ascii2mathml dependency optional.

Hey, once me again.

We have the problem that a dependency in ascii2mathml breaks our installation (namely fsevents in chokidar in the babel package). See here: https://github.com/Galadirith/markdown-preview-plus/issues/118

Do you think it would be possible to provide markdown-it-math with an optional dependency ascii2mathml or even without ascii2mathml? If yes, I could also help you expanding docs that explain how to use this package together with Mathjax or KaTeX.

Thanks!

Render inline math blocks as inline math

If I have multiple ```backticks``` inline, it will be rendered as `inline code`.
Math should also $$x+y$$ work that way.

If I have multiple backticks inline, it will be rendered as inline code.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.