diff options
author | Karl Berry <karl@freefriends.org> | 2020-12-04 22:24:18 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2020-12-04 22:24:18 +0000 |
commit | 3e5689b6ed2be14caa070207912451fadd1d3e99 (patch) | |
tree | 1f5522dbf2aacc0f7365c9724ced427e8de62165 /Master/texmf-dist/tex/latex/rest-api | |
parent | 510e24ff93e1d12670e0eadcf5b46aa257c7d507 (diff) |
rest-api (4dec20)
git-svn-id: svn://tug.org/texlive/trunk@57068 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/rest-api')
-rw-r--r-- | Master/texmf-dist/tex/latex/rest-api/rest-api.sty | 138 |
1 files changed, 124 insertions, 14 deletions
diff --git a/Master/texmf-dist/tex/latex/rest-api/rest-api.sty b/Master/texmf-dist/tex/latex/rest-api/rest-api.sty index cb8d2ed2f9f..ff4ea537229 100644 --- a/Master/texmf-dist/tex/latex/rest-api/rest-api.sty +++ b/Master/texmf-dist/tex/latex/rest-api/rest-api.sty @@ -22,7 +22,8 @@ %% \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesPackage{rest-api} - [2020/06/23 v1.3 rest-api package] + [2020/12/04 v1.4 rest-api package] + @@ -220,6 +221,95 @@ literate= {[}{{{\color{delimDelete}{[}}}}{1} {]}{{{\color{delimDelete}{]}}}}{1}, } +\lstdefinelanguage{xmlGet}{ +basicstyle=\small\ttfamily\color{black}, +numberstyle=\small\color{numbGet}, +keywordstyle=\color{black}, +commentstyle=\color{black}, +stringstyle=\color{black}, +frame=L, +framesep=8pt, +framerule=2pt, +xleftmargin=50pt, +xrightmargin=0pt, +rulesep=0pt, +backgroundcolor=\color{white}, +numbersep=8pt, +tabsize=4, +showstringspaces=false, +breaklines=false, +morestring=[b]", +morestring=[s]{>}{<}, +morecomment=[s]{<?}{?>}, +identifierstyle=\color{numbGet}, +} +\lstdefinelanguage{xmlPost}{ +basicstyle=\small\ttfamily\color{black}, +numberstyle=\small\color{numbPost}, +keywordstyle=\color{black}, +commentstyle=\color{black}, +stringstyle=\color{black}, +frame=L, +framesep=8pt, +framerule=2pt, +xleftmargin=50pt, +xrightmargin=0pt, +rulesep=0pt, +backgroundcolor=\color{white}, +numbersep=8pt, +tabsize=4, +showstringspaces=false, +breaklines=false, +morestring=[b]", +morestring=[s]{>}{<}, +morecomment=[s]{<?}{?>}, +identifierstyle=\color{numbPost}, +} +\lstdefinelanguage{xmlPut}{ +basicstyle=\small\ttfamily\color{black}, +numberstyle=\small\color{numbPut}, +keywordstyle=\color{black}, +commentstyle=\color{black}, +stringstyle=\color{black}, +frame=L, +framesep=8pt, +framerule=2pt, +xleftmargin=50pt, +xrightmargin=0pt, +rulesep=0pt, +backgroundcolor=\color{white}, +numbersep=8pt, +tabsize=4, +showstringspaces=false, +breaklines=false, +morestring=[b]", +morestring=[s]{>}{<}, +morecomment=[s]{<?}{?>}, +stringstyle=\color{black}, +identifierstyle=\color{numbPut}, +} +\lstdefinelanguage{xmlDelete}{ +basicstyle=\small\ttfamily\color{black}, +numberstyle=\small\color{numbDelete}, +keywordstyle=\color{black}, +commentstyle=\color{black}, +stringstyle=\color{black}, +frame=L, +framesep=8pt, +framerule=2pt, +xleftmargin=50pt, +xrightmargin=0pt, +rulesep=0pt, +backgroundcolor=\color{white}, +numbersep=8pt, +tabsize=4, +showstringspaces=false, +breaklines=false, +morestring=[b]", +morestring=[s]{>}{<}, +morecomment=[s]{<?}{?>}, +identifierstyle=\color{numbDelete}, +} \mdfdefinestyle{mystyle}{ linecolor=\methodBorderColor, backgroundcolor=\methodLightColor, @@ -234,6 +324,7 @@ leftmargin=0pt, rightmargin=0pt, nobreak=true } +\newcommand{\bodyFormat}{json} \newcommand{\routeBreakValue}{true} \newcommand{\noBreakRoute} { @@ -250,19 +341,10 @@ nobreak=true { \lstset{language=jsonGet,rulecolor=\color{\methodColor}} } -\begin{comment} -\newcommand{\apiCorner}{notround} - -\newcommand{\apiCornerRound} -{ -\renewcommand{\apiCorner}{round} -} - -\newcommand{\apiCornerNotRound} +\newcommand{\methodXml} { -\renewcommand{\apiCorner}{notround} +\lstset{language=xmlGet,rulecolor=\color{\methodColor}} } -\end{comment} \newenvironment{apiRoute}[3] { \global\let\saved@CT@arc@\CT@arc@ @@ -281,6 +363,12 @@ nobreak=true \colorlet{numbGet}{delimGet} \lstset{language=jsonGet,rulecolor=\color{\methodColor}} } +\renewcommand{\methodXml} +{ +\colorlet{delimGet}{\methodColor} +\colorlet{numbGet}{delimGet} +\lstset{language=xmlGet,rulecolor=\color{\methodColor}} +} } {} @@ -295,6 +383,12 @@ nobreak=true \colorlet{numbPost}{delimPost} \lstset{language=jsonPost,rulecolor=\color{\methodColor}} } +\renewcommand{\methodXml} +{ +\colorlet{delimPost}{\methodColor} +\colorlet{numbPost}{delimPost} +\lstset{language=xmlPost,rulecolor=\color{\methodColor}} +} } {} @@ -309,6 +403,12 @@ nobreak=true \colorlet{numbPut}{delimPut} \lstset{language=jsonPut,rulecolor=\color{\methodColor}} } +\renewcommand{\methodXml} +{ +\colorlet{delimPut}{\methodColor} +\colorlet{numbPut}{delimPut} +\lstset{language=xmlPut,rulecolor=\color{\methodColor}} +} } {} \ifthenelse{\equal{\method}{delete}} @@ -322,6 +422,12 @@ nobreak=true \colorlet{numbDelete}{delimDelete} \lstset{language=jsonDelete,rulecolor=\color{\methodColor}} } +\renewcommand{\methodXml} +{ +\colorlet{delimDelete}{\methodColor} +\colorlet{numbDelete}{delimDelete} +\lstset{language=xmlDelete,rulecolor=\color{\methodColor}} +} } {} @@ -361,6 +467,8 @@ nobreak=true } \newenvironment{routeRequest}[1] { +\renewcommand{\bodyFormat}{#1} + \arrayrulecolor{\methodColor} \begin{tabularx}{\textwidth}{X l} @@ -374,7 +482,7 @@ nobreak=true } \lstnewenvironment{routeRequestBody} { -\methodJson +\IfSubStr{\bodyFormat}{xml}{\methodXml}{\methodJson} } {} \newenvironment{routeParameter} @@ -402,6 +510,8 @@ nobreak=true } \newenvironment{routeResponse}[1] { +\renewcommand{\bodyFormat}{#1} + \newcommand{\noRouteResponse}[1] { \begin{tabularx}{\textwidth}{X} @@ -429,7 +539,7 @@ nobreak=true \lstnewenvironment{routeResponseItemBody} { \vspace{-1.4em} -\methodJson +\IfSubStr{\bodyFormat}{xml}{\methodXml}{\methodJson} } {} \endinput |