In-progress browser for a directory of text files
In progress. Browse a directory of articles like [Kragen Sitaker's dercuano]https://gitlab.com/kragen/dercuano.

[![0 dependencies!]https://0dependencies.dev/0dependencies.svg]https://0dependencies.dev

My tentative goal is to be able to post comments on articles, send updates
around using git, and browse comments from all commenters in line with
articles. It's unclear whether it will be economical to support editing
articles. My priority is a commenting experience rather than a CMS for the
author(s) of articles.

Status: you can edit articles and reply to them. There isn't any metadata for
author or timestamp yet, so it's up to you to add them in the comment body.
You're also on your own to commit the changes to git and publish them
somewhere others can get to them.

_The name_: 'pothi' is [Sanskrit for 'book']https://en.wiktionary.org/wiki/%E0%A4%AA%E0%A5%8B%E0%A4%A5%E0%A5%80,
often [a loose-bound collection of palm leaf manuscripts]https://en.wikipedia.org/wiki/Palm-leaf_manuscript.

This repo is an example of a [Freewheeling App]http://akkartik.name/freewheeling,
designed above all to be easy to run, easy to modify and easy to share.

## Getting started

Install [LÖVE]https://love2d.org. It's just a 5MB download, open-source and
extremely well-behaved.

To run from the terminal, [pass this directory to LÖVE]https://love2d.org/wiki/Getting_Started#Running_Games,
optionally with a directory to browse.

## Terminal invocation

You can run this app from the terminal [just like any other LÖVE app]https://love2d.org/wiki/Getting_Started#Running_Games.
This ability is particularly useful if you would like to maintain multiple
directories of articles and switch between them.

To load any other directories besides `data/`, run the app from a terminal and
provide the name of the directory in the command.

As a concrete example, suppose you've set things up so you can run the app
from the terminal by running:
  ```shell
  love pothi.love
  ```

Further suppose you loaded some articles as follows:

  ```shell
  cd ~/.local/share/love/pothi
  git clone http://canonical.org/~kragen/sw/pavnotes2.git   # no directory name provided
  # articles now saved to a directory called pavnotes2
  mkdir pavnotes2/comments
  ```

To now browse these articles, you'd run:

  ```shell
  love pothi.love pavnotes2
  ```

## Hacking

To modify it live without restarting the app each time, download [the driver
app](https://git.sr.ht/~akkartik/driver.love). Here's an example session using
a different app:

![making changes without restarting the app]assets/2.gif

[Some reference documentation on how to create your own apps.]reference.md

If the app being modified by the driver lives in a .love file, your changes
will go into the [save directory]https://love2d.org/wiki/love.filesystem.getSaveDirectory.
If it lives in a directory (like this repo), your changes will go straight
into the same directory.

## Keyboard shortcuts

While reading a single file:

* `ctrl+o` to switch to a different file
* `ctrl+f` to search for strings
* `ctrl+=` to zoom in, `ctrl+-` to zoom out, `ctrl+0` to reset zoom
* mouse drag or `shift` + movement to select text, `ctrl+a` to select all

* mouse drag and arrow keys pan the surface
* `shift`+arrow keys pan faster
  - `pagedown` and `pageup` are aliases for `shift+down` and `shift+up` respectively

Exclusively tested so far with a US keyboard layout. If
you use a different layout, please let me know if things worked, or if you
found anything amiss: http://akkartik.name/contact

## Known issues

* No support yet for Unicode graphemes spanning multiple codepoints.

* No support yet for right-to-left languages.

* Can't scroll while selecting text with mouse.

* No scrollbars yet. That stuff is hard.

## Mirrors and Forks

This repo is a fork of [lines.love]http://akkartik.name/lines.html, an
editor for plain text where you can also seamlessly insert line drawings.
Its immediate upstream is [text.love]https://git.sr.ht/~akkartik/text.love,
a version without support for line drawings. Updates to it can be downloaded
from the following mirrors:

* https://git.sr.ht/~akkartik/pothi.love
* https://tildegit.org/akkartik/pothi.love
* https://git.merveilles.town/akkartik/driver.love
* https://nest.pijul.com/akkartik/pothi.love (using the Pijul version control system)

Further forks are encouraged. If you show me your fork, I'll link to it here.

## Feedback

[Most appreciated.]http://akkartik.name/contact Messages, PRs, patches,
forks, it's all good.