diff options
Diffstat (limited to 'Master/tlpkg')
-rw-r--r-- | Master/tlpkg/TeXLive/TLPaper.pm | 39 | ||||
-rw-r--r-- | Master/tlpkg/doc/JSON-formats.txt | 20 |
2 files changed, 59 insertions, 0 deletions
diff --git a/Master/tlpkg/TeXLive/TLPaper.pm b/Master/tlpkg/TeXLive/TLPaper.pm index 8f2f469aac1..70bd55ef501 100644 --- a/Master/tlpkg/TeXLive/TLPaper.pm +++ b/Master/tlpkg/TeXLive/TLPaper.pm @@ -396,6 +396,17 @@ sub paper_pdftex { for my $p (keys %pdftex_papersize) { info("$p\n") unless ($p eq $currentpaper); } + } elsif ($newpaper eq "--json") { + my @ret = (); + push @ret, "$currentpaper"; + for my $p (keys %pdftex_papersize) { + push @ret, $p unless ($p eq $currentpaper); + } + my %foo; + $foo{'program'} = "pdftex"; + $foo{'file'} = $inp; + $foo{'options'} = \@ret; + return \%foo; } elsif ($newpaper eq "--returnlist") { my @ret = (); push @ret, "$currentpaper"; @@ -542,6 +553,12 @@ sub paper_dvips { for my $p (@papersizes) { info("$p\n"); # first is already the selected one } + } elsif ($newpaper eq "--json") { + my %foo; + $foo{'program'} = "dvips"; + $foo{'file'} = $inp; + $foo{'options'} = \@papersizes; + return \%foo; } elsif ($newpaper eq "--returnlist") { return(\@papersizes); } else { @@ -703,6 +720,17 @@ sub paper_context { for my $p (keys %pdftex_papersize) { info("$p\n") unless ($p eq $currentpaper); } + } elsif ($newpaper eq "--json") { + my @ret = (); + push @ret, "$currentpaper"; + for my $p (keys %pdftex_papersize) { + push @ret, $p unless ($p eq $currentpaper); + } + my %foo; + $foo{'program'} = "context"; + $foo{'file'} = $inp; + $foo{'options'} = \@ret; + return \%foo; } elsif ($newpaper eq "--returnlist") { my @ret = (); push @ret, "$currentpaper"; @@ -862,6 +890,17 @@ sub paper_do_simple { for my $p (@$paplist) { info("$p\n") unless ($p eq $currentpaper); } + } elsif ($newpaper eq "--json") { + my @ret = (); + push @ret, "$currentpaper"; + for my $p (@$paplist) { + push @ret, $p unless ($p eq $currentpaper); + } + my %foo; + $foo{'program'} = $prog; + $foo{'file'} = $inp; + $foo{'options'} = \@ret; + return \%foo; } elsif ($newpaper eq "--returnlist") { my @ret = (); push @ret, $currentpaper; diff --git a/Master/tlpkg/doc/JSON-formats.txt b/Master/tlpkg/doc/JSON-formats.txt index 9f0edd0762e..c2917098e67 100644 --- a/Master/tlpkg/doc/JSON-formats.txt +++ b/Master/tlpkg/doc/JSON-formats.txt @@ -131,5 +131,25 @@ Example: } ] + +TLPAPER +------- +array of objects, each one having three keys: program, file, options. +`program' gives the program name, `file' the place where the configuration +has been found, and `options' is an array of strings with the first +one being the currently selected paper. +Example for one element of the array: + { + "options" : [ + "a4", + "letter" + ], + "file" : "/usr/local/texlive/2017/texmf-config/tex/generic/config/pdftexconfig.tex", + "program" : "pdftex" + } + + + + TODO UPDATE JSON format |