diff --git a/hyde/ext/plugins/sphinx.py b/hyde/ext/plugins/sphinx.py index 2f90592..3ccf383 100644 --- a/hyde/ext/plugins/sphinx.py +++ b/hyde/ext/plugins/sphinx.py @@ -87,30 +87,17 @@ class SphinxPlugin(Plugin): def _run_sphinx(self): """Run sphinx to generate the necessary output files. - This method creates a temporary directory, copies all sphinx-related - files into it, and then runs the sphinx build process to produce - the documentation fragments. + This method creates a temporary directory for sphinx's output, then + run sphinx against the Hyde input directory. """ self.sphinx_build_dir = Folder(tempfile.mkdtemp()) - # Copy all sphinx files into a temporary build directory. - self.sphinx_input_dir = self.sphinx_build_dir.child_folder("input") - self.sphinx_input_dir.make() - for resource in self.site.content.walk_resources(): - if resource.source_file.kind == "rst": - relpath = resource.relative_path - build_file = File(self.sphinx_input_dir.child(relpath)) - build_file.parent.make() - resource.source_file.copy_to(build_file) - # Run sphinx to generate output in the output directory. - self.sphinx_output_dir = self.sphinx_build_dir.child_folder("output") - self.sphinx_output_dir.make() conf_path = self.site.sitepath.child_folder(self.settings.conf_path) sphinx_args = ["sphinx-build"] sphinx_args.extend([ "-b", "json", "-c", conf_path.path, - self.sphinx_input_dir.path, - self.sphinx_output_dir.path + self.site.content.path, + self.sphinx_build_dir.path ]) if sphinx.main(sphinx_args) != 0: raise RuntimeError("sphinx build failed") @@ -118,6 +105,6 @@ class SphinxPlugin(Plugin): def _get_sphinx_output(self,resource): relpath = File(resource.relative_path) relpath = relpath.parent.child(relpath.name_without_extension+".fjson") - with open(self.sphinx_output_dir.child(relpath),"rb") as f: + with open(self.sphinx_build_dir.child(relpath),"rb") as f: return json.load(f) diff --git a/hyde/tests/ext/optipng/hyde-lt-b.png b/hyde/tests/ext/optipng/hyde-lt-b.png deleted file mode 120000 index 30dbddc..0000000 --- a/hyde/tests/ext/optipng/hyde-lt-b.png +++ /dev/null @@ -1 +0,0 @@ -../../../../resources/hyde-lt-b.png \ No newline at end of file diff --git a/hyde/tests/ext/optipng/hyde-lt-b.png b/hyde/tests/ext/optipng/hyde-lt-b.png new file mode 100644 index 0000000..09c383a Binary files /dev/null and b/hyde/tests/ext/optipng/hyde-lt-b.png differ