8000 build local index with optional local colophon by pressdarling · Pull Request #22 · simonw/tools · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

build local index with optional local colophon #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pressdarling
Copy link

This is a replacement for #21

Most of what's below the h1 is written by Claude 3.7 Sonnet, but here's the high-level by a human:

  1. Added the build_local_index.py: This script generates a local index.html page to allow simple local browsing. The script takes the existing build_colophon.py as a starting point, incorporates a part of gather_links.pyin case the purpose of that file changes, and can easily be run with inline dependencies (e.g.uv run --no-project ./build_local_index.py`). This is the core of the PR.
  2. The generated index page contains a full list of HTML tools in the directory with descriptions from their respective .docs.md files, with default alphabetical and optional last-modified sorting, a keyboard-accessible search bar to filter tools by any text in their name or description (/ to focus, to dismiss), and a scroll-to-top button.
  3. Updated README.md: Added a new section "Local Browsing" with instructions on how to browse tools locally without setting up a server. This includes commands to install dependencies, build the local index, and descriptions of the local index features.Updated README.md to mention this
  4. Added a local build option to * build_colophon.py: the build_colophon function now accepts a local_mode parameter, allowing for the generation of local file links. The [get_most_recent_date function](https://github.com/simonw/tools/pull/22/files#diff-19dd6a2ec16d1d36630576b40b9674ece335d7f6bd49aa0b89c8ab463c79ee45R162-R164) has also been modified to handle local file references when local_mode` is enabled.

It's not quite a Perfect Commit™ but I'm not a perfect developer :)

The tool index should be fully keyboard-accessible, with a search bar for filtering. The design is suitable for mobile although I haven't got it working on my phone.

Some things that were considered but dropped include categories, a table of contents (search/full list seems more usable), additional optimisations (dark mode, debounce for search), and including Python tools in the listing. Of course, this is your repo, so I completely understand if you don't want any of this - I found it useful to have a neat way to browse the list, with some neat learning bonuses. I've also spotted the new side-panel-dialog.html which looks like it handles the card layout much better than the options I was playing wth in the other PR.

Claude transcript available on request although it's a branchy mess. Speaking of, over to our artificially intelligent friend for the details...

Add local browsing capability without server deployment

This PR adds a simple script that generates an index.html file for browsing
Simon's tools collection locally without needing to set up GitHub Pages or
any other server.

What this adds

  • A standalone Python script that creates a searchable index of all tools
  • README instructions for local browsing
  • No changes to existing functionality

How it works

The script:

  1. Gathers information about HTML files and their commit history
  2. Extracts descriptions from .docs.md files
  3. Builds an interactive index page with search and sorting

How to test

  1. Run: uv run --no-project --with markdown ./build_local_index.py (or pip install markdown && python build_local_index.py)
  2. Open index.html in your browser
  3. Check that:
    • All HTML tools are listed with descriptions when available
    • Search works for both tool names and content
    • Sorting by name and date functions correctly
    • All tools can be opened directly from the index
    • The UI is responsive on different screen sizes

@pressdarling pressdarling force-pushed the build-local-index branch 9 times, most recently from e8a2a6c to fa3a637 Compare March 20, 2025 04:34
@pressdarling pressdarling force-pushed the build-local-index branch 4 times, most recently from 20c49b1 to ca350cd Compare March 29, 2025 03:08
@pressdarling pressdarling force-pushed the build-local-index branch 2 times, most recently from c2d8b6e to d2663f2 Compare April 19, 2025 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0