10 print(
'Patching external links in doxygen docu')
13 htmlFiles = [os.path.join(mypath, f)
for f
in os.listdir(mypath)
if (os.path.isfile(os.path.join(mypath, f))
and f.endswith(
'.html'))]
16 data = open(f,
'r', encoding=
'utf-8').read()
18 data = data.replace(
'href="http',
'target="_blank" href="http')
20 open(f,
'w', encoding=
'utf-8').write(data)
23 print(
'Removing empty markdown source files')
24 [os.remove(os.path.join(mypath, f))
for f
in os.listdir(mypath)
if (os.path.isfile(os.path.join(mypath, f))
and f.endswith(
'8md.html'))]
26 print(
'Creating sitemap.xml')
28 htmlFiles = [f
for f
in os.listdir(mypath)
if (os.path.isfile(os.path.join(mypath, f))
and f.endswith(
'.html')
and not f.endswith(
'source.html'))]
30 xmlData =
'<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">\n'
32 now = datetime.datetime.now()
33 time = now.strftime(
"%Y-%m-%dT%H:%M:%S+00:00")
35 xmlData +=
' <url><loc>https://docs.cppinsights.io/%s</loc><lastmod>%s</lastmod><priority>1.00</priority></url>\n' %(
'', time)
38 xmlData +=
' <url><loc>https://docs.cppinsights.io/%s</loc><lastmod>%s</lastmod><priority>0.80</priority></url>\n' %(f, time)
40 xmlData +=
'</urlset>\n'
42 open(os.path.join(mypath,
'sitemap.xml'),
'w', encoding=
'utf-8').write(xmlData)