In-progress browser for a directory of text files
Go to file
Kartik K. Agaram 2079b5a2b1 Merge driver.love 2024-09-10 21:22:54 -07:00
assets
0000-freewheeling-start
0001-on
0002-Debug_animations_in_progress
0002-vx
0003-refresh_debug_animations
0003-scale
0004-on.update
0004-vy
0005-Cursor_node
0005-animate
0006-loiter
0006-on.mouse_press
0007-on_text mock-up of reply buttons 2023-06-22 18:17:01 -07:00
0007-save_callstack
0008-Debug_animation_period debug animations 2023-11-11 10:00:54 -08:00
0008-Viewport Merge driver.love 2024-06-16 06:47:45 -07:00
0009-on.code_change
0010-initialize_editor
0011-box_height
0012-on.initialize
0013-font
0014-y_of_schema1
0015-line_height
0016-schema1_of_y
0017-on.mouse_release
0018-on.update
0019-B bugfix: initial animation updates font size 2024-07-25 22:23:58 -07:00
0021-compute_layout Merge driver.love 2024-07-25 22:27:21 -07:00
0022-on.text_input
0023-on.keychord_press
0024-copy_shape make order of files consistent with upstream 2023-04-22 18:50:18 -07:00
0025-add_thick_line
0026-on.draw
0027-Surface
0028-A Merge driver.love 2024-07-25 22:27:21 -07:00
0030-update_editor_box Merge driver.love 2024-07-10 01:31:56 -07:00
0031-cols
0032-rows
0033-test_y_of_schema1
0034-dump_state
0035-mouse_cursor
0035-pan_viewport_to_contain_cursor
0036-Mouse_cursor
0037-set_mouse_cursor
0040-Menu_background_color
0041-Menu_border_color
0042-Menu_command_color
0043-Menu_highlight_color
0044-add_hotkey_to_menu
0052-draw_cursor
0061-on.key_release
0062-on.save_settings
0081-draw_menu_bar
0096-iscale
0097-sy
0098-sx
0106-on.load_settings remember directory to browse across restart 2023-10-20 00:10:07 -07:00
0110-Border_color
0110-on.mouse_wheel_move
0111-Files
0112-Global_state
0113-draw_surface
0117-open_thread
0118-load_subtree
0119-load_metadata
0120-initialize_item
0121-draw_debug
0121-full_path
0122-Show_debug spawning tries 10 times to avoid overlap 2023-11-26 22:55:54 -08:00
0122-metadata_file
0124-Indent
0125-Width
0127-Inter_comment_spacing
0128-reset_viewport
0129-initialize_file_picker
0130-lay_out_file_picker
0131-File_picker_margin
0132-in_rect
0132-on.resize
0133-Reply_button_border_color
0134-Reply_button_color
0135-on_button
0136-update_all_editors start saving changes 2023-06-22 18:18:02 -07:00
0137-quit_all_editors
0138-on.quit
0139-new_comment
0141-indent
0142-reply_button
0143-find_node
0144-new_comment_id
0145-save_metadata
0146-find_comment_index
0147-Viewport_bounds
0148-compute_viewport_bounds
0149-Random_string_chars
0150-random_string
0151-comment_path more conflict-resistant comment storage 2023-07-16 13:45:30 -07:00
0152-Data_dir
LICENSE.txt
Manual_tests.md Merge luaML.love 2023-12-07 01:28:07 -08:00
MemoryReferenceInfo.lua.0 remove some memory leaks from rendered fragments 2022-06-10 11:16:41 -07:00
MemoryReferenceInfo.lua.unused
README.md Merge text.love 2024-09-08 22:56:52 -07:00
app.lua
button.lua
default_map
edit.lua Merge driver.love 2024-09-10 21:22:54 -07:00
file.lua
json.lua
keychord.lua
live.lua Merge driver.love 2024-07-09 23:05:14 -07:00
main.lua Merge driver.love 2024-09-10 21:22:54 -07:00
nativefs.lua
reference.md
search.lua
select.lua Merge lines.love 2024-09-01 01:17:22 -07:00
test.lua
text.lua Merge driver.love 2024-09-01 02:05:43 -07:00
text_tests
text_tests.lua
undo.lua Merge lines.love 2024-09-01 01:17:22 -07:00

README.md

In progress. Browse a directory of articles like Kragen Sitaker's dercuano.

0 dependencies!

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', often a loose-bound collection of palm leaf manuscripts.

This repo is an example of a Freewheeling App, designed above all to be easy to run, easy to modify and easy to share.

Getting started

Install LÖVE. It's just a 5MB download, open-source and extremely well-behaved.

To run from the terminal, pass this directory to LÖVE, optionally with a directory to browse.

Terminal invocation

You can run this app from the terminal just like any other LÖVE app. 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:

love pothi.love

Further suppose you loaded some articles as follows:

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:

love pothi.love pavnotes2

Hacking

To modify it live without restarting the app each time, download the driver app. Here's an example session using a different app:

making changes without restarting the app

Some reference documentation on how to create your own apps.

If the app being modified by the driver lives in a .love file, your changes will go into the save directory. 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, an editor for plain text where you can also seamlessly insert line drawings. Its immediate upstream is text.love, a version without support for line drawings. Updates to it can be downloaded from the following mirrors:

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

Feedback

Most appreciated. Messages, PRs, patches, forks, it's all good.