Commits

Anonymous committed d43c670

+ Support for external stylesheets using .stylesheet_url configuration option

Comments (0)

Files changed (2)

                 ]
             start_response(status, response_headers)
             return [status]
-        print parts
         section, revision, file_path = parts
         # Get the configuration for that section.
         config = self.repo_map[section]
             else:
                 # Not in cache, convert to HTML.
                 w = Writer()
-                data = publish_string(data, writer=w)
+                settings = dict()
+                if config.stylesheet_url:
+                    settings.update(dict(
+                        embed_stylesheet = False,
+                        stylesheet = config.stylesheet_url,
+                        stylesheet_path = None,
+                        ))
+                data = publish_string(
+                    data, 
+                    writer=w, 
+                    settings_overrides=settings,
+                    )
                 f = open(cache_filename, 'wb')
                 f.write(data)
                 f.close()

slipper/config.py

     default = RepositoryInfo(
         cache_dir = config.pop('slipper.DEFAULT.cache_dir', None),
         rst_extension = config.pop('slipper.DEFAULT.rst_extension', '.rst'),
+        stylesheet_url = config.pop('slipper.DEFAULT.stylesheet_url', None),
         local_dir = None,
         hgweb_url = None,
         )