Skip to content
/ hop Public

bzg/hop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hop! Org Parser

https://img.shields.io/badge/versioning-intver.org-blue.svg?style=for-the-badge

(\___/)
(='.'=)
(")_(")

Hop! Org Parser – quickly and easily render and export Org files to MD, HTML, Org, JSON, EDN, YAML and ICS.

Built on organ, a Clojure Org parser.

Usage

hop notes.org                               # AST as JSON, contents rendered as Markdown
hop -f html notes.org                       # Export as HTML
hop -f md notes.org                         # Export as Markdown
hop -f org notes.org                        # Export as Org (unwrapped)
hop -f edn notes.org                        # Export as EDN
hop -f yaml notes.org                       # Export as YAML
hop -f ics notes.org                        # Export scheduled (VEVENT) and deadline (VTODO) items as ICS
hop -f ics-anon notes.org                   # Scheduled items only, anonymised as "Busy" free/busy blocks

Render the AST content in a different format:

hop -r html notes.org                       # AST as JSON with HTML-rendered contents
hop -r org notes.org                        # AST as JSON with Org-rendered contents

Filters:

hop -l 2 notes.org                          # Headlines with level <= 2
hop -L 2 notes.org                          # Same, deeper headings rendered as bold
hop -t "TODO" notes.org                     # Title matches regex
hop -T "Projects" notes.org                 # Any ancestor title matches regex
hop -i "section[0-9]+" notes.org            # ID or CUSTOM_ID matches regex
hop -I "chapter\d+" notes.org               # Any ancestor ID matches regex

HTML export with CSS themes:

hop -c https://example.com/style.css -f html notes.org  # Use a remote CSS URL
hop -c file:///path/to/style.css -f html notes.org      # Inline a local file via file:// URL
hop -c custom.css -f html notes.org                     # Inline a local .css file
hop -c ../styles/theme.css -f html notes.org            # Inline via relative path
hop -c /home/user/theme.css -f html notes.org           # Inline via absolute path
hop -c org -f html notes.org                            # Use "org" pico-theme from CDN

ICS export options (ics and ics-anon):

  • -w/--weeks # weeks ahead to scan (unbounded unless set)
  • -R/--reference-date # window start date, YYYY-MM-DD (today when only -w is set)
  • -d/--default-duration # minutes for events with no end time (only added when set)
  • -z/--time-zone # timezone anchoring the Org timestamps (default: system timezone)
  • -a/--all-day # also emit all-day entries (excluded by default; see below for ics-anon)

For ics and ics-anon, DEADLINE timestamps are due dates (i.e. VTODO): they never count as “busy”, since a due date reserves no time. SCHEDULED timestamps are VEVENT, anonymised as “Busy” blocks by ics-anon. When a SCHEDULED entry has a date but no time of day, ics-anon admits it as an all-day busy entry only with the -a (--all-day) option, and only when its heading bears no TODO keyword.

Both formats emit UTC datetimes, anchored in the -z timezone.

TODO keywords come from #+TODO:-style directives in the file (Org’s TODO=/=DONE defaults otherwise), plus any -D extras.

Other export options:

hop -D CANX,CANCELED notes.org              # Extra DONE keywords, comma-separated
hop -k notes.org                            # Keep DONE subtrees (stripped by default)
hop -b https://base.io -f html index.org    # Prepend base URL to relative links
hop -n notes.org                            # Preserve original line breaks

Statistics:

hop -s notes.org                            # Display document statistics

Check hop --help for all options.

Install

Assuming bbin is installed:

bbin install io.github.bzg/hop

Requirements

hop is a Clojure Babashka script.

brew install babashka/brew/bbin

Development

To run hop directly from the source without installing via bbin:

~$ bb -m bzg.hop -f md notes.org

Test

~$ bb test:generate
~$ bb test

Contributing

You can also send me an email and support my work on liberapay.

Intentional Versioning

This project uses Intentional Versioning, here are the three audiences:

  • Users : end users who use hop
  • Integrators : external packagers
  • Maintainers : maintainers to the codebase

Support the Clojure(script) ecosystem

If you like Clojure(script), please consider supporting maintainers by donating to clojuriststogether.org.

License

Copyright © 2026 Bastien Guerry

Distributed under the Eclipse Public License 2.0.

About

Hush Org Parser

Resources

Stars

Watchers

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages