diff options
author | Karl Berry <karl@freefriends.org> | 2018-12-29 22:50:33 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2018-12-29 22:50:33 +0000 |
commit | 8bf197469266dba0e4307bfa90d6320130f4b2d8 (patch) | |
tree | 62aa18601b3bbd7b7529f914c95165e488bf8767 /Master/texmf-dist/tex/latex/changelog | |
parent | 120c0c49c7474dd161886fd979a0126398043d3d (diff) |
changelog (29dec18)
git-svn-id: svn://tug.org/texlive/trunk@49529 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/changelog')
-rw-r--r-- | Master/texmf-dist/tex/latex/changelog/changelog-doc.sty | 39 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/changelog/changelog.sty | 162 |
2 files changed, 146 insertions, 55 deletions
diff --git a/Master/texmf-dist/tex/latex/changelog/changelog-doc.sty b/Master/texmf-dist/tex/latex/changelog/changelog-doc.sty index a097f718017..c839f386342 100644 --- a/Master/texmf-dist/tex/latex/changelog/changelog-doc.sty +++ b/Master/texmf-dist/tex/latex/changelog/changelog-doc.sty @@ -1,4 +1,5 @@ \usepackage{hypdoc} +\PassOptionsToPackage{writefile}{listings} \usepackage[ loadHyperref=false, createIndexEntries=false @@ -7,10 +8,12 @@ \PageIndex \EnableCrossrefs +\usepackage{lstdoc} \usepackage{textcomp} % needed for listings \usepackage{xparse} \usepackage{xkeyval} \usepackage{changepage} +\usepackage{mdframed} \usepackage[color]{changelog} @@ -18,7 +21,6 @@ \newcommand{\email}[1]{\href{mailto:#1}{\texttt{#1}}} \newcommand{\https}[1]{\href{https://#1}{\texttt{#1}}} -\newcommand{\cl}{\ctan{changelog}} \newcommand{\todo}[1]{\begin{itemize}\item[\textbf{To-do:}] #1 \end{itemize}} \newcommand{\note}[1]{\begin{itemize}\item[\textbf{Note:}] #1 \end{itemize}} \newcommand{\ctan}[1]{\href{https://ctan.org/pkg/#1}{\package{#1}}} @@ -29,6 +31,9 @@ \newcommand{\noterepo}[1]{\note{Browse the sources, contribute, or complain at \\ \https{github.com/#1}}} +\newcommand{\cl}{\ctan{changelog}} +\newcommand{\keepachangelog}{\https{keepachangelog.com}} + % definition copied from doc package \DescribeMacro \lstnewenvironment{latexfile}[1] {\lstset{style=lstDemoStyleLaTeXCode}% @@ -50,3 +55,35 @@ } } {\end{itemize}} + +\newif\ifsidebyside@first +\newcommand{\sidebyside@maybehfill}{% + \ifsidebyside@first + \hfill + \sidebyside@firstfalse + \fi +} +\newenvironment{sidebyside}{% + + \lstnewenvironment{code}[1][]{% + \lstset{style=lstDemoStyleLaTeXCode, + basicstyle=\ttfamily\small, + frame=single, + linewidth=0.45\linewidth, + ##1}% + } + {% + \sidebyside@maybehfill + }% + \newenvironment{example}{% + \begin{mdframed}[userdefinedwidth=0.45\linewidth] + } + {% + \end{mdframed}\sidebyside@maybehfill + }% + \sidebyside@firsttrue + \medskip + \noindent + } + {% + } diff --git a/Master/texmf-dist/tex/latex/changelog/changelog.sty b/Master/texmf-dist/tex/latex/changelog/changelog.sty index 79830d82a7e..53e7299bb90 100644 --- a/Master/texmf-dist/tex/latex/changelog/changelog.sty +++ b/Master/texmf-dist/tex/latex/changelog/changelog.sty @@ -1,14 +1,10 @@ -\ProvidesPackage{changelog}[2018-11-06 0.3.0 Typesetting changelogs] +\ProvidesPackage{changelog}[2018-12-28 1.0.0 Typesetting changelogs] % Description: Provides the changelog environment for typesetting changelogs % License: GPL-3.0 % Homepage: https://github.com/9999years/latex-changelog % https://ctan.org/pkg/changelog % Maintainer: Rebecca Turner <637275@gmail.com> -\RequirePackage{xparse} -\RequirePackage{xkeyval} -\RequirePackage{kvoptions} - \newif\ifchangelog@color\changelog@colorfalse \DeclareOption{color}{\changelog@colortrue} \ProcessOptions @@ -22,75 +18,133 @@ \colorlet{ChangelogRemoved} {red} \colorlet{ChangelogFixed} {cyan} \colorlet{ChangelogSecurity} {magenta} + \colorlet{ChangelogMiscellaneous}{.} - \newcommand{\@addversionshorthands}{ + \newcommand{\changelog@yanked@pre}{\color{ChangelogSecurity}} + % parameter = item type (Added, Changed, etc.) + \newcommand{\changelog@item@preitem}[1]{\color{Changelog#1}} + \newcommand{\changelog@item@postitem}{\hspace{0pt}} +\else + \newcommand{\changelog@yanked@pre}{} + \newcommand{\changelog@item@preitem}[1]{} + \newcommand{\changelog@item@postitem}{} +\fi - \newcommand{\added }{\item{\textcolor{ChangelogAdded} {\textbf{Added}} }} - \newcommand{\changed }{\item{\textcolor{ChangelogChanged} {\textbf{Changed}} }} - \newcommand{\deprecated}{\item{\textcolor{ChangelogDeprecated}{\textbf{Deprecated}} }} - \newcommand{\removed }{\item{\textcolor{ChangelogRemoved} {\textbf{Removed}} }} - \newcommand{\fixed }{\item{\textcolor{ChangelogFixed} {\textbf{Fixed}} }} - \newcommand{\security }{\item{\textcolor{ChangelogSecurity} {\textbf{Security}} }} +\newif\ifchangelog@versionfirst +\newcommand{\changelog@item@pre}{% + \ifchangelog@versionfirst + \changelog@versionfirstfalse + \else + \end{changelogitemize} + \fi +} - } +\newcommand{\changelog@item}[1]{% + \noindent + \changelog@item@pre + {\changelog@item@preitem{#1}\textbf{#1}}\changelog@item@postitem + \begin{changelogitemize}% +} - \newcommand{\changelogyanked}{{\color{ChangelogSecurity}\fbox{\textbf{YANKED}}}} -\else - \newcommand{\@addversionshorthands}{ - \newcommand{\added} {\item Added\ } - \newcommand{\changed} {\item Changed\ } - \newcommand{\deprecated}{\item Deprecated\ } - \newcommand{\removed} {\item Removed\ } - \newcommand{\fixed} {\item Fixed\ } - \newcommand{\security} {\item Security\ } - } - \newcommand{\changelogyanked}{\fbox{\textbf{YANKED}}} -\fi +\newcommand{\changelogyanked}{{\changelog@yanked@pre\fbox{\textbf{YANKED}}}} + +\newcommand{\changelog@sectioncmds}{ + \newcommand{\added} {\changelog@item{Added}} + \newcommand{\changed} {\changelog@item{Changed}} + \newcommand{\deprecated}{\changelog@item{Deprecated}} + \newcommand{\removed} {\changelog@item{Removed}} + \newcommand{\fixed} {\changelog@item{Fixed}} + \newcommand{\security} {\changelog@item{Security}} + \newcommand{\misc} {\changelog@item{Miscellaneous}} +} \define@cmdkeys{version}{author, version, date, changes} \define@key{version}{v}{\def\cmdKV@version@version{#1}} \define@boolkey{version}{yanked}[true]{} +\define@boolkey{version}{simple}[true]{} \define@cmdkeys{changelog}{sectioncmd, title, label} \define@boolkey{changelog}{section}[true]{} \presetkeys{changelog}{sectioncmd=\section, title=Changelog, label=sec:changelog, section}{} -\NewDocumentEnvironment{changelog}{o} - {\IfValueT{#1}{\setkeys{changelog, version}{#1}}% +\newenvironment{changelogdescription} + {\begin{description}} + {\end{description}} +\newenvironment{changelogitemize} + {\begin{itemize}} + {\end{itemize}} + +\newcommand{\changelog@section@maybe}{% \ifKV@changelog@section \expandafter\cmdKV@changelog@sectioncmd{\cmdKV@changelog@title}% - \expandafter\label{\cmdKV@changelog@label} + \expandafter\label{\cmdKV@changelog@label}% \fi +} + +\newcommand{\changelog@shortversion@definedate}{% + \@ifundefined{cmdKV@version@version}{ + \@ifundefined{cmdKV@version@date}{ + \newcommand{\cmdKV@version@version}{Unreleased} + \let\cmdKV@version@date\today + }{% + \let\cmdKV@version@version\cmdKV@version@date + \let\cmdKV@version@date\undefined + }% + }{}% +} + +\newcommand{\changelog@yanked@maybe} + {\ifKV@version@yanked\ \changelogyanked\fi} + +\newcommand{\changelog@shortversion@item} + {\cmdKV@version@version + \changelog@yanked@maybe} + + +\newcommand{\changelog@shortversion@authordate}{% + \@ifundefined{cmdKV@version@author}{}{\cmdKV@version@author} + \@ifundefined{cmdKV@version@date}{% + % if both undefined, add a linebreak + \@ifundefined{cmdKV@version@author}{\hspace{0pt}}{}% + }{(\cmdKV@version@date)}% +} + +\newcommand{\changelog@version@pre}{% + \par + \changelog@versionfirsttrue + \changelog@sectioncmds + \ifKV@version@simple + \begin{changelogitemize} + \fi +} +\newcommand{\changelog@version@post}{\end{changelogitemize}} + +\NewDocumentEnvironment{changelog}{o} + {\IfValueT{#1}{\setkeys{changelog, version}{#1}}% + \changelog@section@maybe %\today % version environment; wraps a list \NewDocumentEnvironment{version}{ O{} } - {\shortversion{##1}% - \begin{itemize} - \@addversionshorthands - } - {\end{itemize}}% + {\setkeys{version}{##1}% + \@shortversion + \changelog@version@pre} + {\changelog@version@post}% - % short version; "like" a 1-bullet list - \NewDocumentCommand{\shortversion}{m}{{% - \setkeys{version}{##1}% - \@ifundefined{cmdKV@version@version}{ - \@ifundefined{cmdKV@version@date}{ - \newcommand{\cmdKV@version@version}{Unreleased} - \let\cmdKV@version@date\today - }{% - \let\cmdKV@version@version\cmdKV@version@date - \let\cmdKV@version@date\undefined - }% - }{}% - \item[\cmdKV@version@version - \ifKV@version@yanked\ \changelogyanked\fi] - \@ifundefined{cmdKV@version@author}{}{\cmdKV@version@author} - \@ifundefined{cmdKV@version@date}{% - % if both undefined, add a linebreak - \@ifundefined{cmdKV@version@author}{\hspace{0pt}}{}% - }{(\cmdKV@version@date)}% + % doesn't set keys so this can share code with the version + % environment + \NewDocumentCommand{\@shortversion}{}{{% + \changelog@shortversion@definedate + \item[\changelog@shortversion@item] + \changelog@shortversion@authordate \@ifundefined{cmdKV@version@changes}{}{ --- \cmdKV@version@changes} }} - \begin{description}} - {\end{description}} + + % short version; "like" a 1-bullet list + % extra braces keep command definitions local + \NewDocumentCommand{\shortversion}{m}{{ + \setkeys{version}{##1}% + \@shortversion + }} + \begin{changelogdescription}} + {\end{changelogdescription}} |