def output_item(self, el, full_name, full_link): mark = '' if el.tag == 'const': mark = '(const)' elif el.tag == 'function': mark = '(function)' elif el.tag == 'constructor': mark = '(function)' elif el.tag == 'destructor': mark = '(function)' elif el.tag == 'class': mark = '(class)' elif el.tag == 'enum': mark = '(enum)' elif el.tag == 'typedef': mark = '(typedef)' elif el.tag == 'specialization': mark = '(class)' elif el.tag == 'overload': mark = '(function)' res = u'' res += '<tt><b>' + xml_escape(full_name) + '</b></tt> [<span class="link">' res += '<a href="http://en.cppreference.com/w/' + xml_escape(full_link) + '">' res += full_link + '</a></span>] <span class="mark">' + mark + '</span>\n' return res
def process_item_hook(self, el, full_name, full_link): global out_f, rel_link out_f.write('<keyword type="' + xml_escape(self.get_mark(el)) + '" name="' + xml_escape(full_name) + '" link="' + xml_escape(rel_link) + '"/>\n') IndexTransform.process_item_hook(self, el, full_name, full_link)
elif el.tag == 'class': return 'class' elif el.tag == 'enum': return 'enum' elif el.tag == 'typedef': return 'typedef' elif el.tag == 'specialization': return 'class' elif el.tag == 'overload': return 'function' return '' def process_item_hook(self, el, full_name, full_link): global out_f, rel_link out_f.write('<keyword type="' + xml_escape(self.get_mark(el)) + '" name="' + xml_escape(full_name) + '" link="' + xml_escape(rel_link) + '"/>\n') IndexTransform.process_item_hook(self, el, full_name, full_link) out_f.write('<?xml version="1.0"?>\n' + '<book title="' + xml_escape(book_title) + '" xmlns="http://www.devhelp.net/book' + '" name="' + xml_escape(book_name) + '" base="' + xml_escape(book_base) + '" link="' + xml_escape(rel_link) + '" version="2" language="c++">\n') chapters_f = open(chapters_fn) out_f.write(chapters_f.read() + '\n') out_f.write('<functions>') tr = Index2Devhelp() tr.transform(in_fn) out_f.write(''' </functions>