summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2022-03-03 21:09:20 +0000
committerKarl Berry <karl@freefriends.org>2022-03-03 21:09:20 +0000
commitc568ce9e272d7341e2c05d8a8c204c21486b83f7 (patch)
tree5e84088225a26e5b6c0cb6d4ae808a530002925f
parent9150bf479bb504503a94eb23384ee565d29613a1 (diff)
texdoc (3mar22)
git-svn-id: svn://tug.org/texlive/trunk@62379 c570f23f-e606-0410-a88d-b1316a301751
-rwxr-xr-xBuild/source/texk/texlive/linked_scripts/texlive/tlmgr.pl12
-rw-r--r--Master/texmf-dist/doc/man/man1/texdoc.14
-rw-r--r--Master/texmf-dist/doc/man/man1/texdoc.man1.pdfbin26938 -> 27009 bytes
-rw-r--r--Master/texmf-dist/doc/support/texdoc/NEWS6
-rw-r--r--Master/texmf-dist/doc/support/texdoc/texdoc.pdfbin84310 -> 84307 bytes
-rw-r--r--Master/texmf-dist/doc/support/texdoc/texdoc.tex6
-rwxr-xr-xMaster/texmf-dist/scripts/texdoc/texdoclib-cli.tlu4
-rwxr-xr-xMaster/texmf-dist/scripts/texdoc/texdoclib-config.tlu8
-rwxr-xr-xMaster/texmf-dist/scripts/texdoc/texdoclib-const.tlu33
-rwxr-xr-xMaster/texmf-dist/scripts/texdoc/texdoclib-score.tlu107
-rwxr-xr-xMaster/texmf-dist/scripts/texdoc/texdoclib-search.tlu56
-rwxr-xr-xMaster/texmf-dist/scripts/texdoc/texdoclib-util.tlu40
-rw-r--r--Master/texmf-dist/scripts/texdoc/texdoclib.tlu2
-rw-r--r--Master/texmf-dist/texdoc/texdoc.cnf16
14 files changed, 197 insertions, 97 deletions
diff --git a/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl b/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl
index 8deab5ef5ca..48d82305ba9 100755
--- a/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl
+++ b/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl
@@ -1,14 +1,14 @@
#!/usr/bin/env perl
-# $Id: tlmgr.pl 61401 2021-12-24 22:42:10Z karl $
+# $Id: tlmgr.pl 62273 2022-02-28 08:52:17Z preining $
#
-# Copyright 2008-2021 Norbert Preining
+# Copyright 2008-2022 Norbert Preining
# This file is licensed under the GNU General Public License version 2
# or any later version.
use strict; use warnings;
-my $svnrev = '$Revision: 61401 $';
-my $datrev = '$Date: 2021-12-24 23:42:10 +0100 (Fri, 24 Dec 2021) $';
+my $svnrev = '$Revision: 62273 $';
+my $datrev = '$Date: 2022-02-28 09:52:17 +0100 (Mon, 28 Feb 2022) $';
my $tlmgrrevision;
my $tlmgrversion;
my $prg;
@@ -4306,7 +4306,7 @@ sub show_one_package_detail {
$binsize += $binsz{$a} if defined($binsz{$a});
my $atlp = $tlpdb->get_package($tlp->name . ".$a");
if (!$atlp) {
- tlwarn("$prg: cannot find depending package" . $tlp->name . ".$a\n");
+ tlwarn("$prg: cannot find depending package " . $tlp->name . ".$a\n");
return($F_WARNING);
}
my %abinsz = %{$atlp->binsize};
@@ -10236,7 +10236,7 @@ This script and its documentation were written for the TeX Live
distribution (L<https://tug.org/texlive>) and both are licensed under the
GNU General Public License Version 2 or later.
-$Id: tlmgr.pl 61401 2021-12-24 22:42:10Z karl $
+$Id: tlmgr.pl 62273 2022-02-28 08:52:17Z preining $
=cut
# test HTML version: pod2html --cachedir=/tmp tlmgr.pl >/tmp/tlmgr.html
diff --git a/Master/texmf-dist/doc/man/man1/texdoc.1 b/Master/texmf-dist/doc/man/man1/texdoc.1
index 63ee8e31e57..c92bd7ccb20 100644
--- a/Master/texmf-dist/doc/man/man1/texdoc.1
+++ b/Master/texmf-dist/doc/man/man1/texdoc.1
@@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
-.TH "TEXDOC" "1" "May 2021" "Texdoc 3.3.1" "Texdoc manual"
+.TH "TEXDOC" "1" "March 2022" "Texdoc 3.4" "Texdoc manual"
.
.SH "NAME"
\fBtexdoc\fR \- find & view documentation in TeX Live
@@ -156,7 +156,7 @@ Texdoc home page: \fIhttp://tug\.org/texdoc/\fR
Source: \fIhttps://github\.com/TeX\-Live/texdoc\fR
.
.SH "COPYRIGHT"
-Copyright 2008\-2021 Manuel Pe\'gourie\'\-Gonnard, Takuto Asakura, the TeX Live Team\.
+Copyright 2008\-2022 Manuel Pe\'gourie\'\-Gonnard, Takuto Asakura, the TeX Live Team\.
.
.br
License: GNU GPL version 3 or later \fIhttp://gnu\.org/licenses/gpl\.html\fR\.
diff --git a/Master/texmf-dist/doc/man/man1/texdoc.man1.pdf b/Master/texmf-dist/doc/man/man1/texdoc.man1.pdf
index 2673605a3ea..d42365a321a 100644
--- a/Master/texmf-dist/doc/man/man1/texdoc.man1.pdf
+++ b/Master/texmf-dist/doc/man/man1/texdoc.man1.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/support/texdoc/NEWS b/Master/texmf-dist/doc/support/texdoc/NEWS
index c08e6c862da..0c5b6b4e8ae 100644
--- a/Master/texmf-dist/doc/support/texdoc/NEWS
+++ b/Master/texmf-dist/doc/support/texdoc/NEWS
@@ -2,6 +2,12 @@ NEWS for texdoc
===============
(This file public domain.)
+Version 3.4 (TeX Live 2022)
+===========================
+- Make Data.tlpdb.lua reproducible
+- Better locale handling in scoring
+- Alias adjustments
+
Version 3.3.1
-------------
- Support non-ascii username on Windows (patch by A. Kakuto)
diff --git a/Master/texmf-dist/doc/support/texdoc/texdoc.pdf b/Master/texmf-dist/doc/support/texdoc/texdoc.pdf
index b5e9b6bcc3e..8e6f1ecc7cc 100644
--- a/Master/texmf-dist/doc/support/texdoc/texdoc.pdf
+++ b/Master/texmf-dist/doc/support/texdoc/texdoc.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/support/texdoc/texdoc.tex b/Master/texmf-dist/doc/support/texdoc/texdoc.tex
index 528eda18987..8346c80193d 100644
--- a/Master/texmf-dist/doc/support/texdoc/texdoc.tex
+++ b/Master/texmf-dist/doc/support/texdoc/texdoc.tex
@@ -1,6 +1,6 @@
%#!xelatex
% Texdoc user manual
-% Copyright 2008-2021 Manuel Pégourié-Gonnard and Takuto Asakura
+% Copyright 2008-2022 Manuel Pégourié-Gonnard and Takuto Asakura
% distributed under the terms of GPL v3 or later
\documentclass{texdoc-doc}
@@ -8,7 +8,7 @@
\subtitle{Find \& view documentation in \TL}
\pkgurl{https://tug.org/texdoc/}
\author{Manuel Pégourié-Gonnard\and Takuto Asakura}
-\date{v3.3.1\quad \today}
+\date{v3.4\quad \today}
\begin{document}
@@ -731,7 +731,7 @@ Texdoc within a {\TL}-based {\TeX} distribution which does not ship
\label{sec:licence}
The current version of Texdoc program and its documentation are copyright
-2008--2021 Manuel Pégourié-Gonnard, Takuto Asakura, the {\TL} Team.
+2008--2022 Manuel Pégourié-Gonnard, Takuto Asakura, the {\TL} Team.
They are free software: you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
diff --git a/Master/texmf-dist/scripts/texdoc/texdoclib-cli.tlu b/Master/texmf-dist/scripts/texdoc/texdoclib-cli.tlu
index 95a43b7ddd9..5818af7f184 100755
--- a/Master/texmf-dist/scripts/texdoc/texdoclib-cli.tlu
+++ b/Master/texmf-dist/scripts/texdoc/texdoclib-cli.tlu
@@ -1,4 +1,4 @@
--- texdoclib-cli.tlu: command line interfaces for texdoc
+-- texdoclib-cli.tlu: command-line interfaces for texdoc
--
-- The TeX Live Team, GPLv3, see texdoclib.tlu for details
@@ -200,7 +200,7 @@ end
-------------------------- the main function --------------------------
function M.exec()
- -- parsing command line options
+ -- parsing command-line options
local ok, action, cl_config = parse_options()
if not ok then
diff --git a/Master/texmf-dist/scripts/texdoc/texdoclib-config.tlu b/Master/texmf-dist/scripts/texdoc/texdoclib-config.tlu
index 2fc0c99cdf0..3f2dddb34a9 100755
--- a/Master/texmf-dist/scripts/texdoc/texdoclib-config.tlu
+++ b/Master/texmf-dist/scripts/texdoc/texdoclib-config.tlu
@@ -50,7 +50,7 @@ function M.get_value(key) return config[key] end
local function context_to_string(context)
if not context then return '(no context)' end
if context.src == 'cl' then
- return 'from command line option "' .. context.name .. '"'
+ return 'from command-line option "' .. context.name .. '"'
elseif context.src == 'env' then
return 'from environment variable "' .. context.name .. '"'
elseif context.src == 'loc' then
@@ -169,9 +169,9 @@ local function set_config_list(conf, context)
end
end
------------------------- config from command line ------------------------
+------------------------ config from command-line ------------------------
--- set config from the command line
+-- set config from the command-line
-- Note: Make sure to set a default value in setup_config_from_defaults()
-- if relevant.
local function setup_config_from_cl(cl_config)
@@ -450,7 +450,7 @@ function M.get_default_viewers()
-- Use 'start' to get file associations.
-- We need to quote the filenames, but the first quoted argument
-- is considered as the title by start, so we provide a dummy title.
- -- Also, since the command line parser removes quotes if there
+ -- Also, since the command-line parser removes quotes if there
-- is no space inside, the dummy title must contain spaces.
viewer_dvi = 'start "texdoc dvi viewer"',
viewer_html = 'start "texdoc html viewer"',
diff --git a/Master/texmf-dist/scripts/texdoc/texdoclib-const.tlu b/Master/texmf-dist/scripts/texdoc/texdoclib-const.tlu
index 7da64d394bb..d6def02f747 100755
--- a/Master/texmf-dist/scripts/texdoc/texdoclib-const.tlu
+++ b/Master/texmf-dist/scripts/texdoc/texdoclib-const.tlu
@@ -22,8 +22,8 @@ end
-- progname and version
fullname = kpse.find_file('texdoc/texdoclib', 'lua')
progname = 'Texdoc'
-version = '3.3.1'
-release_date = '2021-05-20'
+version = '3.4'
+release_date = '2022-03-03'
-- make sure to update setup_config_from_cl() accordingly
-- and set a default value in setup_config_from_defaults() if relevant
@@ -64,7 +64,7 @@ Repository: <https://github.com/TeX-Live/texdoc>
Please email bugs to <texdoc@tug.org>.]]
copyright_msg = [[
-Copyright 2008-2021 Manuel Pégourié-Gonnard, Takuto Asakura, the TeX Live Team.
+Copyright 2008-2022 Manuel Pégourié-Gonnard, Takuto Asakura, the TeX Live Team.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.]]
@@ -104,7 +104,7 @@ notfound_msg_ph = 'PKGNAME'
-- exit codes
exit_ok = 0
-exit_error = 1 -- apparently hard-coded in Lua
+exit_error = 1 -- apparently hard-coded in Lua
exit_usage = 2
exit_notfound = 3
@@ -129,14 +129,35 @@ known_debugs = {
}
-- various cache or non-cache files
-cache_name = 'texdoc/cache-tlpdb.lua' -- relative to TEXMFVAR
+cache_name = 'texdoc/cache-tlpdb.lua' -- relative to TEXMFVAR
data_tlpdb_name = 'texdoc/Data.tlpdb.lua'
-place_holder = '%%s' -- used for viewer commands
+place_holder = '%%s' -- used for viewer commands
-- kpse path separator
kpse_sep = (os.type == 'windows') and ';' or ':'
+-- language codes
+-- Note: corrected with `find $TEXMFDIST/doc/ | awk 'match(
+-- $0, /(.*)-(\w{2}).pdf/, a){print a[2]}'`
+lang_codes = {
+ cn = 'zh', -- Chinese (alias)
+ cz = 'cz', -- Chech/Slovak
+ de = 'de', -- German
+ ee = 'et', -- Estonian
+ en = 'en', -- English
+ es = 'es', -- Spanish
+ fr = 'fr', -- French
+ it = 'it', -- Italian
+ ja = 'ja', -- Japanese
+ nl = 'nl', -- Dutch
+ pl = 'pl', -- Polish
+ ro = 'ro', -- Romanian
+ ru = 'ru', -- Russian
+ sr = 'sr', -- Serbian
+ zh = 'zh', -- Chinese
+}
+
-- END constants
-- get our previous environment back
diff --git a/Master/texmf-dist/scripts/texdoc/texdoclib-score.tlu b/Master/texmf-dist/scripts/texdoc/texdoclib-score.tlu
index 01c3818e375..5aca28ef73b 100755
--- a/Master/texmf-dist/scripts/texdoc/texdoclib-score.tlu
+++ b/Master/texmf-dist/scripts/texdoc/texdoclib-score.tlu
@@ -5,6 +5,7 @@
-- dependencies
local md5 = require 'md5'
local texdoc = {
+ const = require 'texdoclib-const',
util = require 'texdoclib-util',
config = require 'texdoclib-config',
}
@@ -49,6 +50,26 @@ end
---------------------------- score computation -----------------------------
+-- parse filename into <base>, <lang>, <ext>
+local function parse(filename)
+ local base, lang, ext
+ ext = texdoc.util.get_ext(filename)
+ if ext ~= nil and ext ~= '' then
+ base = filename:sub(1, -#ext - 2)
+ else
+ base = filename
+ end
+
+ for lc, _ in pairs(texdoc.const.lang_codes) do
+ local hyph_lc = '-' .. lc
+ if base:sub(-#hyph_lc) == hyph_lc then
+ return base:sub(1, -#hyph_lc - 1), lc, ext
+ end
+ end
+
+ return base, lang, ext
+end
+
-- says if pat is a "subword" of str
local function is_subword(str, pat)
local function is_delim(str, i)
@@ -72,8 +93,8 @@ local function has_bad_basename(file)
return false
end
--- compute a heuristic score -10 <= s < 10
-local function heuristic_score(file, pat, dbg_score)
+-- compute a pattern score -10 <= s < 10
+local function pattern_score(name, pat, dbg_score)
dbg_score('Start heuristic scoring with pattern: ' .. pat)
-- score management
@@ -84,42 +105,40 @@ local function heuristic_score(file, pat, dbg_score)
dbg_score('New heuristic score: %.1f. Reason: %s', s, reason)
end
end
- local slash = not not string.find(pat, '/', 1, true)
-- look for exact or subword match
- if M.is_exact_locale(file, pat) then
- upscore(5, 'exact match with correct locale')
- elseif M.is_exact(file, pat) then
+ if M.is_exact(name, pat) then
upscore(4, 'exact match')
- elseif is_subword(file, pat) then
+ elseif is_subword(name, pat) then
upscore(1, 'subword match')
end
-- try derivatives unless pat contains a slash
+ local slash = not not string.find(pat, '/', 1, true)
if not slash then
for _, suffix in ipairs(texdoc.config.get_value('suffix_list')) do
local deriv = pat .. suffix
- if M.is_exact(file, deriv) then
+ if M.is_exact(name, deriv) then
upscore(4.5, 'exact match for derived pattern: ' .. deriv)
- elseif is_subword(file, deriv) then
+ elseif is_subword(name, deriv) then
upscore(3.5, 'subword match for derived pattern: ' .. deriv)
end
end
end
-- if extension is bad, score becomes an epsilon
- local ext = texdoc.config.get_value('ext_list')[M.ext_pos(file)]
+ local ext = texdoc.config.get_value('ext_list')[M.ext_pos(name)]
if ext and texdoc.config.get_value('badext_list_inv')[ext] and score > 0 then
upscore(0.1, 'bad extension', true)
end
-- if basename is bad, score becomes an epsilon
- if has_bad_basename(file) and score > 0 then
+ if has_bad_basename(name) and score > 0 then
upscore(0.1, 'bad basename', true)
end
-- bonus for being in the right directory
- if string.find('/' .. file, '/' .. pat .. '/', 1, true) and not slash then
+ if string.find('/' .. name, '/' .. pat .. '/', 1, true) and not slash then
upscore(score + 1.5, 'directory bonus')
end
@@ -146,12 +165,18 @@ local function set_score(df, original_kw)
-- get score from patterns
local score = -10
+ local is_alias = false
for _, pat in ipairs(df.matches) do
local s = -10
local p = string.lower(pat.name)
if pat.original then -- non-alias
- s = df.tree > -1 and heuristic_score(name, p, dbg_score) or 1
+ if df.tree > -1 then
+ s = pattern_score(name, p, dbg_score)
+ else
+ s = 1
+ end
elseif M.is_exact(name, p) then -- alias
+ is_alias = true
local bonus, note = 0, ''
if pat.locale then
bonus, note = 5, ', (language-based)'
@@ -185,6 +210,22 @@ local function set_score(df, original_kw)
end
end
+ -- bonus for locale
+ if not is_alias then
+ local config_lang = texdoc.config.get_value('lang')
+ local file_lang = df.lang
+
+ if not file_lang then
+ _, file_lang, _ = parse(name)
+ file_lang = texdoc.const.lang_codes[file_lang]
+ end
+
+ if config_lang == file_lang then
+ score = score + 1
+ dbg_score('Locale match bonus: +1.0')
+ end
+ end
+
-- adjust from keyword-specific tables
if df.tree > -1 and spec_adjscore[original_kw] then
for pat, val in pairs(spec_adjscore[original_kw]) do
@@ -218,33 +259,29 @@ local function set_list_scores(list, original_kw)
end
end
--- says if file is an exact match for pat
-function M.is_exact(file, pat)
- file = texdoc.util.parse_zip(file)
- local slashes = string.gsub(pat, '[^/]+', '[^/]+')
- basename = string.match(file, slashes .. '$')
- if not basename then return nil end
- if basename == pat then return true end
- for _, ext in ipairs(texdoc.config.get_value('ext_list')) do
- if ext ~= '' and ext ~= '*' and basename == pat .. '.' .. ext then
- return true
- end
+-- says if filename is an exact match for pat
+function M.is_exact(filename, pattern)
+ local f_base, f_lang, f_ext = parse(filename)
+ local p_base, p_lang, p_ext = parse(pattern)
+
+ -- if the pattern contains lang, check if identical
+ if p_lang ~= nil and f_lang ~= p_lang then
+ return false
end
- return false
-end
--- says if file is an exact match for pat and the current locale
-function M.is_exact_locale(file, pat)
- if string.match(pat, '%-%l%l%l?$') then
- -- don't match if the pattern appears to include a language code
+ -- if the pattern contains ext, check if identical
+ if p_ext ~= nil and p_ext ~= '' and f_ext ~= p_ext then
return false
end
- local lang = texdoc.config.get_value('lang')
- if lang then
- return M.is_exact(file, pat .. '-' .. lang)
- or M.is_exact(file, lang .. '-' .. pat)
+
+ -- finally check the bases
+ if (f_base == p_base
+ or (f_base:sub(-#p_base) == p_base
+ and f_base:sub(-#p_base - 1, -#p_base - 1) == '/')) then
+ return true
+ else
+ return false
end
- return false
end
-- compare two docfile's: (see texdoclib-search.tlu for structure)
diff --git a/Master/texmf-dist/scripts/texdoc/texdoclib-search.tlu b/Master/texmf-dist/scripts/texdoc/texdoclib-search.tlu
index af04a2a3eec..b560626b439 100755
--- a/Master/texmf-dist/scripts/texdoc/texdoclib-search.tlu
+++ b/Master/texmf-dist/scripts/texdoc/texdoclib-search.tlu
@@ -39,22 +39,9 @@ end
-- (or known basename according to basename_list)
local function check_ext(file)
file = file:lower()
- -- remove zipext if applicable
- file = texdoc.util.parse_zip(file)
- -- then do the normal thing
- for _, e in ipairs(texdoc.config.get_value('ext_list')) do
- if e == '*' then
- return true
- elseif (e == '') then
- if not file:find('.', 1, true) then
- return true
- end
- else
- local dot_e = '.' .. e
- if file:sub(-#dot_e) == dot_e then
- return true
- end
- end
+ -- has a known extention?
+ if texdoc.util.get_ext(file) ~= nil then
+ return true
end
-- is the basename good?
for _, b in ipairs(texdoc.config.get_value('basename_list')) do
@@ -443,6 +430,33 @@ end
-- tlpdb means TeX Live Package DataBase and tlp means TeX Live Package
+-- return an iterator that ouputs the keys in order
+local function opairs(t)
+ local tkeys = {}
+
+ -- use the counter len to avoid the cost of table.insert and to save the
+ -- length of tkeys for later use in the iterator
+ local len = 0
+ for k, _ in pairs(t) do
+ len = len + 1
+ tkeys[len] = k
+ end
+
+ table.sort(tkeys)
+
+ local i = 0
+ local function iterator()
+ i = i + 1
+ if i > len then
+ return nil
+ else
+ return tkeys[i], t[tkeys[i]]
+ end
+ end
+
+ return iterator
+end
+
-- return true if cache exists and is newer than original, false otherwise
local function good_cache(cache, ori)
local cache_date = lfs.attributes(cache, 'modification')
@@ -556,25 +570,25 @@ print_out_tlpinfo = function(filename)
-- s_meta
printf('local s_meta = {\n')
- for k, v in pairs(s_meta) do
+ for k, v in opairs(s_meta) do
printf(' [%q] = {', k)
- for i, j in pairs(v) do printf('[%q] = %q, ', i, j) end
+ for i, j in opairs(v) do printf('[%q] = %q, ', i, j) end
printf('},\n')
end
printf('}\n')
-- tlp_from_runfile
printf('local tlp_from_runfile = {\n')
- for k, v in pairs(tlp_from_runfile) do
+ for k, v in opairs(tlp_from_runfile) do
printf(' [%q] = {', k)
- for f in pairs(v) do printf('[%q]=true,', f) end
+ for f in opairs(v) do printf('[%q]=true,', f) end
printf('},\n')
end
printf('}\n')
-- tlp_doclist
printf('local tlp_doclist = {\n')
- for k, v in pairs(tlp_doclist) do
+ for k, v in opairs(tlp_doclist) do
printf(' [%q] = {\n', k)
for _, f in ipairs(v) do printf(' %q,\n', f) end
printf(' },\n')
diff --git a/Master/texmf-dist/scripts/texdoc/texdoclib-util.tlu b/Master/texmf-dist/scripts/texdoc/texdoclib-util.tlu
index 81627c823e6..db043b150ee 100755
--- a/Master/texmf-dist/scripts/texdoc/texdoclib-util.tlu
+++ b/Master/texmf-dist/scripts/texdoc/texdoclib-util.tlu
@@ -4,8 +4,8 @@
-- dependencies
local texdoc = {
- const = require('texdoclib-const'),
- config = require('texdoclib-config'),
+ const = require 'texdoclib-const',
+ config = require 'texdoclib-config',
}
-- shortcuts
@@ -103,18 +103,42 @@ end
end -- end scope of active_debugs
--- if file is base .. '.' .. zip with zip in zipext_list, return: base, zip
--- otherwise, return: file, nil
-function M.parse_zip(file)
+-- if filename is base .. '.' .. zip with zip in zipext_list, return: base, zip
+-- otherwise, return: filename, nil
+function M.parse_zip(filename)
local zip
for _, zip in ipairs(texdoc.config.get_value('zipext_list')) do
local l = #zip + 1
- if string.sub(file, -l, -1) == '.' .. zip then
- return string.sub(file, 1, -l - 1), zip
+ if string.sub(filename, -l, -1) == '.' .. zip then
+ return string.sub(filename, 1, -l - 1), zip
end
end
+ return filename, nil
+end
- return file, nil
+-- take a known extension according to ext_list
+function M.get_ext(filename)
+ filename = M.parse_zip(filename)
+
+ for _, e in ipairs(texdoc.config.get_value('ext_list')) do
+ if e == '*' then
+ local dot = filename:find('.', 1, true)
+ if not dot then
+ return ''
+ else
+ return filename:sub(-dot + 1)
+ end
+ elseif (e == '') then
+ if not filename:find('.', 1, true) then
+ return ''
+ end
+ else
+ local dot_e = '.' .. e
+ if filename:sub(-#dot_e) == dot_e then
+ return dot_e:sub(2)
+ end
+ end
+ end
end
-- print a usage message
diff --git a/Master/texmf-dist/scripts/texdoc/texdoclib.tlu b/Master/texmf-dist/scripts/texdoc/texdoclib.tlu
index f7d4f06055e..3c0f66c1d28 100644
--- a/Master/texmf-dist/scripts/texdoc/texdoclib.tlu
+++ b/Master/texmf-dist/scripts/texdoc/texdoclib.tlu
@@ -1,7 +1,7 @@
-- texdoclib.tlu: the texdoc library
--[[
-Copyright 2008-2021 Manuel Pégourié-Gonnard, Takuto Asakura, the TeX Live Team.
+Copyright 2008-2022 Manuel Pégourié-Gonnard, Takuto Asakura, the TeX Live Team.
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
diff --git a/Master/texmf-dist/texdoc/texdoc.cnf b/Master/texmf-dist/texdoc/texdoc.cnf
index b5ad9ecbdbc..d5e7d7afd1f 100644
--- a/Master/texmf-dist/texdoc/texdoc.cnf
+++ b/Master/texmf-dist/texdoc/texdoc.cnf
@@ -84,15 +84,15 @@
# basename_list = readme, 00readme
# badbasename_list = readme, 00readme
+# Known suffixes for documentation
+suffix_list = doc, -doc, _doc, .doc, /doc, manual, /manual, -manual, userguide, /user_guide, -guide, -user, man, -man, notes, -info, ref
+
## Fuzzy search
# Built-in defaults (for reference):
#
# fuzzy_level = 3
-# Known suffixes for documentation
-suffix_list = doc, -doc, _doc, .doc, /doc, manual, /manual, -manual, userguide, /user_guide, -guide, -user, -man, notes, -info, ref
-
# Score adjustments
# =================
@@ -183,6 +183,7 @@ adjscore(beamer) beamer-tut-pt/tutorialbeamer = +10
adjscore(beamer) beamer-FUBerlin = -3
adjscore(beamer) beamer-tut-pt = -10
adjscore(beamer) presentations = -10
+adjscore(beamerarticle) bsp-beamerarticle = -10
# misc
adjscore(context) circuitikz = -10
@@ -384,10 +385,6 @@ alias typearea-de = scrguide
# tugboat package and classes
alias tugboat = ltubguid
-# caption
-alias caption = caption-eng
-alias caption-dev = caption-eng
-
# metapost by various names
alias metapost = mpman
alias(5) metapost = mpgraph
@@ -444,11 +441,13 @@ alias cm-super = cm-super/README
alias cmsuper = cm-super/README
alias(5) cmsuper = cm-super/FAQ
alias croatian = babel
-alias cweb = cwebman # XXX: is in 'cweb' dir, should win
alias cyrillic = cyrillic/README
alias dtk = dtk/doc/beispiel.pdf
alias einfuehrung = einfuehrung/README # tl should get "readme" tag
alias elsarticle = elsdoc
+alias feynmp = fmfman
+alias flowfram = ffuserguide
+alias flowfram-dev = flowfram.pdf
alias(0.1) fontinst = fontinstallationguide
alias hyperref-dev = hyperref.pdf
alias iso = isoman
@@ -499,7 +498,6 @@ alias ofs = ofsdoc-e
alias akletter = akletter/lettereng
alias arydshln = arydshln-man
alias cv = curve/curve
-alias datenumber-de = datenumber/docgerman
alias labels(1) = envlab/elguide
alias expressg = expeg
alias flcards = flashcards