diff options
author | Karl Berry <karl@freefriends.org> | 2018-10-28 21:06:14 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2018-10-28 21:06:14 +0000 |
commit | 4d1fe1c455eecb0f6d8c7039a842e7e370b6d09d (patch) | |
tree | 2f5cb5162fbe4d973c34c95d500018764ef8f6c2 /Master/texmf-dist/tex | |
parent | 8331a2748eb053e4c45a82481aa41ef22c44fb42 (diff) |
changelog (28oct18)
git-svn-id: svn://tug.org/texlive/trunk@49012 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/changelog/changelog-doc.sty | 52 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/changelog/changelog.sty | 91 |
2 files changed, 143 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/changelog/changelog-doc.sty b/Master/texmf-dist/tex/latex/changelog/changelog-doc.sty new file mode 100644 index 00000000000..a097f718017 --- /dev/null +++ b/Master/texmf-dist/tex/latex/changelog/changelog-doc.sty @@ -0,0 +1,52 @@ +\usepackage{hypdoc} +\usepackage[ + loadHyperref=false, + createIndexEntries=false +]{doctools} + +\PageIndex +\EnableCrossrefs + +\usepackage{textcomp} % needed for listings +\usepackage{xparse} +\usepackage{xkeyval} +\usepackage{changepage} + +\usepackage[color]{changelog} + +\errorcontextlines 10 + +\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}}} +\NewExpandableDocumentCommand{\Th}{O{l} m} + {\multicolumn{1}{#1}{\textbf{#2}}} +\newcommand{\ext}[1]{\texttt{.#1}} +\newcommand{\filename}[1]{\texttt{#1}} +\newcommand{\noterepo}[1]{\note{Browse the sources, contribute, or complain at \\ + \https{github.com/#1}}} + +% definition copied from doc package \DescribeMacro +\lstnewenvironment{latexfile}[1] + {\lstset{style=lstDemoStyleLaTeXCode}% + } + {} + +\NewDocumentEnvironment{ctandescription}{} + {\NewDocumentCommand{\pkg}{m}{\item[\ctan{##1}]} + \begin{description}} + {\end{description}} + +% a list of colors; use \color{colorname} +\newenvironment{colorlist} + {\begin{itemize} + \let\old@item\item + \renewcommand{\item}[1]{% + \old@item[\fcolorbox{black}{##1}{\vphantom{X}\hspace{1em}}] + \texttt{##1} + } + } + {\end{itemize}} diff --git a/Master/texmf-dist/tex/latex/changelog/changelog.sty b/Master/texmf-dist/tex/latex/changelog/changelog.sty new file mode 100644 index 00000000000..c28b37c146c --- /dev/null +++ b/Master/texmf-dist/tex/latex/changelog/changelog.sty @@ -0,0 +1,91 @@ +\ProvidesPackage{changelog}[2018-10-26 0.2.1 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> + +\newif\ifchangelog@color\changelog@colorfalse +\DeclareOption{color}{\changelog@colortrue} +\ProcessOptions + +\ifchangelog@color + \RequirePackage{xcolor} + + \colorlet{ChangelogAdded} {green} + \colorlet{ChangelogChanged} {blue} + \colorlet{ChangelogDeprecated}{orange} + \colorlet{ChangelogRemoved} {red} + \colorlet{ChangelogFixed} {cyan} + \colorlet{ChangelogSecurity} {magenta} + + \newcommand{\@addversionshorthands}{ + + \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}} }} + + } + + \newcommand{\changelogyanked}{{\color{ChangelogSecurity}\fbox{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\ } + } +\fi + +\define@cmdkeys{version}{author, version, date, changes} +\define@key{version}{v}{\def\cmdKV@version@version{#1}} +\define@boolkey{version}{yanked}[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}}% + \ifKV@changelog@section + \expandafter\cmdKV@changelog@sectioncmd{\cmdKV@changelog@title}% + \expandafter\label{\cmdKV@changelog@label} + \fi + %\today + % version environment; wraps a list + \NewDocumentEnvironment{version}{ O{} } + {\shortversion{##1}% + \begin{itemize} + \@addversionshorthands + } + {\end{itemize}}% + + % 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)}% + \@ifundefined{cmdKV@version@changes}{}{ --- \cmdKV@version@changes} + }} + \begin{description}} + {\end{description}} |