text_returned: yield wrap_text(data, data[text_returned:match.start()]) element = list(self.element.generate()) # Now insert the start tag for prefix in element[:-1]: yield None, prefix # Return the match yield wrap_text(data, match.group()) # Close the tag yield None, element[-1] text_returned = match.end() # Return the text after the match if len(data) > text_returned: yield wrap_text(data, data[text_returned:]) else: yield mark, (kind, data, pos) ############################################################################## # End of MatchWrapTransformation implementation ############################################################################## abs_main_site_host = 'http://wz2100.net' if req.scheme == 'https': abs_static_site_host = 'https://static.wz2100.net' abs_stats_site_host = 'https://stats.wz2100.net' else: if 'warzone2100.org' in req.server_name: abs_static_site_host = '%s://static.wz2100.net' % (req.scheme) abs_stats_site_host = '%s://stats.wz2100.net' % (req.scheme) else: abs_static_site_host = '%s://static.wz2100.net' % (req.scheme) abs_stats_site_host = '%s://stats.wz2100.net' % (req.scheme) top_level_navigation = [ ('Home', '', 'house'), ('Download', 'download', 'server_go'), ('FAQ', 'faq', 'help'), ('User Guide', 'user-guide', 'script'), ('Forums', 'http://forums.wz2100.net/', 'comments'), ('Development', req.base_url, 'wrench'), ] footer_navigation = [ 'contact', 'newsletter', 'site-policy', 'privacy-policy', 'imprint', 'credits', 'license', ] wiki_pages = [ 'about', 'development', 'download', 'faq', 'features', 'screenshots', 'user-guide', ] # Default page home_page = 'frontpage' # Override the title for some pages override_page_titles = { "faq": "FAQ", } #trac_base_url = trac_env.config.get('trac', 'base_url') special_wiki_pages = { "faq": "FAQ", } def gen_top_level_link(link): if link.startswith('http'): return link else: return urljoin(abs_main_site_host, link) def do_highlight_top_level_link(link, page=None): link = link or home_page page = page or page_name if page == link: return {'id': 'active'} def urljoin(first, second, *rest): str = _urljoin(first, second) for part in rest: str = _urljoin(str, part) return str ?>
${select('*|comment()|text()')}