From 4722e955a88a45c2af69df5b093ab0ab0c90a2e4 Mon Sep 17 00:00:00 2001 From: Enrico Forestieri Date: Sat, 10 Jun 2017 00:12:22 +0200 Subject: [PATCH] Remove the minted external template That functionality is now provided by the new support for minted. Also change the example file and accordingly rename it. --- lib/Makefile.am | 2 +- .../{minted.lyx => minted-filelisting.lyx} | 14 ++-- lib/xtemplates/minted.xtemplate | 79 ------------------- 3 files changed, 7 insertions(+), 88 deletions(-) rename lib/examples/{minted.lyx => minted-filelisting.lyx} (92%) delete mode 100644 lib/xtemplates/minted.xtemplate diff --git a/lib/Makefile.am b/lib/Makefile.am index be520f9b86..a1d79cc06b 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -341,7 +341,7 @@ dist_examples_DATA = \ examples/listerrors.lyx \ examples/localization_test.lyx \ examples/longsheet.gnumeric \ - examples/minted.lyx \ + examples/minted-filelisting.lyx \ examples/minted-listings.lyx \ examples/modernCV.lyx \ examples/MultilingualCaptions.lyx \ diff --git a/lib/examples/minted.lyx b/lib/examples/minted-filelisting.lyx similarity index 92% rename from lib/examples/minted.lyx rename to lib/examples/minted-filelisting.lyx index dab838fc15..a5e6dc19a0 100644 --- a/lib/examples/minted.lyx +++ b/lib/examples/minted-filelisting.lyx @@ -1,12 +1,11 @@ #LyX 2.3 created this file. For more info see http://www.lyx.org/ -\lyxformat 543 +\lyxformat 544 \begin_document \begin_header \save_transient_properties true \origin /systemlyxdir/examples/ \textclass article \begin_preamble -\usemintedstyle{bw} \usepackage{xcolor} \definecolor{lgray}{rgb}{0.95, 0.95, 0.95} \usepackage{eso-pic} @@ -77,6 +76,7 @@ \suppress_date false \justification true \use_refstyle 1 +\use_minted 1 \index Index \shortcut idx \color #008000 @@ -187,12 +187,10 @@ This is the title of the listing appearing in the headers. \end_layout \begin_layout Standard -\begin_inset External - template MintedSource - filename ../scripts/lyxpak.py - display false - extra LaTeX "fontsize=\tiny,baselinestretch=1.05,frame=leftline,framesep=10pt,breaklines,breakanywhere,language=python" - extra PDFLaTeX "fontsize=\tiny,baselinestretch=1.05,frame=leftline,framesep=10pt,breaklines,breakanywhere,language=python" +\begin_inset CommandInset include +LatexCommand inputminted +filename "../scripts/lyxpak.py" +lstparams "language=python,style=bw,fontsize={\\tiny},baselinestretch={1.05},frame=leftline,framesep=10pt,breaklines,breakanywhere" \end_inset diff --git a/lib/xtemplates/minted.xtemplate b/lib/xtemplates/minted.xtemplate deleted file mode 100644 index 3216c079b4..0000000000 --- a/lib/xtemplates/minted.xtemplate +++ /dev/null @@ -1,79 +0,0 @@ -# -# Minted External Template -# -# This file is part of LyX, the document processor. -# Licence details can be found in the file COPYING. -# -# author Enrico Forestieri -# -# Full author contact details are available in file CREDITS. -# -# External templates expect to deal with commands of the form -# \command[options]{parameter} -# while the \inputminted command has the form -# \inputminted[options]{language}{filename} -# -# In order to use the external templates machinery, the options of the -# minted package are extended to be able to construct a proper \inputminted -# command. This template defines an additional 'language' option for minted, -# which is then extracted from the options and passed as the second non-optional -# parameter of \inputminted. This template works for minted version 2.1 or -# higher. As it relies on the internals of minted, an update might break it. - -PreambleDef minted - \usepackage{minted} - \@namedef{minted@opt@cmd@lang}{latex} - \define@key{minted@opt@cmd}{language}{\@namedef{minted@opt@cmd@lang}{#1} - \minted@configlang{#1}} - \DeclareRobustCommand\inputsource{\@ifnextchar[\@inputsrc{\@inputsrc[]}} - \def\@inputsrc[#1]#2{\inputminted[#1]{\minted@opt@cmd@lang}{#2}} -PreambleDefEnd - -Template MintedSource - GuiName "Minted Source Code" - HelpText - Format source code using the 'minted' package. - This template works with minted version 2.1 or higher. - The source language is specified by the 'language' option, - which must be inserted into the 'Option' field in the - 'LaTeX and LyX options' tab. - - Example options: - * linenos,fontsize=\footnotesize,language=fortran - * bgcolor=yellow,baselinestretch=1.2,language=c - * frame=lines,framesep=2\fboxsep,language=python - - If 'language=xxx' is not given, 'language=latex' is assumed by default. - Make sure to use the '-shell-escape' option for the latex backend. - Read the documentation of the minted package - for further options and details. - HelpTextEnd - InputFormat text - FileFilter "*" - AutomaticProduction true - Preview InstantPreview - Transform Extra - Format LaTeX - Preamble minted - TransformOption Extra ExtraOption - Option Arg "[$$Extra]" - Product "\\inputsource$$Arg{$$AbsPath$$Basename$$Extension}" - UpdateFormat text - UpdateResult "$$AbsPath$$Basename$$Extension" - ReferencedFile text "$$AbsPath$$Basename$$Extension" - FormatEnd - Format PDFLaTeX - Preamble minted - TransformOption Extra ExtraOption - Option Arg "[$$Extra]" - Product "\\inputsource$$Arg{$$AbsPath$$Basename$$Extension}" - UpdateFormat text - UpdateResult "$$AbsPath$$Basename$$Extension" - ReferencedFile text "$$AbsPath$$Basename$$Extension" - FormatEnd - Format Ascii - Product "$$Contents(\"$$AbsPath$$Basename$$Extension\")" - UpdateFormat text - UpdateResult "$$AbsPath$$Basename$$Extension" - FormatEnd -TemplateEnd