~sforman/thun-der#18: 
nbconvert, omg.svg doesn't make it to ReST

The nbconvert tool seems to lose track of an image file when converting from *.ipynb to *.rst. Every time I rebuild the docs I have to patch this ReST file:

diff --git a/docs/sphinx_docs/notebooks/Derivatives_of_Regular_Expressions.rst b/docs/sphinx_docs/notebooks/Derivatives_of_Regular_Expressions.rst
index 29dc9fb..68d6363 100644
--- a/docs/sphinx_docs/notebooks/Derivatives_of_Regular_Expressions.rst
+++ b/docs/sphinx_docs/notebooks/Derivatives_of_Regular_Expressions.rst
@@ -533,10 +533,10 @@ machine transition table.
 
 Says, “Three or more 1’s and not ending in 01 nor composed of all 1’s.”
 
-.. figure:: attachment:omg.svg
-   :alt: omg.svg
+.. figure:: omg.svg
+   :alt: State Machine Graph
 
-   omg.svg
+   State Machine Graph
 
 Start at ``a`` and follow the transition arrows according to their
 labels. Accepting states have a double outline. (Graphic generated with

The main problem is the attachment: prefix in:

.. figure:: attachment:omg.svg

The image file gets tucked into an attachments dict encoded in base64 (it looks like) in the *.ipynb notebook file:

{
 "attachments": {
  "omg.svg": {
   "image/svg+xml": [
    "PD94bWwgd ...snip... 2Zz4K"
   ]
  }
 },
 "cell_type": "markdown",
 "metadata": {},
 "source": [
  "## State Machine\n",
  "We can drive the regular expressions to flesh out the underlying state machine transition table.\n",
  "\n",
  "    .111. & (.01 + 11*)'\n",
  "\n",
  "Says, \"Three or more 1's and not ending in 01 nor composed of all 1's.\"\n",
  "\n",
  "![omg.svg](attachment:omg.svg)\n",
  "\n",
  "\n",
  "Start at `a` and follow the transition arrows according to their labels.  Accepting states have a double outline.  (Graphic generated with [Dot from Graphviz](http://www.graphviz.org/).)  You'll see that only paths that lead to one of the accepting states will match the regular expression.  All other paths will terminate at one of the non-accepting states.\n"
 ]
},

But then it doesn't make it to the ReST file, although if you remove the attachment: prefix Sphinx finds the image file. I had to copy the image file to the docs/sphinx_docs/notebooks dir myself IIRC. From there it winds up in the _images/omg.svg dir of the HTML output (from Sphinx) and it's properly linked in the notebook HTML.

Status
REPORTED
Submitter
~sforman
Assigned to
Submitted
a year ago
Updated
a year ago
Labels
No labels applied.