Ask Your Question

Tiddlywiki and Sage Cell Server

asked 2013-01-18 11:00:06 +0100

MHenderson gravatar image


Has anyone been successful in embedding a Sage cell in a Tiddlywiki wiki? Any help would be appreciated.

Thanks, Matthew Henderson

edit retag flag offensive close merge delete


Does it accept arbitrary HTML somehow? That would do it.

kcrisman gravatar imagekcrisman ( 2013-01-18 13:05:33 +0100 )edit

It does but it translates:<html>

</html> into
<div id="sagecell"></div>

MHenderson gravatar imageMHenderson ( 2013-01-21 05:39:02 +0100 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2013-01-18 18:19:56 +0100

Jason Grout gravatar image

updated 2013-01-18 18:21:04 +0100

I think I would probably create a tiddly plugin. You basically need to do two things:

  • edit the html file to include step 1 of (or make a plugin to do this)

  • figure out how to get a function called anytime a tiddler was done being edited, and make any class 'sage' divs into sagecells using something like the makeSagecell command above.

edit flag offensive delete link more


Reading a bit more I think I do have to write a plugin but I was hoping to avoid it because Tiddlywiki makes it easy to add the Sage code to the header of the wiki. The only problem I can see is how to add raw HTML to the wiki. A similar problem is mentioned here

MHenderson gravatar imageMHenderson ( 2013-01-21 05:43:19 +0100 )edit

I looked at macros and other things, and it still seemed that the best solution was a plugin. The thing is that you have to be able to give a block of code and you have to run some javascript on that block of code when a tiddler is saved. I don't know a lot about tiddlywiki, though---maybe there is a way to do that without writing a plugin?

Jason Grout gravatar imageJason Grout ( 2013-01-21 11:26:32 +0100 )edit

I think you're right. It doesn't look too hard so I think I'll give it a shot.

MHenderson gravatar imageMHenderson ( 2013-01-21 11:40:13 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2013-01-18 11:00:06 +0100

Seen: 556 times

Last updated: Jan 18 '13