On 4/5/2018 1:28 AM, Henri Menke wrote:
On Thu, 2018-04-05 at 01:18 +0200, Hans Hagen wrote:
On 4/5/2018 12:43 AM, Henri Menke wrote:

Dear list,

I'm sure you aware of the very useful "texdoc" command line utility in TeX
live
which brings up the PDF documentation for packages.  ConTeXt standalone also
comes with documentation in

      /opt/context/tex/texmf-context/doc/context

However, I find it tedious to always search for the correct subfolder to get
to
the document I need.  It would be great if there was something like

      mtxrun --script doc metafun

which would open the MetaFun manual.  Similarly "mtxrun --script doc
gnuplot"
would open the manual of the gnuplot module, etc.
this is one of these magic features that suddenly is available on your
system

mtxrun --launch metafun*.pdf
mtxrun --launch cld-mkiv.pdf
mtxrun --all --launch "*-mkiv.pdf"

Hm, that requires that I know enough about the name of the document.  A list
would be quite nice in the sense that I could just type "metafun" and then
select from "metafun-p.pdf" and "metafun-s.pdf" instead of opening both
documents.


features like that have always been present in the context suite of
programs (i bet even before texdoc) but it might be that i don't call
the right thing on todays linux:

local launchers={
    windows="start %s",
    macosx="open %s",
    unix="$BROWSER %s &> /dev/null &",
}

I'm quite sure it should be xdg-open (or $PDFVIEWER if it is set and the file is
PDF) on Linux.  For me $BROWSER is unset.
https://linux.die.net/man/1/xdg-open

can you check that in mtxrun?

btw, context itself provides --autopdf which is handy when you run from an editor

$ mtxrun --launch metafun*.pdf
resolvers       | resolving | forcing filetype 'tex'
resolvers       | resolving | checking wildcard 'metafun*.pdf'
resolvers       | methods | resolving, method 'concatinators', how 'tag', tag
'file'
resolvers       | methods | resolving, method 'concatinators', how 'tag', tag
'file'
mtxrun          | launching /opt/context/tex/texmf-
context/doc/context/documents/general/manuals/metafun-p.pdf
sh: 1: /opt/context/tex/texmf-
context/doc/context/documents/general/manuals/metafun-p.pdf: Permission denied

there's also

mtxrun --edit kpse:cld-mkiv.tex

we can of course extend this feature with some listing but then i'd
rather consult the descriptive files xml but i'm not sure if i
distribute them yet
btw, there are all kind of gimmicks like

mtxrun --script grep doifelse /data/context/**.mkiv

which works with lua patterns and

mtxrun --script fcd --scan /data
mtxrun --script fcd mkiv

for fast directory switching (which i use a lot)

Hans

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
       tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to