Commits

jacobmason committed fa1d066

only provide pygments.css, update image locations.

Comments (0)

Files changed (4)

sphinx/builders/websupport.py

                       ctx, event_arg)
 
         # Create a dict that will be pickled and used by webapps.
+        css = '<link rel="stylesheet" href="%s" type=text/css />' % \
+            pathto('_static/pygmentcs.css', 1)
         doc_ctx = {'body': ctx.get('body', ''),
                    'title': ctx.get('title', ''),
-                   'css': self._make_css(ctx),
+                   'css': css,
                    'js': self._make_js(ctx)}
         # Partially render the html template to proved a more useful ctx.
         template = self.templates.environment.get_template(templatename)
     def dump_search_index(self):
         self.indexer.finish_indexing()
 
-    def _make_css(self, ctx):
-        def make_link(file):
-            path = ctx['pathto'](file, 1)
-            return '<link rel="stylesheet" href="%s" type=text/css />' % path
-
-        links = [make_link('_static/pygments.css')]
-        for file in ctx['css_files']:
-            links.append(make_link(file))
-        return '\n'.join(links)
-
     def _make_js(self, ctx):
         def make_script(file):
             path = ctx['pathto'](file, 1)

sphinx/themes/basic/static/websupport.js

     return this.each(function() {
       $(this).append(
 	$('<a href="#" class="sphinx_comment"></a>')
-	  .html(opts.commentHTML)
+	  .html('<img src="' + opts.commentImage + '" alt="comment" />')
 	  .click(function(event) {
 	    event.preventDefault();
 	    show($(this).parent().attr('id'));
     acceptCommentURL: '/accept_comment',
     rejectCommentURL: '/reject_comment',
     rejectCommentURL: '/delete_comment',
-    commentHTML: '<img src="/static/comment.png" alt="comment" />',
-    upArrow: '/static/up.png',
-    downArrow: '/static/down.png',
-    upArrowPressed: '/static/up-pressed.png',
-    downArrowPressed: '/static/down-pressed.png',
+    commentImage: '/static/_static/comment.png',
+    upArrow: '/static/_static/up.png',
+    downArrow: '/static/_static/down.png',
+    upArrowPressed: '/static/_static/up-pressed.png',
+    downArrowPressed: '/static/_static/down-pressed.png',
     voting: false,
     moderator: false
   }, COMMENT_OPTIONS);

sphinx/websupport/__init__.py

                                                           'reject_comment'))
             parts.append('deleteCommentURL: "/%s/%s",' % (self.docroot, 
                                                           'delete_comment'))
+
+        if self.staticdir != 'static':
+            p = lambda file: '%s/_static/%s' % (self.staticdir, file)
+            parts.append('commentImage: "/%s",' % p('comment.png') )
+            parts.append('upArrow: "/%s",' % p('up.png'))
+            parts.append('downArrow: "/%s",' % p('down.png'))
+            parts.append('upArrowPressed: "/%s",' % p('up-pressed.png'))
+            parts.append('downArrowPressed: "/%s",' % p('down-pressed.png'))
+            
         if username is not '':
             parts.append('voting: true,')
             parts.append('username: "%s",' % username)

sphinx/writers/websupport.py

                                       line=node.line,
                                       source=node.rawsource,
                                       treeloc='???')
+        if db_node_id == 30711:
+            import pdb
+            pdb.set_trace()
         return db_node_id