summaryrefslogtreecommitdiff
path: root/support/ctanbib
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-07-01 03:01:47 +0000
committerNorbert Preining <norbert@preining.info>2021-07-01 03:01:47 +0000
commitc840f97520ba98156a0ed525d6b5d05ab6a324f6 (patch)
tree8e6cf79a5019e2dc2811f4a5b032caffb2809226 /support/ctanbib
parent916b6828e77bd92bd88d57bad094c4520f0ad65c (diff)
CTAN sync 202107010301
Diffstat (limited to 'support/ctanbib')
-rwxr-xr-xsupport/ctanbib/ctanbib13
-rw-r--r--support/ctanbib/ctanbib-doc.pdfbin35307 -> 35854 bytes
-rw-r--r--support/ctanbib/ctanbib-doc.tex21
3 files changed, 33 insertions, 1 deletions
diff --git a/support/ctanbib/ctanbib b/support/ctanbib/ctanbib
index f54e1691ca..70b31badba 100755
--- a/support/ctanbib/ctanbib
+++ b/support/ctanbib/ctanbib
@@ -24,6 +24,7 @@ Usage:
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 @@ if args.help then
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,6 +187,14 @@ local ctan_url = function(record, pkgname)
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)
@@ -215,6 +224,8 @@ for _, pkgname in ipairs(args) do
-- 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")
diff --git a/support/ctanbib/ctanbib-doc.pdf b/support/ctanbib/ctanbib-doc.pdf
index 1fb514277c..87296fca78 100644
--- a/support/ctanbib/ctanbib-doc.pdf
+++ b/support/ctanbib/ctanbib-doc.pdf
Binary files differ
diff --git a/support/ctanbib/ctanbib-doc.tex b/support/ctanbib/ctanbib-doc.tex
index c9d2a96abe..fb718635ab 100644
--- a/support/ctanbib/ctanbib-doc.tex
+++ b/support/ctanbib/ctanbib-doc.tex
@@ -38,6 +38,7 @@ The \texttt{curl} utility needs to be installed on the user's system in order to
\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 @@ url = {https://ctan.org/pkg/latex},
}
\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}
+@manual{biblatex,
+...
+url = {/macros/latex/contrib/biblatex},
+...
+}
+\end{verbatim}
+
+
+
\noindent The \texttt{--entrytype} option:
\begin{verbatim}
@@ -115,6 +134,8 @@ it's eventual release on CTAN. Herbert Voss added the \verb|--CTAN| option.
\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}