From f034a62ec2defca17f77d57beabe487343e5044c Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 14 Mar 2021 20:05:55 +0530 Subject: [PATCH] Fix user manual rendering for non-existent languages --- setup/publish.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/setup/publish.py b/setup/publish.py index 60888407b5..5414c98d96 100644 --- a/setup/publish.py +++ b/setup/publish.py @@ -177,6 +177,8 @@ class Manual(Command): if not parallel_build(jobs[1:], self.info): raise SystemExit(1) cwd = os.getcwd() + with open('resources/localization/website-languages.txt') as wl: + languages = frozenset(filter(None, (x.strip() for x in wl.read().split()))) try: os.chdir(self.j(tdir, 'en', 'html')) for x in os.listdir(tdir): @@ -184,7 +186,10 @@ class Manual(Command): shutil.copytree(self.j(tdir, x, 'html'), x) self.replace_with_symlinks(x) else: - os.symlink('..', 'en') + os.symlink('.', 'en') + for x in languages: + if x and not os.path.exists(x): + os.symlink('.', x) self.info( 'Built manual for %d languages in %s minutes' % (len(jobs), int((time.time() - st) / 60.))