MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Re: Making raw HTML appear in a notebook exported to

  • To: mathgroup at
  • Subject: [mg103717] Re: [mg103680] Re: Making raw HTML appear in a notebook exported to
  • From: Leonid Shifrin <lshifr at>
  • Date: Sat, 3 Oct 2009 09:04:26 -0400 (EDT)
  • References: <h9v6qo$9b1$> <>

Hi David,

There is a possibility which I used in publishing my book online. The reason
I did not answer your initial post is that I was expecting others to come up
with a better solution than mine. What I did was a kind of a rudimentary
"template" engine. If you have a look at my site <>, you will  notice that the pages produced by
Mathematica are embedded in one or another template. Those templates I
produced separately as html pages, and then wrote Mathematica scripts which
took the pages generated by Export, and used some simple string recognition
to parse them and find how to do the embedding. It worked pretty well for me
given that I have more than 500 pages and the embedding was done correctly
for all of them. Once I realized that with this procedure I am no longer
confined by the way Export does things, it was a big relief. The main
limitations  of course are that this procedure does not scale as the
complexity of the site grows, and the content is static. I have it in my
plans to convert this into some simple html-generating framework for
Mathematica, but did not find time for it so far.

I think, similar approach could work for you. You could simply use some
descriptors (string tokens, say) for the cell of interest so that the script
running after Export is done, will replace the generated html with a
different one, for this particular cell. This can be achieved rather easily,
in many cases much easier than forcing Export into submission.

Another possibility (I never tried it so this is just a blind guess) is to
try webMathematica -  may be it already implements all the functionality you


On Fri, Oct 2, 2009 at 4:23 PM, David Reiss <dbreiss at> wrote:

> Hmmmm....  No takers on this challenge?  Come on folks you can do
> better than this!
> Consider it a challenge!
> Do I have to figure **everything** out for myself?   :-)
> --David
> On Sep 30, 5:02 am, David Reiss <dbre... at> wrote:
> > I want to export a notebook to html with a particular behavior of a
> > particular cell.
> >
> > The cell in question should have its contents exported so that those
> > contents appear in the html of the resulting file exactly as written
> > in the cell.
> >
> > In essence I want to be able to insert raw html into the final html
> > file.
> >
> > This would be to, for example, embed a youTube video in the final html
> > file, or to embed some other object by having the html for that
> > embedding in the source notebook in the particular cell.
> >
> > I am sure that I can figure this out via some sophisticated
> > manipulation of the notebook via tagging and so on, but is there a
> > direct way to do this without changing the behavior of the normal html
> > export of the other cells in the notebook.
> >
> > I am wanting to do this so that I can easilly embed things in the
> > output of the blogging functionality ofhttp://
> > .
> >
> > Thanks!
> >
> > --David

  • Prev by Date: on passing arguments to a function, how to break a list into separate items during a call?
  • Next by Date: Re: Re: generating submultisets with repeated elements
  • Previous by thread: Re: Re: Making raw HTML appear in a notebook exported to
  • Next by thread: Re: Re: Making raw HTML appear in a notebook exported to