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

*To*: mathgroup at smc.vnet.net*Subject*: [mg103707] Re: [mg103680] Re: Making raw HTML appear in a notebook exported to*From*: David Reiss <dreiss at scientificarts.com>*Date*: Sat, 3 Oct 2009 09:02:31 -0400 (EDT)*References*: <h9v6qo$9b1$1@smc.vnet.net> <200910021223.IAA13461@smc.vnet.net>

HI Leonid, Yes, the technique of using templates and then doing string replacements is exactly what I use in the Blogging code for http://scientificarts.com.worklife . And that Is what I was working on extending to solve my problem. Mark McClure in his answer gives the really simple way of doing this via ConversionRules that I was hoping for. Thanks for your help! --David On Fri, Oct 2, 2009 at 10:00 AM, Leonid Shifrin <lshifr at gmail.com> wrote: > 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 > <www.mathprogramming-intro.org>, 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 forme > 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 > need? > > Regards, > Leonid > > > > On Fri, Oct 2, 2009 at 4:23 PM, David Reiss <dbreiss at gmail.com> 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 gmail.com> 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://scientificarts.com/worklife >> > . >> > >> > Thanks! >> > >> > --David >> >> > > -- This message and any attachments, may contain confidential and/or legally privileged information. If you are not the intended recipient of the message by the original sender, please destroy it. Message and attachments copyright (c) 2009, all rights reserved. Any unauthorized dissemination, distribution or copying is strictly forbidden.

**References**:**Re: Making raw HTML appear in a notebook exported to HTML***From:*David Reiss <dbreiss@gmail.com>