frogmouth

repository·main·Indexed 25 days ago

https://github.com/textualize/frogmouth

A terminal-based Markdown document viewer and browser built with the Textual framework. It supports browsing local Markdown files and remote GitHub repositories, featuring a navigation stack, history, bookmarks, a table of contents, and light/dark mode themes. Compatible with Linux, macOS, and Windows using Python 3.8+.

Tokens
1.1K
Snippets
1
Records
13
Agent score
84%

What's inside frogmouth

  1. Run Frogmouth

    main
    To start the application, run the frogmouth command. You can optionally provide a path to a local Markdown file to open it immediately. Navigation is supported via both mouse and keyboard (use <kbd>tab</kbd> and <kbd>shift</kbd>+<kbd>tab</kbd>` to cycle through controls).
  2. Load Markdown files from GitHub

    main

    Frogmouth allows you to load README files directly from GitHub repositories using the gh command syntax. This can be used via the CLI or typed directly into the app's address bar.

    frogmouth gh textualize/textual
  3. Use the Main screen to visit locations

    main

    The Main screen class provides a visit method to navigate to different resources. It intelligently handles different types of input:

    • Markdown files/URLs: If the location is identified as Markdown (via maybe_markdown), it is loaded into the Viewer widget.
    • Existing local Paths: If the location is a Path that exists but is not Markdown, the application attempts to open it using the operating system's default handler.
    • Non-existent local Paths: If a Path is provided but does not exist, an ErrorDialog is displayed.
    • Other URLs: If the location is a URL that does not appear to be Markdown, the application hands it off to the operating system to open in a web browser.
  4. Add a bookmark for the current location

    main
    You can programmatically add a bookmark for the currently viewed file using action_bookmark_this(). This method triggers an InputDialog to allow the user to specify a title for the bookmark. The bookmark is then added to the Navigation pane's bookmarks collection.
  5. Main screen keyboard bindings

    main

    The Main screen uses the following keyboard bindings for navigation and application control:

    KeyActionDescription
    / , :omniboxOpen the Omnibox (hidden by default)
    ctrl+bbookmarksOpen Bookmarks pane
    ctrl+dbookmark_thisBookmark the current location
    ctrl+llocal_filesOpen Local Files pane
    ctrl+leftbackwardGo backward in history
    ctrl+rightforwardGo forward in history
    ctrl+rreloadReload the current document
    ctrl+ttable_of_contentsShow Table of Contents
    ctrl+yhistoryOpen History pane
    escapeescapeExit app or clear/focus Omnibox
    f1helpShow Help dialog
    f2aboutShow About dialog
    ctrl+nnavigationToggle Navigation sidebar
    ctrl+qapp.quitQuit the application
    f10toggle_themeToggle light/dark mode
  6. Run Frogmouth via the CLI

    main

    Frogmouth is a Markdown viewer for the terminal. You can run it by passing the path to a Markdown file as a positional argument. If no file is provided, the application starts without a specific file loaded.

    Arguments:

    • file: The Markdown file(s) to view. Supports multiple files via nargs="*".

    Flags:

    • -v, --version: Show version information (including the version of the underlying textual library).