remods = re.compile(b'\s*#\s*\\\\DeclareLyXModule\s*(?:\[([^]]*?)\])?{(.*)}')
rereqs = re.compile(b'\s*#+\s*Requires: (.*)')
reexcs = re.compile(b'\s*#+\s*Excludes: (.*)')
- recaty = re.compile(b'\s*#+\s*Category: (.*)')
+ recaty = re.compile(b'\\s*#\\s*\\\\DeclareCategory{(.*)}\\s*$')
redbeg = re.compile(b'\s*#+\s*DescriptionBegin\s*$')
redend = re.compile(b'\s*#+\s*DescriptionEnd\s*$')
\begin_layout LyX-Code
#
\backslash
-DeclareLyXModule[endnotes.sty]{Endnotes}
+DeclareLyXModule[endnotes.sty]{Endnotes}
+\change_inserted -712698321 1554395911
+
+\end_layout
+
+\begin_layout LyX-Code
+
+\change_inserted -712698321 1554395924
+
+\size small
+#
+\backslash
+DeclareCategory{Foot- and Endnotes}
+\change_deleted -712698321 1554395911
+
+\size default
+
+\change_unchanged
+
\end_layout
\begin_layout Standard
-The mandatory argument, in curly brackets, is the name of the module, as
- it should appear in
+The mandatory argument
+\change_inserted -712698321 1554395956
+ of
+\family typewriter
+
+\backslash
+DeclareLyXModule
+\change_unchanged
+
+\family default
+, in curly brackets, is the name of the module, as it should appear in
\begin_inset Flex Noun
status collapsed
\end_inset
'.
+
+\change_inserted -712698321 1554396133
+ The
+\family typewriter
+
+\backslash
+DeclareCategory
+\family default
+ declaration is not strictly mandatory, but you should add it, since it
+ is helpful to find the module.
+ Please have a look at the existing module categories and if appropriate,
+ use one of those.
+\change_unchanged
+
\end_layout
\begin_layout Standard
-The module declaration should then be followed by lines like the following:
+The module
+\change_inserted -712698321 1554395988
+and category
+\change_unchanged
+declaration should then be followed by lines like the following:
\begin_inset Foot
status collapsed
#\DeclareLyXModule{Title and Preamble Hacks}
+#\DeclareCategory{Fixes and Hacks}
#DescriptionBegin
#Provides two new styles:
#1. An 'In Preamble' style that puts whatever is entered into it into the preamble.
#\DeclareLyXModule[algorithm2e.sty]{Algorithm2e}
+#\DeclareCategory{Floats}
#DescriptionBegin
# Use the algorithm2e package for algorithm floats rather
# than LyX's home-brewed algorithm floats. Use the Algorithm
#\DeclareLyXModule[braille.sty]{Braille}
+#\DeclareCategory{Accessibility}
#DescriptionBegin
#Defines an environment to typeset Braille.
#For more details see Braille.lyx in examples.
-#\DeclareLyXModule[endnotes.sty]{Endnote}
+#\DeclareLyXModule[endnotes.sty]{Endnotes}
+#\DeclareCategory{Foot- and Endnotes}
#DescriptionBegin
#Adds an endnote inset, in addition to footnotes. You will need to add
#\theendnotes in TeX-code where you want the endnotes to appear.
#\DeclareLyXModule[enumitem.sty]{Customisable Lists (enumitem)}
+#\DeclareCategory{List Enhancements}
#DescriptionBegin
# Controls the layout of enumerate, itemize, description, and list/labeling.
# See section Customized Lists of the User's Guide for a detailed description.
#\DeclareLyXModule{Number Equations by Section}
+#\DeclareCategory{Maths}
#DescriptionBegin
#Resets the equation number at section start and prepends
#the section number to the equation number, as in '(2.1)'.
#\DeclareLyXModule{Fix cm}
+#\DeclareCategory{Fixes and Hacks}
#DescriptionBegin
#Fix-cm improves the appearance of Computer Modern fonts and makes them
#available with arbitrary sizes. For details see the documentation
-#\DeclareLyXModule{Fix LaTeX}
+#\DeclareLyXModule{Fix LaTeX (Obsolete)}
+#\DeclareCategory{Fixes and Hacks}
#DescriptionBegin
#Loads the LaTeX package fixltx2e which contains some bug fixes for LaTeX.
#Those fixes were not part of older LaTeX kernels because of backward compatibility.
#\DeclareLyXModule[fixme.sty]{FiXme}
+#\DeclareCategory{Annotations}
#DescriptionBegin
#Provides 'FiXme' (marginal) annotations for document revision purposes.
#A list of annotations can be produced by using the 'List of FIXMEs' paragraph style.
#\DeclareLyXModule[endnotes.sty]{Foot to End}
+#\DeclareCategory{Foot- and Endnotes}
#DescriptionBegin
#Sets all footnotes as endnotes. You will need to add \theendnotes
#in TeX-code where you want the endnotes to appear.
#\DeclareLyXModule{GraphicBoxes}
+#\DeclareCategory{Boxes}
#DescriptionBegin
#Boxes to scale and rotate its contents
#DescriptionEnd
#\DeclareLyXModule{Hanging}
+#\DeclareCategory{Paragraph Styles}
#DescriptionBegin
#Adds an environment for hanging paragraphs.
#Hanging paragraph is a paragraph in which the first line is set to the left margin, but all subsequent lines are indented.
#\DeclareLyXModule{Initials}
+#\DeclareCategory{Paragraph Styles}
#DescriptionBegin
#Define a style for paragraphs with an initial.
#See the EmbeddedObjects manual for a detailed description.
#\DeclareLyXModule[knitr->latex]{Rnw (knitr)}
+#\DeclareCategory{Literate Programming}
#DescriptionBegin
#Uses the knitr package in R for dynamic report generation. This R package has to be installed for this module to work: install.packages('knitr'). Note it depends on R >= 2.14.1.
#For more info see http://yihui.name/knitr
#DescriptionEnd
-#Category: literate
#Excludes: lilypond | sweave
Format 72
#\DeclareLyXModule{Logical Markup}
+#\DeclareCategory{Text Markup}
#DescriptionBegin
#Defines some character styles for logical markup: noun, emph, strong, and code.
#DescriptionEnd
-#Category: charstyles
# Author : Martin vermeer <martin.vermeer@hut.fi>
#\DeclareLyXModule{Minimalistic}
+#\DeclareCategory{Fixes and Hacks}
#DescriptionBegin
# Redefines several insets (Index, Branch, URL) as being Minimalistic.
#DescriptionEnd
#\DeclareLyXModule[literate->latex,noweb.sty]{Noweb}
+#\DeclareCategory{Literate Programming}
#DescriptionBegin
#Allows to use Noweb as a literate programming tool.
#DescriptionEnd
-#Category: literate
Format 72
Input litinsets.inc
#\DeclareLyXModule[paralist.sty]{Paragraph Lists (paralist)}
+#\DeclareCategory{List Enhancements}
#DescriptionBegin
# The package paralist provides some new list environments.
# Itemized and enumerated lists can be typeset within paragraphs, as
#\DeclareLyXModule[datetime.sty,fmtcount.sty]{PDF Comments}
+#\DeclareCategory{Annotations}
#DescriptionBegin
#Provides various kinds of annotations for the PDF output. The module uses
#the pdfcomment package. Please consult the LyX example file PDF-comment.lyx
#\DeclareLyXModule{PDF Form}
+#\DeclareCategory{Annotations}
#DescriptionBegin
#Provides fields and buttons for PDF forms. The module uses
#the LaTeX package hyperref. Please consult the LyX example file PDF-form.lyx
#\DeclareLyXModule[sectionbox.sty]{Section Boxes}
+#\DeclareCategory{Boxes}
#DescriptionBegin
#Defines Boxes with section header. Mainly intended for
#the SciPoster class.
#\DeclareLyXModule[shapepar.sty]{Custom Paragraph Shapes}
+#\DeclareCategory{Paragraph Styles}
#DescriptionBegin
#Provides several paragraph shapes as well as commands to define custom
#shapes. For a description see LyX's Additional
#\DeclareLyXModule[soul.sty]{Hyphenatable Text Markup (Soul)}
+#\DeclareCategory{Text Markup}
#DescriptionBegin
#Defines text styles to highlight, space-out, strike-through,
#underline and capitalize/small-cap text by means of the soul package.
#\DeclareLyXModule{Subequations}
+#\DeclareCategory{Maths}
#DescriptionBegin
#Provide a straightforward way to segregate subequations in LyX. See the subequations.lyx example file.
#DescriptionEnd
#\DeclareLyXModule[sweave->latex,fancyvrb.sty]{Sweave}
+#\DeclareCategory{Literate Programming}
#DescriptionBegin
#Allows to use the statistical language S/R as a literate programming tool via the Sweave() function.
#For more info see the LyX example file sweave.lyx.
#DescriptionEnd
-#Category: literate
#Excludes: lilypond
Format 72
#\DeclareLyXModule[tcolorbox.sty,environ.sty,etoolbox.sty,pgf.sty]{Fancy Colored Boxes}
+#\DeclareCategory{Boxes}
#DescriptionBegin
#Adds custom insets that support colored boxes via the tcolorbox package.
#See the tcolorbox documentation for details.
#\DeclareLyXModule{Theorems (AMS, Numbered by Type within Chapters)}
+#\DeclareCategory{Theorems}
#DescriptionBegin
#Defines theorem environments and the proof environment using the extended
#AMS machinery. Both numbered and unnumbered types are provided. Contrary to the
#\DeclareLyXModule{Theorems (AMS-Extended, Numbered by Type)}
+#\DeclareCategory{Theorems}
#DescriptionBegin
#Defines some additional theorem environments for use with the
#AMS theorems packages. Includes Criterion, Algorithm, Axiom,
#\DeclareLyXModule{Theorems (AMS-Extended, Numbered by Type within Chapters)}
+#\DeclareCategory{Theorems}
#DescriptionBegin
#Defines some additional theorem environments for use with the
#AMS theorems packages. Includes Criterion, Algorithm, Axiom,
#\DeclareLyXModule{Theorems (AMS-Extended)}
+#\DeclareCategory{Theorems}
#DescriptionBegin
#Defines some additional theorem environments for use with the
#AMS theorems packages. Includes Criterion, Algorithm, Axiom,
#forms.
#DescriptionEnd
#Requires: theorems-ams
-#Category: theorems
# Original Author : David L. Johnson <dlj0@lehigh.edu>
# Probably broken by Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
#\DeclareLyXModule{Theorems (AMS)}
+#\DeclareCategory{Theorems}
#DescriptionBegin
#Defines theorem environments and the proof environment using the extended
#AMS machinery. Both numbered and unnumbered types are provided. By default,
#changed by loading one of the 'Theorems (Numbered by ...)' modules.
#DescriptionEnd
#Excludes: theorems-std | theorems-starred
-#Category: theorems
# Original Author : David L. Johnson <dlj0@lehigh.edu>
# Probably broken by Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
#\DeclareLyXModule{Theorems (Numbered by Type)}
+#\DeclareCategory{Theorems}
#DescriptionBegin
#Defines some theorem environments for use with non-AMS classes. Contrary to the
#plain Theorem module, the different theorem types provided here each have a separate
#\DeclareLyXModule{Theorems (Numbered by Type within Chapters)}
+#\DeclareCategory{Theorems}
#DescriptionBegin
#Defines some theorem environments for use with non-AMS classes. Contrary to the
#plain Theorem module, the different theorem types provided here each have a separate
#\DeclareLyXModule{Theorems (Numbered by Chapter)}
+#\DeclareCategory{Theorems}
#DescriptionBegin
#Numbers theorems and the like by chapter (i.e., the counter is reset at
#each chapter start). Use this module only with document classes that provide a chapter
#DescriptionEnd
#Requires: theorems-std | theorems-ams
#Excludes: theorems-sec
-#Category: theorems
# Author: Richard Heck <rgheck@comcast.net>
#% Do not delete the line below; configure depends on this
#\DeclareLyXModule{Named Theorems}
+#\DeclareCategory{Theorems}
#DescriptionBegin
# Facilitates the use of named theorems. The name of the theorem
# goes into the 'Additional Theorem Text' argument.
#\DeclareLyXModule{Theorems (Numbered by Section)}
+#\DeclareCategory{Theorems}
#DescriptionBegin
#Numbers theorems and the like by section (i.e., the counter is reset at
#each section start).
#DescriptionEnd
#Requires: theorems-std | theorems-ams
#Excludes: theorems-chap
-#Category: theorems
# Author: Richard Heck <rgheck@comcast.net>
#\DeclareLyXModule{Theorems (Unnumbered)}
+#\DeclareCategory{Theorems}
#DescriptionBegin
#Defines only unnumbered theorem environments, and the proof environment, using
#the extended AMS machinery.
#DescriptionEnd
#Excludes: theorems-std | theorems-ams
-#Category: theorems
# Author: Richard Heck <rgheck@comcast.net>
#\DeclareLyXModule{Theorems}
+#\DeclareCategory{Theorems}
#DescriptionBegin
#Defines some theorem environments for use with non-AMS classes. By default,
#the theorems are numbered consecutively throughout the document. This can be
#changed by loading one of the 'Theorems (Numbered by ...)' modules.
#DescriptionEnd
#Excludes: theorems-ams | theorems-starred
-#Category: theorems
# Author: Richard Heck <rgheck@comcast.net>
#\DeclareLyXModule[todonotes.sty]{TODO Notes}
+#\DeclareCategory{Annotations}
#DescriptionBegin
#Provides custom insets to insert TODO items in your document
#(using the todonotes package). In order to generate a 'List of TODOs',
#\DeclareLyXModule{Variable-width Minipages}
+#\DeclareCategory{Boxes}
#DescriptionBegin
# Adds a 'Minipage (Var. Width)' inset using the varwidth LaTeX package.
# The varwidth package provides a variable-width minipage, whose resulting
* The requires and excludes are given in comments within the module file,
* which must begin roughly so:
* #\DeclareLyXModule{Theorems (By Section)}
+ * #\DeclateCategory{Theorems}
* #DescriptionBegin
* #Numbers theorems and the like by section.
* #DescriptionEnd
* #Requires: theorems-std | theorems-ams
* #Excludes: theorems-chap
- * #Category: theorems
* The description is used in the gui to give information to the user. The
* Requires, Excludes, and Category lines are read by the configuration script
* and written to a file lyxmodules.lst in the user configuration directory.
if (!cat.empty()) {
if (!desc.empty())
desc += "\n";
- desc += bformat(_("Category: %1$s."), cat);
+ desc += bformat(_("Category: %1$s."),
+ translateIfPossible(cat));
}
vector<string> pkglist = getPackageList(modName);