Commits

rbeezer  committed 533213b

Make data directory explicit for graphics, CSS files

  • Participants
  • Parent commits eac47d3

Comments (0)

Files changed (1)

         for e in tree.getElementsByTagName('object'):
             if e.hasAttribute('data'):
                 graphics.append(e.getAttribute('data'))
+                new_data = os.path.basename(e.getAttribute('data'))
+                new_data = os.path.join('data', new_data)
+                e.setAttribute('data', new_data)
 
         # Mirror above to grab "regular" graphicx \includegraphics
         for e in tree.getElementsByTagName('img'):
             if e.hasAttribute('src'):
                 graphics.append(e.getAttribute('src'))
                 new_src = os.path.basename(e.getAttribute('src'))
+                new_src = os.path.join('data', new_src)
                 e.setAttribute('src', new_src)
 
         # Find and modify links in place
         # We first link in the CSS information from the data directory
         # The CSS file should be in with the graphics files, so doesn't need a path,
         # We add it to the data directory along with all the graphics files
-        content.append( r'<link type="text/css" rel="stylesheet" href="' + css_name + r'" />' )
+        content.append( r'<link type="text/css" rel="stylesheet" href="data/' + css_name + r'" />' )
         graphics.append(css_name)
 
         # Recognize cells, adorn compute cells