MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / fixInternalWikiLinks

Function fixInternalWikiLinks

site/source/get_wiki.py:141–155  ·  view source on GitHub ↗

Fixes wiki links in [[linkname]] format by changing this to a document link in current directory.

(aOldText)

Source from the content-addressed store, hash-verified

139 """Add template to specified page object (wikitools)."""
140
141 def fixInternalWikiLinks(aOldText):
142 """Fixes wiki links in [[linkname]] format by changing this to a document link in current directory."""
143 def fixwikilinks(matchobj):
144 # print 'matcobj0: %s' % matchobj.group(0)
145 # print 'matcobj1: %s' % matchobj.group(1)
146 linktext = matchobj.group(1)
147 linktext = linktext.replace(' ', '-')
148 # linktext = ':doc:`%s`' % linktext
149 # use reference for linking as allows pages to be moved around
150 linktext = ':ref:`%s`' % linktext
151 # print 'linkdoc: %s' % linktext
152 logfile.write('linkdoc: %s \n' % linktext)
153 return linktext
154 # print 'fixing wiki links'
155 return re.sub(r'\[\[(.+?)\]\]', fixwikilinks, aOldText)
156
157 def fixWikiCodeMarkupToCodeLinks(aOldText):
158 """Links "known" code objects if they are found in wiki markup."""

Callers 1

FixupConvertedRstFilesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected