Beispiel #1
0
	def link_filter(self, makelink, relurl, title=None, here=False, *classes):
		url = urlify(os.path.join(self.destroot, relurl.lstrip('/')))
		url = os.path.splitext(url)[0] + self.extension
		classes = list(classes)
		if url in self.pages:
			page = self.pages[url]
			if page.get('stub', False):
				classes.append('stub')
			title = title or page.get('title', relurl)
			return makelink(title, url, classes)
		logging.warning(color('MISSING: %s', RED), url)
		classes.append('missing')
		classes.append('stub')
		if hasattr(self, 'view'):
			self.view.depend(self.view.neighbor(relurl))
		return makelink(title or relurl, url, classes)
Beispiel #2
0
	def get_context(self, relurl):
		url = urlify(os.path.join(self.destroot, relurl.lstrip('/')))
		url = os.path.splitext(url)[0] + self.extension
		return self.pages[url]
Beispiel #3
0
	def url_matches(self, relurl, oururl):
		url = urlify(os.path.join(self.destroot, relurl.lstrip('/')))
		url = os.path.splitext(url)[0] + self.extension
		return url == oururl