Manuel de la commande « ctan »

Synopsis

ctan [type:name] <terme de recherche>

Description

Rechercher sur le CTAN (Comprehensive TeX Archive Network).

Les types de recherche suivants sont disponibles :
- name : chercher un paquet par son nom ;
- file : cherche un fichier par son nom ;
- doc : chercher dans la documentation ;
- desc : chercher un paquet par sa description.

Statistiques

Nombre d'exécutions pour les 10 derniers jours

Code lua

-- ctan command for escaline
--
-- Use cases:
-- rawstring='ctan xargs'               args={'xargs'}
-- rawstring='ctan type:doc xargs.sty'  args={type='doc', 'xargs'}
-- rawstring='ctan type:file xargs.sty' args={type='file', 'xargs'}
-- rawstring='ctan type:desc xargs.sty' args={type='desc', 'xargs'}

local base = 'http://tug.ctan.org/cgi-bin/'
local cat_script = {
    name    = 'ctanPackageInformation.py?id=',
    doc     = 'searchFullText.py?fullTextSearch=',
    file    = 'filenameSearch.py?filename=',
    desc    = 'search.py?metadataSearch=',
}

-- no argument
if args[1] == nil then
    escaline.return_url('http://ctan.org/search.html')
end

-- argument
local cat = args.type or 'name'
local script = cat_script[cat]
if script then
    escaline.return_url(base..script..args[1])
else
    escaline.return_error('Unkown type: '..cat)
end

Contributeur

mpg