working browser rendering of markdown, latex or mathml

108 views
Skip to first unread message

James Casbon

unread,
Jul 11, 2010, 2:37:40 PM7/11/10
to codenod...@googlegroups.com
Hi codenoders,

I finally got round to looking at javascript code enough to put
together browser based rendering of markdown and latex equations
(please see attached pic). This has raised a number of issues.

Firstly, this needs a jquery update. The current version does not
work. What do you think about using a more recent version of jquery?
What is the state of the jquery plugins - are they needed?

Secondly, this seems to be a break from the tree model currently used
in the notebook. I *think* the tree model attempts to create a tree
from the nodes by placing titles, subtitles etc in a hierarchy.

Title
- subtitle
- codenode
- codenode
- subtitle
-codenode
etc.

With markdown, unless you parse the output to extract the structure of
titles, subtitles, you get a simple list of nodes:

markdown
codenode
codenode
markdown
etc

In my opinion, this is simpler to manage and allows more expressive
text (links, lists, quotes, etc). So I would favour of this approach.
It could also allow us to add ctrl+shift+enter to render markdown,
which saves messing around with modal dialogs to specify the text
type.

James

Picture 16.png

Alex Clemesha

unread,
Jul 11, 2010, 6:30:27 PM7/11/10
to codenod...@googlegroups.com
On Sun, Jul 11, 2010 at 11:37 AM, James Casbon <cas...@gmail.com> wrote:
Hi codenoders,

I finally got round to looking at javascript code enough to put
together browser based rendering of markdown and latex equations
(please see attached pic).
Oooh, that is extremely cool!

 
 This has raised a number of issues.

Firstly, this needs a jquery update.  The current version does not
work.  What do you think about using a more recent version of jquery?
I think it's a great idea.  The latest in 1.4.2, and it's has lot's of speed improvements,
among many other things.

 
 What is the state of the jquery plugins - are they needed?
Some are, and probably some are not.  Feel free to remove all that don't seem to
be used or are necessary.  The less code the better - especially unused stuff.

 

Secondly, this seems to be a break from the tree model currently used
in the notebook.  I *think* the tree model attempts to create a tree
from the nodes by placing titles, subtitles etc in a hierarchy.

Title
 - subtitle
    - codenode
    - codenode
 - subtitle
     -codenode
etc.

With markdown, unless you parse the output to extract the structure of
titles, subtitles, you get a simple list of nodes:

markdown
codenode
codenode
markdown
etc

In my opinion, this is simpler to manage and allows more expressive
text (links, lists, quotes, etc).  So I would favour of this approach.
 It could also allow us to add ctrl+shift+enter to render markdown,
which saves messing around with modal dialogs to specify the text
type.
I like the ctrl+shift+enter to render markdown, and I also agree that the modal dialog can be annoying.
Optimally, there would be buttons for all these actions (that can be shown/hid via a setting).  This has been a request feature by several people.


-Alex




 

James

--
http://groups.google.com/group/codenode-devel?hl=en
http://codenode.org



--
Alex Clemesha
clemesha.org

James Casbon

unread,
Jul 13, 2010, 4:51:10 PM7/13/10
to codenod...@googlegroups.com
On 11 July 2010 19:37, James Casbon <cas...@gmail.com> wrote:
> Hi codenoders,
>
> I finally got round to looking at javascript code enough to put
> together browser based rendering of markdown and latex equations
> (please see attached pic).

I have it working pretty fully now. based on they jquery-1.4 branch:
http://github.com/jamescasbon/codenode/tree/markdown

If you want to try, you should check it out and run the command
'codenode-admin installmathjax'
(I didn't want to check MBs of fonts into the repo)

you can use
$$ ... $$
\[ ... \]
for block equations or \( ... \) for inline, where ... = latex syntax.

ctrl+enter will toggle the input type and evaluate.

James

Reply all
Reply to author
Forward
0 new messages