texlive[59782] trunk: ctanbib (30jun21)
commits+karl at tug.org
commits+karl at tug.org
Wed Jun 30 23:19:31 CEST 2021
Revision: 59782
http://tug.org/svn/texlive?view=revision&revision=59782
Author: karl
Date: 2021-06-30 23:19:31 +0200 (Wed, 30 Jun 2021)
Log Message:
-----------
ctanbib (30jun21)
Modified Paths:
--------------
trunk/Build/source/texk/texlive/linked_scripts/ctanbib/ctanbib
trunk/Master/texmf-dist/doc/man/man1/ctanbib.man1.pdf
trunk/Master/texmf-dist/doc/support/ctanbib/ctanbib-doc.pdf
trunk/Master/texmf-dist/doc/support/ctanbib/ctanbib-doc.tex
trunk/Master/texmf-dist/scripts/ctanbib/ctanbib
Modified: trunk/Build/source/texk/texlive/linked_scripts/ctanbib/ctanbib
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/ctanbib/ctanbib 2021-06-30 21:19:11 UTC (rev 59781)
+++ trunk/Build/source/texk/texlive/linked_scripts/ctanbib/ctanbib 2021-06-30 21:19:31 UTC (rev 59782)
@@ -24,6 +24,7 @@
ctanbib [options] name1 name2 ...
Available options:
-c,--ctan Use CTAN URL instead of the package homepage
+ -C,--ctanpath Use package's CTAN path as URL
-e,--entrytype (default manual) Change entry type
-h,--help Print this message
-v,--version Print version info
@@ -33,7 +34,7 @@
print(msg)
os.exit(0)
elseif args.version then
- print "ctanbib version 0.2"
+ print "ctanbib version 0.2a"
os.exit(0)
elseif args.ctan then
pkgurl = true
@@ -186,7 +187,15 @@
return "https://ctan.org/pkg/"..pkgname
end
+local ctan_path = function(record)
+ local ctan = record:query_selector("ctan")[1]
+ -- some package don't contain the CTAN path
+ if not ctan then return get_url(record) end
+ local path = ctan:get_attribute("path")
+ return path
+end
+
local compile = function(template, records)
return template:gsub("$([a-z]+)", function(a)
return records[a] or ""
@@ -215,6 +224,8 @@
-- use the CTAN path as url for the CTAN type
if pkgurl then
e.url = ctan_url(record, pkgname)
+ elseif args.ctanpath then
+ e.url = ctan_path(record)
end
e.version, e.date = get_version(record)
e.urldate = os.date("%Y-%m-%d")
Modified: trunk/Master/texmf-dist/doc/man/man1/ctanbib.man1.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/support/ctanbib/ctanbib-doc.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/support/ctanbib/ctanbib-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/support/ctanbib/ctanbib-doc.tex 2021-06-30 21:19:11 UTC (rev 59781)
+++ trunk/Master/texmf-dist/doc/support/ctanbib/ctanbib-doc.tex 2021-06-30 21:19:31 UTC (rev 59782)
@@ -38,6 +38,7 @@
\begin{description}
\item[-c,-\/-ctan] use the CTAN package entry as package URL instead of URL provided by the package.
+ \item[-C,-\/-ctanpath] use package's CTAN path as URL
\item[-e,-\/-entrypoint] explicitly set the Bib\TeX\ entry type.
\item[-h,-\/-help] print the help message.
\item[-v,-\/-version] print the version info.
@@ -84,6 +85,24 @@
}
\end{verbatim}
+\noindent The \texttt{--ctanpath} option:
+
+\begin{verbatim}
+ctanbib -C biblatex
+\end{verbatim}
+
+\noindent This produces a bib record that uses the CTAN package tree location for the URL.
+
+\begin{verbatim}
+ at manual{biblatex,
+...
+url = {/macros/latex/contrib/biblatex},
+...
+}
+\end{verbatim}
+
+
+
\noindent The \texttt{--entrytype} option:
\begin{verbatim}
@@ -115,6 +134,8 @@
\section{Changelog}
\begin{changelog}
+ \change{2021-06-29}{Version 0.2a released}
+ \change{2021-06-29}{Added the \verb|--ctanpath| option.}
\change{2021-06-26}{Version 0.2 released}
\change{2021-06-26}{Removed the \verb|--CTAN| option, entry type can be set using \verb|--entrytype| and CTAN URL is requested using \verb|--ctan|}
\change{2021-06-26}{Added \verb|--entrytype| option for explicit specification of the Bib\TeX\ entry type}
Modified: trunk/Master/texmf-dist/scripts/ctanbib/ctanbib
===================================================================
--- trunk/Master/texmf-dist/scripts/ctanbib/ctanbib 2021-06-30 21:19:11 UTC (rev 59781)
+++ trunk/Master/texmf-dist/scripts/ctanbib/ctanbib 2021-06-30 21:19:31 UTC (rev 59782)
@@ -24,6 +24,7 @@
ctanbib [options] name1 name2 ...
Available options:
-c,--ctan Use CTAN URL instead of the package homepage
+ -C,--ctanpath Use package's CTAN path as URL
-e,--entrytype (default manual) Change entry type
-h,--help Print this message
-v,--version Print version info
@@ -33,7 +34,7 @@
print(msg)
os.exit(0)
elseif args.version then
- print "ctanbib version 0.2"
+ print "ctanbib version 0.2a"
os.exit(0)
elseif args.ctan then
pkgurl = true
@@ -186,7 +187,15 @@
return "https://ctan.org/pkg/"..pkgname
end
+local ctan_path = function(record)
+ local ctan = record:query_selector("ctan")[1]
+ -- some package don't contain the CTAN path
+ if not ctan then return get_url(record) end
+ local path = ctan:get_attribute("path")
+ return path
+end
+
local compile = function(template, records)
return template:gsub("$([a-z]+)", function(a)
return records[a] or ""
@@ -215,6 +224,8 @@
-- use the CTAN path as url for the CTAN type
if pkgurl then
e.url = ctan_url(record, pkgname)
+ elseif args.ctanpath then
+ e.url = ctan_path(record)
end
e.version, e.date = get_version(record)
e.urldate = os.date("%Y-%m-%d")
More information about the tex-live-commits
mailing list.