mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 18:08:10 +00:00
generate TOC files on the fly and fix broken documents (bug 2027)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10491 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
82765345ac
commit
58380ba97a
@ -1,3 +1,13 @@
|
||||
2005-09-28 Georg Baum <Georg.Baum@post.rwth-aachen.de>
|
||||
|
||||
* de_UserGuide.lyx, it_UserGuide.lyx: repair invalid syntax, maybe
|
||||
caused by a lyx2lyx bug
|
||||
* Makefile.am: generate TOC files automatically
|
||||
* Makefile.am: rework TOC generation rules to work with srcdir != builddir
|
||||
* depend.py: make it work with srcdir != builddir
|
||||
* depend.py: adjust generated TOCs rule to Makefile.am changes
|
||||
* doc_toc.py: make it work with srcdir != builddir
|
||||
|
||||
2005-09-28 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
|
||||
|
||||
* UserGuide.lyx:
|
||||
|
@ -1,31 +1,26 @@
|
||||
include $(top_srcdir)/config/common.am
|
||||
|
||||
DISTCLEANFILES += LyXConfig.lyx LaTeXConfig.lyx Makefile.depend
|
||||
DISTCLEANFILES += LyXConfig.lyx LaTeXConfig.lyx $(TOCs)
|
||||
|
||||
EXTRA_DIST = depend.py doc_toc.py LyXConfig.lyx.in README.Documentation $(docfiles)
|
||||
EXTRA_DIST = depend.py doc_toc.py LyXConfig.lyx.in README.Documentation $(DEPENDFILE) $(docfiles)
|
||||
|
||||
docfiles = \
|
||||
cs_TOC.lyx \
|
||||
docfiles = $(TOCs) \
|
||||
cs_Tutorial.lyx \
|
||||
Customization.lyx \
|
||||
da_Intro.lyx \
|
||||
da_TOC.lyx \
|
||||
de_Customization.lyx \
|
||||
de_Extended.lyx \
|
||||
de_FAQ.lyx \
|
||||
de_Intro.lyx \
|
||||
de_TOC.lyx \
|
||||
de_Tutorial.lyx \
|
||||
de_UserGuide.lyx \
|
||||
DocStyle.lyx \
|
||||
es_Intro.lyx \
|
||||
es_TOC.lyx \
|
||||
es_Tutorial.lyx \
|
||||
eu_Customization.lyx \
|
||||
eu_Extended.lyx \
|
||||
eu_FAQ.lyx \
|
||||
eu_Intro.lyx \
|
||||
eu_TOC.lyx \
|
||||
eu_Tutorial.lyx \
|
||||
eu_UserGuide.lyx \
|
||||
Extended.lyx \
|
||||
@ -34,50 +29,36 @@ docfiles = \
|
||||
fr_Extended.lyx \
|
||||
fr_FAQ.lyx \
|
||||
fr_Intro.lyx \
|
||||
fr_TOC.lyx \
|
||||
fr_Tutorial.lyx \
|
||||
fr_UserGuide.lyx \
|
||||
he_Intro.lyx \
|
||||
he_TOC.lyx \
|
||||
he_Tutorial.lyx \
|
||||
hu_Intro.lyx \
|
||||
hu_TOC.lyx \
|
||||
Intro.lyx \
|
||||
it_Customization.lyx \
|
||||
it_Intro.lyx \
|
||||
it_TOC.lyx \
|
||||
it_Tutorial.lyx \
|
||||
it_UserGuide.lyx \
|
||||
LaTeXConfig.lyx.in \
|
||||
nl_Intro.lyx \
|
||||
nl_TOC.lyx \
|
||||
nl_Tutorial.lyx \
|
||||
no_Intro.lyx \
|
||||
no_TOC.lyx \
|
||||
pl_Extended.lyx \
|
||||
pl_Intro.lyx \
|
||||
pl_TOC.lyx \
|
||||
pl_Tutorial.lyx \
|
||||
pt_Intro.lyx \
|
||||
pt_TOC.lyx \
|
||||
pt_Tutorial.lyx \
|
||||
Reference.lyx \
|
||||
ro_Intro.lyx \
|
||||
ro_TOC.lyx \
|
||||
ru_FAQ.lyx \
|
||||
ru_Intro.lyx \
|
||||
ru_TOC.lyx \
|
||||
ru_Tutorial.lyx \
|
||||
sk_TOC.lyx \
|
||||
sk_Tutorial.lyx \
|
||||
sk_UserGuide.lyx \
|
||||
sl_Intro.lyx \
|
||||
sl_TOC.lyx \
|
||||
sl_Tutorial.lyx \
|
||||
sv_Intro.lyx \
|
||||
sv_TOC.lyx \
|
||||
sv_Tutorial.lyx \
|
||||
TOC.lyx \
|
||||
Tutorial.lyx \
|
||||
UserGuide.lyx \
|
||||
escher-lsd.eps \
|
||||
@ -89,16 +70,18 @@ doc_DATA = \
|
||||
$(docfiles) \
|
||||
LaTeXConfig.lyx
|
||||
|
||||
# TODO can we instead just #include the DEPENDFILE in this Makefile?
|
||||
# problem with this is that the DEPENDFILE that's included won't be the updated
|
||||
# one. JMarc should know how to handle this.
|
||||
|
||||
DEPENDFILE = Makefile.depend
|
||||
include $(DEPENDFILE)
|
||||
|
||||
TOCs : depend
|
||||
make -f $(DEPENDFILE) TOCs
|
||||
TOCs : $(DEPENDFILE) $(TOCs)
|
||||
@echo Made TOCs succesfully.
|
||||
|
||||
depend:
|
||||
python depend.py > $(DEPENDFILE)
|
||||
# Force regeneration of $(DEPENDFILE) when Makefile.am changes because
|
||||
# new doc files might have been added
|
||||
$(DEPENDFILE): Makefile.am
|
||||
python $(srcdir)/depend.py > $(DEPENDFILE)
|
||||
|
||||
.PHONY: depend
|
||||
# Force generation of the TOC files for 'make dist'
|
||||
distdir: TOCs
|
||||
|
||||
.PHONY: TOCs
|
||||
|
@ -10653,8 +10653,6 @@ Umschalt+Alt\InsetSpace ~
|
||||
\end_layout
|
||||
|
||||
\begin_deeper
|
||||
\end_layout
|
||||
|
||||
\begin_deeper
|
||||
\begin_layout Standard
|
||||
|
||||
|
@ -31,12 +31,14 @@ from glob import glob
|
||||
possible_documents = ("Intro", "FAQ", "Tutorial", "UserGuide", "Extended", "Customization")
|
||||
lang_pattern = re.compile('^([a-z]{2})_')
|
||||
|
||||
def documents(prefix):
|
||||
def documents(srcdir, prefix):
|
||||
result = []
|
||||
for file in possible_documents:
|
||||
fname = prefix + file + '.lyx'
|
||||
fname = srcdir + '/' + prefix + file + '.lyx'
|
||||
if os.access(fname, os.F_OK):
|
||||
result.append(fname)
|
||||
else:
|
||||
result.append(srcdir + '/' + file + '.lyx')
|
||||
return result
|
||||
|
||||
|
||||
@ -50,8 +52,9 @@ def main(argv):
|
||||
|
||||
# What are the languages available? And its documents?
|
||||
languages = {}
|
||||
for file in glob('*'):
|
||||
lang = lang_pattern.match(file)
|
||||
srcdir = os.path.dirname(argv[0])
|
||||
for file in glob(srcdir + '/*'):
|
||||
lang = lang_pattern.match(os.path.basename(file))
|
||||
if lang:
|
||||
if lang.group(1) not in languages:
|
||||
languages[lang.group(1)] = [file]
|
||||
@ -63,8 +66,8 @@ def main(argv):
|
||||
langs.sort()
|
||||
|
||||
# The default language is english and doesn't need any prefix
|
||||
print 'TOC.lyx:', '.lyx '.join(possible_documents) + '.lyx'
|
||||
print '\tpython doc_toc.py'
|
||||
print 'TOC.lyx:', ('.lyx ' + srcdir + '/').join(possible_documents) + '.lyx'
|
||||
print '\tpython %s/doc_toc.py' % srcdir
|
||||
print
|
||||
tocs = ['TOC.lyx']
|
||||
|
||||
@ -73,15 +76,17 @@ def main(argv):
|
||||
toc_name = lang + '_TOC.lyx'
|
||||
tocs.append(toc_name)
|
||||
|
||||
if toc_name in languages[lang]:
|
||||
languages[lang].remove(toc_name)
|
||||
if srcdir + '/' + toc_name in languages[lang]:
|
||||
languages[lang].remove(srcdir + '/' + toc_name)
|
||||
|
||||
print toc_name + ':', ' '.join(languages[lang])
|
||||
print '\tpython doc_toc.py %s' % lang
|
||||
print '\tpython %s/doc_toc.py %s' % (srcdir, lang)
|
||||
print
|
||||
|
||||
# Write meta-rule to call all the other rules
|
||||
print 'TOCs:', ' '.join(tocs)
|
||||
print '\t@echo Made TOCs succesfully.'
|
||||
print 'TOCs =', ' '.join(tocs)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
@ -25,7 +25,7 @@
|
||||
import sys
|
||||
import os
|
||||
|
||||
sys.path.insert(0,"../lyx2lyx")
|
||||
sys.path.insert(0, os.path.dirname(sys.argv[0]) + "/../lyx2lyx")
|
||||
import parser_tools
|
||||
import LyX
|
||||
import depend
|
||||
@ -105,9 +105,11 @@ def main(argv):
|
||||
if lang not in info:
|
||||
lang = 'en'
|
||||
|
||||
srcdir = os.path.dirname(sys.argv[0])
|
||||
|
||||
# Determine existing translated documents for that language.
|
||||
toc_general = []
|
||||
for file in depend.documents(pref):
|
||||
for file in depend.documents(srcdir, pref):
|
||||
file = LyX.File(input= file)
|
||||
file.convert()
|
||||
toc_general.extend(file.get_toc())
|
||||
|
@ -23257,8 +23257,6 @@ paragrafo
|
||||
|
||||
|
||||
\begin_deeper
|
||||
\end_layout
|
||||
|
||||
\begin_deeper
|
||||
\begin_layout Standard
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user