remove support for generating PDF files from Mallard pages (#68601)

This commit is contained in:
Frédéric Péters 2022-09-01 08:41:27 +02:00
parent 16c85eee7e
commit 1a4a9933d1
1 changed files with 0 additions and 36 deletions

View File

@ -5,7 +5,6 @@ import os
import shutil
import subprocess
import tarfile
import tempfile
import re
import urllib2
import urlparse
@ -106,41 +105,6 @@ def publish_mallard(module, branch, directory):
json.dump(pages, open(os.path.join(output_dir, 'pages.json'), 'w'), indent=2)
if not os.path.exists('../mal2latex'):
return
temp_dir = tempfile.mkdtemp()
cache_file = os.path.join(temp_dir, '%s.cache' % module_name)
cmd = ['jhbuild', '-f', jhbuildrc, 'run', 'yelp-build', 'cache', '-o', cache_file]
cmd.extend(page_files)
subprocess.call(cmd, **kws)
if os.path.exists(cache_file) and False:
latex_file = os.path.join(temp_dir, 'doc-%s.tex' % module_name)
cmd = ['xsltproc', '-o', latex_file, '../mal2latex/mal2latex.xsl',
cache_file]
subprocess.call(cmd, **kws)
for subdir in ('media', 'figures'):
os.symlink(os.path.join(checkout_dir, 'help', 'fr', subdir),
os.path.join(temp_dir, subdir))
for admon_file in os.listdir('../mal2latex/admon'):
if not admon_file.endswith('.pdf'):
continue
os.symlink(os.path.join(os.path.abspath('../mal2latex'), 'admon', admon_file),
os.path.join(temp_dir, admon_file))
for i in range(3):
cmd = ['pdflatex', '--interaction=nonstopmode',
'-output-directory', temp_dir, latex_file]
subprocess.call(cmd, cwd=temp_dir, **kws)
if not os.path.exists(os.path.join(temp_dir, 'doc-%s.pdf' % module_name)):
break
else:
with open(os.path.join(output_dir, 'doc-%s.pdf' % module_name), 'wb') as fd:
fd.write(open(os.path.join(temp_dir, 'doc-%s.pdf' % module_name), 'rb').read())
shutil.rmtree(temp_dir)
def publish_tarball(module):
output_dir = os.path.join(web_directory, module.get('name'), 'stable')