No description
Find a file
2024-11-21 12:30:03 +00:00
example.txt Add styling 2024-11-21 12:30:03 +00:00
indent2treeview.hs Add styling 2024-11-21 12:30:03 +00:00
README.md Add styling 2024-11-21 12:30:03 +00:00
style.css Add styling 2024-11-21 12:30:03 +00:00

indent2treeview

Generate an HTML tree view from an indented list. Uses the <details> element and no JavaScript.

Usage: indent2treeview [<delimiter>] < input

Default delimiter is a single space.

add styling

With some magical CSS, we can get a visually pleasing result: echo '<!doctype html>' $(./indent2treeview < myfile.txt) "<style>" $(<style.css) "</style>"

Example

A
 B
 C
  D
   E
 F
G
 I
H
J

becomes

  • A
    • B
    • C
      • D
        • E
    • F
  • G
    • I
  • H
  • J