summaryrefslogtreecommitdiff
path: root/README.org
blob: a2b1b71fce82561bdd19fda4c4733620f3000a06 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
This is a CLI web/gopher/file browser inspired by [[https://en.wikipedia.org/wiki/Line_Mode_Browser][Line Mode Browser]].

It combines [[http://pandoc.org/][pandoc]] with external downloaders such as [[https://curl.haxx.se/][curl]], adding
support for Gopher directories and plaintext files, and invoking
external applications (e.g., image and PDF viewers) depending on its
configuration.

User interaction capabilities are rather basic, as it is intended to
be combined with software that provides better user interfaces -- such
as emacs, rlwrap, tmux, screen.

* Installation

Use ~cabal install~ to install pancake, ~M-x package-install-file RET
/path/to/pancake.el RET~ to install its emacs interface. To set it as
your default emacs browser:

#+BEGIN_SRC elisp
(require 'pancake)
(setq browse-url-browser-function 'pancake-browse-url)
#+END_SRC

* Commands

- [q]uit, [b]ack, [f]orward, [h]elp, [r]eload, [re]load config
- <number>: follow a link (or open the referenced file)
- <number>?: show link/image URI
- ?: show current URI
- RET (empty): show the next 2/3 of a page, if pagination is enabled
- <URI>: follow an URI, possibly relative to the current one
- <shortcut> <query>: run a query using a shortcut defined in the
  configuration (e.g., search)

pancake-mode provides additional aliases, see built-in emacs
documentation (~C-h m~) for those.

* Sample configuration

#+BEGIN_SRC yaml
externalViewers:
  png: xdg-open "${FILE}"
  hs: emacsclient -n "${FILE}"
commands:
  gopher: torify curl "${URI}"
  ssh: scp "${URI_REGNAME}:${URI_PATH}" /dev/stdout
defaultCommand: curl -4 -L "${URI}"
shortcuts:
  ddg: https://duckduckgo.com/lite/?q=
  wt: https://en.m.wiktionary.org/w/index.php?search=
  wp: https://en.m.wikipedia.org/wiki/Special:Search?search=
  gp: gopher://gopherpedia.com:70/7/lookup?
  vs: gopher://gopher.floodgap.com/7/v2/vs?
historyDepth: 100
paginate: true
#+END_SRC

* Excluded features

- Usage of content types reported by network protocols: HTTP content
  types are ignored, Gopher item types are used only loosely and
  indirectly, and pancake mostly relies on URIs for format detection.
  Usually it works, but can be improved -- though that would slightly
  complicate both the configuration and the codebase, which may be not
  worth it.
- Semantic markup for embedding: it might be useful to provide
  semantic markup to ~pancake-mode~ (and for embedding in general) in
  order to e.g. buttonize links (and embed images, perhaps), but it's
  tricky to draw a line between that and just serializing pandoc
  structures, skipping the rendering altogether. Simplicity would
  suffer, too.

* Screenshots

[[https://defanor.uberspace.net/projects/pancake/gopher.png]]

[[https://defanor.uberspace.net/projects/pancake/web-gnu.png]]

[[https://defanor.uberspace.net/projects/pancake/emacs.png]]