Hi,

I suggest that linkcheck also checks "external" links to local URI's by verifying if the referred file exists. I use Sphinx to maintain http://www.vor-cycling.be/ which has lots of such links, and for me it is important to test them. I got that working for me with the following change in linkcheck.py:


def check():
    # check for various conditions without bothering the network
    if len(uri) == 0 or uri[0] == '#' or \
       uri[0:7] == 'mailto:' or uri[0:4] == 'ftp:':
        return 'unchecked', ''
    elif not (uri[0:5] == 'http:' or uri[0:6] == 'https:'):
        #~ return 'local', '' # LINE REPLACED BY THE FOLLOWING LINES
        filename = path.abspath(path.join(self.outdir,docname,'..',uri))
        if path.exists(filename):
            return 'working', ''
        else:
            return 'broken', 'File %s does not exist.' % filename


Luc

--
You received this message because you are subscribed to the Google Groups 
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sphinx-users+unsubscr...@googlegroups.com.
To post to this group, send email to sphinx-users@googlegroups.com.
Visit this group at http://groups.google.com/group/sphinx-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to