6
$\begingroup$

I'm using Mathematica for Students on a Mac. How do I export a CDF document to HTML? According to the Wolfram website I should click on File > Deploy > Export as HTML. But I do not see the Deploy contextual menu item in my File menu. Has it been moved on the Mac version?

$\endgroup$
6
  • $\begingroup$ What OS are you using? $\endgroup$
    – rcollyer
    Commented Apr 23, 2012 at 0:17
  • $\begingroup$ Mac OS X 10.7; Mathematica 8 $\endgroup$
    – Michael
    Commented Apr 23, 2012 at 0:34
  • 1
    $\begingroup$ Hmm, didn't read far enough, I see. On my machine (OS X 10.6.8 - MMA v.8), Deploy is the fifth item from the bottom. It is right above Install and the 3 printing commands. $\endgroup$
    – rcollyer
    Commented Apr 23, 2012 at 0:45
  • $\begingroup$ @rcollyer What licence do you have? I'm using Mathematica Home Edition v. 8.0.4 for OS X, and there is no menu item called Deploy in my version either. $\endgroup$
    – Heike
    Commented Apr 29, 2012 at 9:37
  • $\begingroup$ @Heike I'm running the Student Edition v8.0.4. $\endgroup$
    – rcollyer
    Commented Apr 29, 2012 at 12:56

2 Answers 2

12
$\begingroup$

You do not really need a tool to depoly your CDF to HTML. It is very simple to do by hand. Here is what I do

  1. open your text editor and create a file called index.htm

    <HTML>    
    <BODY >
    This is my CDF
    
    <p>
    
    <script src="http://www.wolfram.com/cdf-player/plugin/v1.0/cdfplugin.js"
    type="text/javascript"></script><script type="text/javascript">// 
    <![CDATA[
    var cdf = new cdf_plugin();
    cdf.addCDFObject("source", "source.cdf",840,1435);
    // ]]></script>
    
    <P>
    </BODY>
    </HTML>
    
  2. From Mathematica, save your notebook as source.cdf (using SAVE AS->CDF). Save it to the same folder your created the above index.htm file to. So now your folder have 2 files in it: source.cdf and index.htm

  3. use your ftp program and upload these 2 files to your web site tree where you want to put them.
  4. that is all. Click on the index.htm and will run the CDF.

ps. If you want to just show the Manipulate part in your CDF and not the code around it, then before doing SAVE AS, select the code cells and do CELL->CELL properties-> and un check the open option so that the cell becomes closed.

So that the code cells (or any other cell you choose to close) are not open for view. This way, when someone sees your CDF, they only see the GUI part (i.e. the manipulate) and not any other cell you did not want them to see).

$\endgroup$
5
  • 1
    $\begingroup$ Hi, I don`t understand what am I supposed to replace your "This is my CDF" by. Is it the path to the file ? $\endgroup$
    – 500
    Commented Oct 1, 2012 at 19:11
  • $\begingroup$ Did not work for me! Any updates to your wonderful answer over the years? I use version 12.0 $\endgroup$
    – Dean
    Commented Aug 13, 2019 at 21:58
  • 1
    $\begingroup$ @Dean CDF's no longer work in HTML. This has been the case for may be 2-3 years. All browsers I know about have stopped supporting these types of plugins. Only way to run CDF's now is to download it to your computer and use the CDF player. $\endgroup$
    – Nasser
    Commented Aug 14, 2019 at 3:17
  • $\begingroup$ @Nasser, many thanks for this important information. I have got CDF player, thank you for your suggestion. However, are there other means of web deployment for my mathematica code? I have a project that would not be nice if only CDF player is to be used, $\endgroup$
    – Dean
    Commented Aug 18, 2019 at 20:56
  • 1
    $\begingroup$ @Dean I have not kept up with cloud activity with WRI. But you could try getting a cloud account at Wolfram. Check https://www.wolfram.com/mathematica/online/. You could also ask about this as separate question, as I really know very little about it. I do all my programing on the PC directly using Mathematica and Maple these days. Do not use any cloud/internet things. $\endgroup$
    – Nasser
    Commented Aug 22, 2019 at 7:17
10
$\begingroup$

The deploy functionality was introduced in Mathematica 8.0.4. To my knowledge, it is not available in 8.0.1.0, see the changelog.

$\endgroup$
1
  • $\begingroup$ Okay I have 8.0.0.0 installed. I will update my software. Thanks! $\endgroup$
    – Michael
    Commented Apr 23, 2012 at 3:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.