[issue1520] 'without make' documentation build anomaly
Tim Golden added the comment: The attached patch against r59286 tries to tease apart the uses of filename by adding webify_filepath and unwebify_filepath functions to sphinx.utils which are then used throughout the app to convert from filesystem-separated to web-separated paths and back. A WEB_SEP constant has been defined principally to make its purpose clear in case a constant / was thought to have been a hangover from the code's *nix origins. The result has been tested by building manually, ie by invoking python tools\sphinx-build.py with appropriate params under Win32 native only. The html, web and htmlhelp versions all style up and function correctly. It would obviously benefit from testing under Cygwin and *nix. I'm particularly keen to see it it works on a filesystem which doesn't allow / as a separator. Added file: http://bugs.python.org/file8860/sphinx-r59286.patch __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1520 __Index: builder.py === --- builder.py (revision 59286) +++ builder.py (working copy) @@ -27,7 +27,8 @@ from docutils.frontend import OptionParser from .util import (get_matching_files, attrdict, status_iterator, - ensuredir, get_category, relative_uri) + ensuredir, get_category, relative_uri, webify_filepath, + unwebify_filepath) from .writer import HTMLWriter from .util.console import bold, purple, green from .htmlhelp import build_hhx @@ -483,12 +484,12 @@ self.srcdir, '*.rst', exclude=set(self.config.get('unused_files', (: try: targetmtime = path.getmtime(path.join(self.outdir, - filename[:-4] + '.html')) + unwebify_filepath(filename)[:-4] + '.html')) except: targetmtime = 0 if filename not in self.env.all_files: yield filename -elif path.getmtime(path.join(self.srcdir, filename)) targetmtime: +elif path.getmtime(path.join(self.srcdir, unwebify_filepath(filename))) targetmtime: yield filename @@ -513,7 +514,7 @@ ctx = self.globalcontext.copy() ctx.update(context) output = self.templates[templatename].render(ctx) -outfilename = path.join(self.outdir, filename[:-4] + '.html') +outfilename = path.join(self.outdir, unwebify_filepath(filename)[:-4] + '.html') ensuredir(path.dirname(outfilename)) # normally different from self.outdir try: with codecs.open(outfilename, 'w', 'utf-8') as fp: @@ -522,7 +523,7 @@ print self.warning_stream, Error writing file %s: %s % (outfilename, err) if self.copysource and context.get('sourcename'): # copy the source file for the show source link -shutil.copyfile(path.join(self.srcdir, filename), +shutil.copyfile(path.join(self.srcdir, unwebify_filepath(filename)), path.join(self.outdir, context['sourcename'])) def handle_finish(self): @@ -547,10 +548,10 @@ self.srcdir, '*.rst', exclude=set(self.config.get('unused_files', (: try: targetmtime = path.getmtime(path.join(self.outdir, - filename[:-4] + '.fpickle')) + unwebify_filepath(filename)[:-4] + '.fpickle')) except: targetmtime = 0 -if path.getmtime(path.join(self.srcdir, filename)) targetmtime: +if path.getmtime(path.join(self.srcdir, unwebify_filepath(filename))) targetmtime: yield filename def get_target_uri(self, source_filename): @@ -577,7 +578,7 @@ self.indexer.feed(filename, category, title, doctree) def handle_file(self, filename, context, templatename='page'): -outfilename = path.join(self.outdir, filename[:-4] + '.fpickle') +outfilename = path.join(self.outdir, unwebify_filepath(filename)[:-4] + '.fpickle') ensuredir(path.dirname(outfilename)) context.pop('pathto', None) # can't be pickled with file(outfilename, 'wb') as fp: @@ -587,7 +588,7 @@ if context.get('sourcename'): source_name = path.join(self.outdir, 'sources', context['sourcename']) ensuredir(path.dirname(source_name)) -shutil.copyfile(path.join(self.srcdir, filename), source_name) +shutil.copyfile(path.join(self.srcdir, unwebify_filepath(filename)), source_name) def handle_finish(self): # dump the global context Index: directives.py === --- directives.py (revision 59286) +++
[issue1520] 'without make' documentation build anomaly
Joseph Armbruster added the comment: The good news: At a glance, the following look good: - building target html in cmd - building target htmlhelp then generating chm - building target html in cygwin - building target htmlhelp then generating chm The bad news [should a different bug be created for this?] See cmdline.rst: .. cmdoption:: -c command .. cmdoption:: -m module-name .. describe:: script Looks like genindex.html is being generated with some iffy markup: dt-c command/dt __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1520 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1520] 'without make' documentation build anomaly
Joseph Armbruster added the comment: Typo in my last comment: - building target html in cmd - building target htmlhelp then generating chm - building target html in cygwin - building target htmlhelp in cygwin then generating chm __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1520 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1520] 'without make' documentation build anomaly
Tim Golden added the comment: Joseph Armbruster wrote: The bad news [should a different bug be created for this?] See cmdline.rst: .. cmdoption:: -c command .. cmdoption:: -m module-name .. describe:: script Looks like genindex.html is being generated with some iffy markup: dt-c command/dt I'm not sure which way round you're say this. On my system, the markup is: dl class=cmdoption dt id=cmdoption-c tt class=descname-c/ class=descclassname lt;commandgt;/tta class=headerlink href=#cmdoption-c title=Permalink to this definition¶/a/dt ddpExecute .../p/dd /dl Is this right? Or wrong? It doesn't look disastrous to me. In either case, I doubt it's related to the path issues we've been addressing in this Issue. Probably best to raise a new Issue if you think there's a problem. TJG __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1520 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1520] 'without make' documentation build anomaly
Georg Brandl added the comment: I fixed the markup problem now, it was a missing escape filter in the template. Well spotted! I also applied the patch in r59309, so this should be fixed now. Many thanks! __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1520 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1520] 'without make' documentation build anomaly
Changes by Georg Brandl: -- resolution: - fixed status: open - closed __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1520 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1520] 'without make' documentation build anomaly
Tim Golden added the comment: Looks like it's the backslash as Windows path separator confusing the sphinx.util.relative_uri function. I'll try to put a patch together, although I'm not sure if relative_uri should use os.sep or whether the paths should be canonicalised before getting there. I'll try with os.sep to start with. -- nosy: +tim.golden __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1520 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1520] 'without make' documentation build anomaly
Tim Golden added the comment: Patch against sphinx r59269. Split on / and local os.sep. Causes problems with sphinx-web under native Win32. Added file: http://bugs.python.org/file8853/sphinx-r59269.patch __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1520 __ sphinx-r59269.patch Description: Binary data ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1520] 'without make' documentation build anomaly
Tim Golden added the comment: I'm a little flummoxed. Patching relative_uri in the sphinx/util/__init__.py to re.split on (/ + os.sep) sorts out the static generation. But it seems to introduce a couple of problems with the web-server version of the docs. One is that links end up without a category: http://localhost:3000/windows/ instead of http://localhost:3000/using/windows/. The other is that, even if you put the URLs in by hand, they don't work whereas /using%5cwindows *does* work. Which suggests that the windows-y path is being stored somewhere in the pickle files. So now we're stretched two ways: the HTML needs /-delimited names to work; the pickled files need \-delimited. I'm still looking at it, but if anyone has more knowledge that I have (couldn't exactly have less) then please feel free to chip in. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1520 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1520] 'without make' documentation build anomaly
Joseph Armbruster added the comment: Tim, Post up a patch of what you have up to now and I will look at it today. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1520 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1520] 'without make' documentation build anomaly
Tim Golden added the comment: OK, hacking away a bit further, I think I've found a solution, but I'll need to tidy it up a bit. In essence, the problem is that the filename is trying to be two things: the pointer for the local filesystem, and the uri for the web server. On *nix, this will pretty much work. On Windows -- and elsewhere, it won't. My approach is to treat the filename a little like unicode: decode to web-format on the way in; encode to local-format on the way out. In practice, this resolves to a bunch of .replace(path.sep, /) calls in one place and .replace(/, path.sep) in the comparatively rare cases we actually need to read the local filesystem. I realise that, on Windows, I could get a bit hacky and just assume that / will work throughout. But that obviously fails now for things like VMS and in the future for the hypothetical filesystem which uses . as its separator etc. I'm still working it through. The web and html versions are certainly working but I need to check out htmlhelp which has its own special needs. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1520 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1520] 'without make' documentation build anomaly
Georg Brandl added the comment: Really great that you're doing this! Many thanks! (Yes, I must admit that I was sloppy there...) __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1520 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1520] 'without make' documentation build anomaly
Joseph Armbruster added the comment: Tim, Appears you are on your way to a fix. If you need it tested on an alternate windows machine, post up and i'll run through it. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1520 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1520] 'without make' documentation build anomaly
Changes by Guido van Rossum: -- assignee: - georg.brandl nosy: +georg.brandl priority: - low __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1520 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1520] 'without make' documentation build anomaly
New submission from Joseph Armbruster: When I run the following from a windows command line, the resulting html can not be browsed stand-alone: python tools/sphinx-build.py -bhtml . build/htmlwin It looks like the paths are getting hosed up; for example: htmlcygwin/c-api/index.html contains: link rel=stylesheet href=../style/default.css type=text/css link rel=stylesheet href=../style/pygments.css type=text/css htmlcmd/c-api/index.html contains: link rel=stylesheet href=style/default.css type=text/css link rel=stylesheet href=style/pygments.css type=text/css Notes: These seemed to work fine: - building target html it in cygwin using make - building target html in cygwin without make - building target htmlhelp in cmd without make then generating chm -- components: Documentation, Documentation tools (Sphinx) messages: 57931 nosy: JosephArmbruster severity: minor status: open title: 'without make' documentation build anomaly type: behavior versions: Python 3.0 __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1520 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com