Skip to content

Instantly share code, notes, and snippets.

@hubgit
Last active March 5, 2021 22:14
Show Gist options
  • Select an option

  • Save hubgit/ece0a56ab97bf02bb39f3eff5641b62b to your computer and use it in GitHub Desktop.

Select an option

Save hubgit/ece0a56ab97bf02bb39f3eff5641b62b to your computer and use it in GitHub Desktop.
brew install texlive jq datasette sqlite-utils
tlmgr dump-tlpdb --remote http://tug.ctan.org/systems/texlive/tlnet/tlpkg/texlive.tlpdb --json | jq '.main.tlpkgs' | sqlite-utils insert texlive.db tlpkgs -
datasette texlive.db
# SELECT category, name, shortdesc, longdesc FROM tlpkgs WHERE category = 'Package' ORDER BY name ASC LIMIT 200
sqlite-utils enable-fts texlive.db tlpkgs name shortdesc
select
snippet(
tlpkgs_fts,
-1,
'b4de2a49c8',
'8c94a2ed4b',
'...',
100
) as snippet,
tlpkgs_fts.rank,
tlpkgs.name,
tlpkgs.shortdesc
from
tlpkgs
join tlpkgs_fts on tlpkgs.rowid = tlpkgs_fts.rowid
where
category = 'Package'
and
tlpkgs_fts match 'ams' || "*"
order by
rank
limit
20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment