texlive[74793] Master/texmf-dist: jsonparse (30mar25)
commits+karl at tug.org
commits+karl at tug.org
Sun Mar 30 22:33:06 CEST 2025
Revision: 74793
https://tug.org/svn/texlive?view=revision&revision=74793
Author: karl
Date: 2025-03-30 22:33:06 +0200 (Sun, 30 Mar 2025)
Log Message:
-----------
jsonparse (30mar25)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/jsonparse/README.md
trunk/Master/texmf-dist/doc/latex/jsonparse/jsonparse-doc.pdf
trunk/Master/texmf-dist/doc/latex/jsonparse/jsonparse-doc.tex
trunk/Master/texmf-dist/tex/latex/jsonparse/jsonparse.sty
Modified: trunk/Master/texmf-dist/doc/latex/jsonparse/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/jsonparse/README.md 2025-03-30 20:32:56 UTC (rev 74792)
+++ trunk/Master/texmf-dist/doc/latex/jsonparse/README.md 2025-03-30 20:33:06 UTC (rev 74793)
@@ -1,4 +1,4 @@
-
+

Modified: trunk/Master/texmf-dist/doc/latex/jsonparse/jsonparse-doc.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/jsonparse/jsonparse-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/jsonparse/jsonparse-doc.tex 2025-03-30 20:32:56 UTC (rev 74792)
+++ trunk/Master/texmf-dist/doc/latex/jsonparse/jsonparse-doc.tex 2025-03-30 20:33:06 UTC (rev 74793)
@@ -11,8 +11,8 @@
% This work has the LPPL maintenance status `maintained'.
%
\documentclass[a4paper]{article}
-\def\jsonparsefileversion{1.3.0}
-\def\jsonparsefiledate{25 March 2025}
+\def\jsonparsefileversion{1.3.1}
+\def\jsonparsefiledate{30 March 2025}
\usepackage[T1]{fontenc}
\usepackage{Alegreya}
@@ -122,6 +122,18 @@
}
\ExplSyntaxOff
+\NewDocumentCommand{\expandablestarcode}{ O{0,0} }{
+ \fill[black!50, shift={([xshift={-10pt}, yshift={-10pt-0.5em}]#1)}]
+ (90:3.75pt)
+ \foreach \i in {1,...,4} {
+ -- ({90+360/5*\i*2}:3.75pt)
+ } -- cycle;
+}
+
+\NewDocumentCommand{\expandablestar}{}{
+ \tikz{\expandablestarcode}
+}
+
\tcbset{
size=small,
arc=2.5pt,
@@ -144,11 +156,7 @@
optional hypertarget={#2},
overlay={
\IfBooleanT{#1}{
- \fill[black!50, shift={([xshift={-10pt}, yshift={-10pt-0.5em}]frame.north east)}]
- (90:3.75pt)
- \foreach \i in {1,...,4} {
- -- ({90+360/5*\i*2}:3.75pt)
- } -- cycle;
+ \expandablestarcode[frame.north east]
}
}
}
@@ -166,7 +174,7 @@
after={\par\smallskip\noindent}
}
-\NewTCBListing{macrodeprecated}{}{
+\NewTCBListing{macrodeprecated}{ s }{
listing only,
listing style={jsonparsedocmacro},
boxrule=0pt,
@@ -174,10 +182,19 @@
box align=top,
after=\hfill,
colframe=black!25!red!10,
- colback=black!25!red!10
+ colback=black!25!red!10,
+ enhanced,
+ overlay={
+ \IfBooleanT{#1}{
+ \fill[black!25!red!10]
+ ([yshift={5pt-1.5em}]frame.north east)
+ -- ++(5pt,-5pt) -- ++(-5pt,-5pt)
+ -- cycle;
+ }
+ }
}
-\NewTCBListing{macroreplacement}{}{
+\NewTCBListing{macroreplacement}{ }{
listing only,
listing style={jsonparsedocmacro},
boxrule=0pt,
@@ -267,6 +284,7 @@
%\changes{v1.2.2}{2025/02/25}{Fixes in documentation.}
\changes{v1.2.3}{2025/03/23}{Enabled nesting of mapped inline function.}
\changes{v1.3.0}{2025/03/25}{Enhancements in key setting mechanism.}
+%\changes{v1.3.1}{2025/02/30}{Fixes in documentation. Bug fixes.}
\begin{document}
\vspace*{-1cm}
@@ -300,7 +318,7 @@
\begin{codeexample}
{
"string" : "a" ,
- "boolean true" : true ,
+ "boolean true" : true ,
"boolean false" : false ,
"null" : null ,
"number" : "number" : -1.1e-1 ,
@@ -334,8 +352,8 @@
(arr) [ "a" , "b" , "c" ]
(arr end)
(key) .:
- (obj) { "string" : "a" , "boolean true" : true , "boolean false" :
- false , "null" : null , "number" : "number" : -1.1e-1 , "array" :
+ (obj) { "string" : "a" , "boolean true" : true , "boolean false" :
+ false , "null" : null , "number" : "number" : -1.1e-1 , "array" :
[ "a" , "b" , "c" ] }
(obj end)
JSON parsing done.
@@ -407,7 +425,7 @@
\section{Main user commands}
-The first part of this section describes the basic commands for parsing JSON data and retrieving values from parsed JSON data. The second part of this section describes the various commands for handling arrays provided by this package.
+The first part of this section describes the basic commands for parsing JSON data and retrieving values from parsed JSON data. The second part of this section describes the various commands for handling arrays provided by this package. Commands marked with a star (\expandablestar) are fully expandable.
\subsection{Basic parsing commands}
@@ -793,9 +811,9 @@
\section{Deprecated commands}
-The following commands displayed in red boxes on the left have been deprecated and the relevant replacement displayed in green boxes on the right should be used. To simplify the representation of the code and clarify how arguments are supposed to be used, numbers are used to identify the arguments.
+The following commands displayed in red boxes on the left have been deprecated and the relevant replacement displayed in green box right to it should be used. To simplify the representation of the code and clarify how arguments are supposed to be used, numbers are used to identify the arguments.
-\begin{macrodeprecated}
+\begin{macrodeprecated}*
|\JSONParseSetValue|
{<1>}{<2>}{<3>}
\end{macrodeprecated}
@@ -805,7 +823,7 @@
rescan=false]{<2>}{<3>}
\end{macroreplacement}
-\begin{macrodeprecated}
+\begin{macrodeprecated}*
|\JSONParseSetRescanValue|
{<1>}{<2>}{<3>}
\end{macrodeprecated}
@@ -815,7 +833,7 @@
rescan]{<2>}{<3>}
\end{macroreplacement}
-\begin{macrodeprecated}
+\begin{macrodeprecated}*
|\JSONParseSetKeys|
{<1>}{<2>}{<3>}
\end{macrodeprecated}
@@ -825,7 +843,7 @@
[store in={<1>}]{<2>}{<3>}
\end{macroreplacement}
-\begin{macrodeprecated}
+\begin{macrodeprecated}*
|\JSONParseSetArrayCount|
{<1>}{<2>}{<3>}
\end{macrodeprecated}
@@ -835,7 +853,7 @@
[store in={<1>}]{<2>}{<3>}
\end{macroreplacement}
-\begin{macrodeprecated}
+\begin{macrodeprecated}*
|\JSONParseArrayValues|
[<1>]{<2>}{<3>}[<4>]{<5>}
\end{macrodeprecated}
@@ -845,7 +863,7 @@
[<1>]{<2>}{<3>}[<4>]{<5>}
\end{macroreplacement}
-\begin{macrodeprecated}
+\begin{macrodeprecated}*
|\JSONParseArrayValuesMap|
[<1>]{<2>}{<3>}[<4>]{<5>}
[<6>][<7>]
@@ -864,9 +882,24 @@
\section{L3 commands}
-The following commands are provided for defining user functions by package authors. For the conditional functions described above, apart from the variant that provides a true and a false branch, the and variants that only provide an argument for the true or for the false branch respectively are defined as well which is indicated by the letters {\itshape\macro{TF}} printed in italics.
+The following token variables and commands are provided for defining user functions by package authors. For the conditional functions described below, apart from the variant that provides a true and a false branch, the and variants that only provide an argument for the true or for the false branch respectively are defined as well which is indicated by the letters {\itshape\macro{TF}} printed in italics. Commands marked with a star (\expandablestar) are fully expandable.
\begin{macrodef}
+|\l_jsonparse_externalize_prefix_str|
+\end{macrodef}
+The token variable \macro{\l_jsonparse_externalize_prefix_str} holds the prefix for externalization file names as defined by the user via the key \macro{externalize prefix}.
+
+\begin{macrodef}
+|\l_jsonparse_current_prop_str|
+\end{macrodef}
+The token variable \macro{\l_jsonparse_current_prop_str} holds the name of the property list as defined by the user when calling the command \macro{\JSONParse} or \macro{\JSONParseFromFile}.
+
+\begin{macrodef}
+|\g_jsonparse_entries_prop|
+\end{macrodef}
+The token variable \macro{\g_jsonparse_entries_prop} holds as property list all elements of a JSON data structure that was parsed by the command \macro{\jsonparse_parse:n}.
+
+\begin{macrodef}
|\jsonparse_parse:n| {<JSON string>}
|\jsonparse_parse:o| {<JSON string>}
|\jsonparse_parse:e| {<JSON string>}
@@ -908,7 +941,7 @@
|\jsonparse_gset_rescan:Nn| <token variable> {<JSON value>}
|\jsonparse_gset_rescan:Ne| <token variable> {<JSON value>}
\end{macrodef}
-The command \macro{\jsonparse_set_rescan:Nn} rescans the JSON value given in the second argument and stores the result globally in the token variable specified in the second argument.
+The command \macro{\jsonparse_gset_rescan:Nn} rescans the JSON value given in the second argument and stores the result globally in the token variable specified in the second argument.
\begin{macrodef}
|\jsonparse_put_right_rescan:Nn| <token variable> {<JSON value>}
Modified: trunk/Master/texmf-dist/tex/latex/jsonparse/jsonparse.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/jsonparse/jsonparse.sty 2025-03-30 20:32:56 UTC (rev 74792)
+++ trunk/Master/texmf-dist/tex/latex/jsonparse/jsonparse.sty 2025-03-30 20:33:06 UTC (rev 74793)
@@ -10,7 +10,7 @@
%
% This work has the LPPL maintenance status `maintained'.
%
-\ProvidesExplPackage {jsonparse} {2025-03-25} {1.3.0}
+\ProvidesExplPackage {jsonparse} {2025-03-30} {1.3.1}
{A handy way to parse, store and access JSON data from files or strings in LaTeX documents}
\msg_new:nnn { jsonparse } { old-kernel } {
@@ -250,7 +250,7 @@
code ~ after .tl_set:N = \l__jsonparse_array_map_code_after_tl
}
-\keys_define:nn { jsonparse / store ~ in } {
+\keys_define:nn { jsonparse / set } {
store ~ in .tl_set:N = \l__jsonparse_store_in_tl ,
global .bool_set:N = \l__jsonparse_store_in_global_bool ,
global .default:n = { true } ,
@@ -272,8 +272,8 @@
{ jsonparse / parse } \l__jsonparse_unused_keys_clist
\keys_set_known:nonN { jsonparse / typeset } { \l__jsonparse_unused_keys_clist }
{ jsonparse / typeset } \l__jsonparse_unused_keys_clist
- \keys_set_known:nonN { jsonparse / store ~ in } { \l__jsonparse_unused_keys_clist }
- { jsonparse / store ~ in } \l__jsonparse_unused_keys_clist
+ \keys_set_known:nonN { jsonparse / set } { \l__jsonparse_unused_keys_clist }
+ { jsonparse / set } \l__jsonparse_unused_keys_clist
\keys_set_known:nonN { jsonparse / map } { \l__jsonparse_unused_keys_clist }
{ jsonparse / map } \l__jsonparse_unused_keys_clist
\__jsonparse_warning_unused_keys:
@@ -294,8 +294,7 @@
\bool_if:NT \l__jsonparse_compat_bool {
\cs_if_exist:NF \str_casefold:n {
- \cs_new_eq:NN \str_casefold:n \str_foldcase:n
- \cs_new:Npn \str_foldcase:n { \str_casefold:n }
+ \cs_new:Npn \str_casefold:n { \str_foldcase:n }
}
}
@@ -313,6 +312,7 @@
\cs_generate_variant:Nn \tl_replace_once:Nnn { Non }
\cs_generate_variant:Nn \tl_rescan:nn { no , ne }
\cs_generate_variant:Nn \tl_set:Nn { Ne }
+\cs_generate_variant:Nn \tl_to_str:n { o , e }
\cs_generate_variant:Nn \tl_trim_spaces:n { e }
\cs_generate_variant:Nn \str_case_e:nn { en }
\cs_generate_variant:Nn \str_casefold:n { o }
@@ -354,7 +354,8 @@
\prop_new_linked:N \l__jsonparse_temp_copy_prop
}
-\scan_new:N \s__jsonparse_mark
+\scan_new:N \s__jsonparse_stop
+\scan_new:N \s__jsonparse_split
\tl_new:N \g__jsonparse_json_tl
\tl_new:N \l__jsonparse_input_tl
@@ -819,17 +820,17 @@
\cs_new_protected:Npn \__jsonparse_parse_other:w #1 \q_stop {
\__jsonparse_array_key_set:
- \tl_set:Nn \l__jsonparse_temp_tl { #1 \s__jsonparse_mark }
- \tl_replace_once:Nnn \l__jsonparse_temp_tl { , } { \s__jsonparse_mark , }
- \tl_replace_once:Nnn \l__jsonparse_temp_tl { ] } { \s__jsonparse_mark ] }
- \tl_replace_once:Non \l__jsonparse_temp_tl { \c_right_brace_str } { \s__jsonparse_mark \c_right_brace_str }
+ \tl_set:Nn \l__jsonparse_temp_tl { #1 \s__jsonparse_split }
+ \tl_replace_once:Nnn \l__jsonparse_temp_tl { , } { \s__jsonparse_split , }
+ \tl_replace_once:Nnn \l__jsonparse_temp_tl { ] } { \s__jsonparse_split ] }
+ \tl_replace_once:Non \l__jsonparse_temp_tl { \c_right_brace_str } { \s__jsonparse_split \c_right_brace_str }
\exp_last_unbraced:No
\__jsonparse_parse_other_aux:w \l__jsonparse_temp_tl \q_stop
}
-\cs_new_protected:Npn \__jsonparse_parse_other_aux:w #1 \s__jsonparse_mark #2 \q_stop {
+\cs_new_protected:Npn \__jsonparse_parse_other_aux:w #1 \s__jsonparse_split #2 \q_stop {
\tl_set:Nn \l__jsonparse_remainder_tl {#2}
- \tl_remove_all:Nn \l__jsonparse_remainder_tl { \s__jsonparse_mark }
+ \tl_remove_all:Nn \l__jsonparse_remainder_tl { \s__jsonparse_split }
\tl_set:Ne \l__jsonparse_temp_tl { \tl_trim_spaces:n {#1} }
\cs_if_exist_use:cF { __jsonparse_parse_ \str_casefold:o { \l__jsonparse_temp_tl } : } {
\bool_if:NTF \l__jsonparse_check_num_bool {
@@ -1173,7 +1174,7 @@
\cs_set:Npn \r { \l__jsonparse_carriage_return_str }
\cs_set:Npn \t { \l__jsonparse_horizontal_tab_str }
\cs_set_eq:NN \u \__jsonparse_unicode_char:NNNNN
- \tl_set:Ne #1 {#2}
+ \tl_set:Ne #1 { #2 \s__jsonparse_stop }
\cs_set_eq:NN \" \__jsonparse_tex_quote:
\cs_set_eq:NN \\ \__jsonparse_tex_backslash:
\bool_if:NT \l__jsonparse_escape_number_sign_bool {
@@ -1197,6 +1198,7 @@
\bool_if:NT \l__jsonparse_escape_tilde_bool {
\tl_replace_all:Noe #1 { \c_tilde_str } { \c_backslash_str \c_tilde_str { } }
}
+ \tl_remove_all:Nn #1 { \s__jsonparse_stop }
}
\cs_new_protected:Npn \jsonparse_rescan:n #1 {
@@ -1275,8 +1277,8 @@
\group_begin:
\keys_set_known:nnnN { jsonparse / typeset } {#1}
{ jsonparse / typeset } \l__jsonparse_unused_keys_clist
- \keys_set_known:nonN { jsonparse / store ~ in } { \l__jsonparse_unused_keys_clist }
- { jsonparse / store ~ in }\l__jsonparse_unused_keys_clist
+ \keys_set_known:nonN { jsonparse / set } { \l__jsonparse_unused_keys_clist }
+ { jsonparse / set }\l__jsonparse_unused_keys_clist
\__jsonparse_warning_unused_keys:
\tl_if_empty:NF \l__jsonparse_store_in_tl {
\exp_last_unbraced:No \tl_if_exist:NF \l__jsonparse_store_in_tl {
@@ -1337,8 +1339,8 @@
\NewDocumentCommand { \JSONParseKeys } { O{} m m } {
\__jsonparse_warning_undefined_prop:N #2
\group_begin:
- \keys_set_known:nnnN { jsonparse / store ~ in } {#1}
- { jsonparse / store ~ in } \l__jsonparse_unused_keys_clist
+ \keys_set_known:nnnN { jsonparse / set } {#1}
+ { jsonparse / set } \l__jsonparse_unused_keys_clist
\__jsonparse_warning_unused_keys:
\prop_set_eq:NN \l__jsonparse_temp_copy_prop #2
\jsonparse_filter:Nn \l__jsonparse_temp_copy_prop {#3}
@@ -1402,8 +1404,8 @@
\NewDocumentCommand { \JSONParseArrayCount } { O{} m m } {
\__jsonparse_warning_undefined_prop:N #2
\group_begin:
- \keys_set_known:nnnN { jsonparse / store ~ in } {#1}
- { jsonparse / store ~ in } \l__jsonparse_unused_keys_clist
+ \keys_set_known:nnnN { jsonparse / set } {#1}
+ { jsonparse / set } \l__jsonparse_unused_keys_clist
\__jsonparse_warning_unused_keys:
\prop_set_eq:NN \l__jsonparse_temp_copy_prop #2
\jsonparse_filter:Nn \l__jsonparse_temp_copy_prop {#3}
@@ -1476,8 +1478,8 @@
\group_begin:
\keys_set_known:nnnN { jsonparse / typeset } {#1}
{ jsonparse / typeset } \l__jsonparse_unused_keys_clist
- \keys_set_known:nonN { jsonparse / store ~ in } { \l__jsonparse_unused_keys_clist }
- { jsonparse / store ~ in } \l__jsonparse_unused_keys_clist
+ \keys_set_known:nonN { jsonparse / set } { \l__jsonparse_unused_keys_clist }
+ { jsonparse / set } \l__jsonparse_unused_keys_clist
\__jsonparse_warning_unused_keys:
\prop_set_eq:NN \l__jsonparse_temp_copy_prop #2
\jsonparse_filter:Nn \l__jsonparse_temp_copy_prop {#3}
@@ -1687,8 +1689,8 @@
__jsonparse_array_map_inline_ \int_to_roman:n { \g__jsonparse_array_map_inline_int } _code:n
} ##1 {#4}
\group_begin:
- \keys_set_known:nnnN { jsonparse / store ~ in } {#1}
- { jsonparse / store ~ in } \l__jsonparse_unused_keys_clist
+ \keys_set_known:nnnN { jsonparse / set } {#1}
+ { jsonparse / set } \l__jsonparse_unused_keys_clist
\__jsonparse_warning_unused_keys:
\prop_set_eq:NN \l__jsonparse_temp_copy_prop #2
\jsonparse_filter:Nn \l__jsonparse_temp_copy_prop {#3}
More information about the tex-live-commits
mailing list.