Skip to content

cottrell/hashdown

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hashdown

Share rendered content in a single URL. Paste markdown or HTML, put it in the URL hash, and anyone with the link sees it rendered in their browser.

Nothing is stored server-side. The hash fragment (#...) is never sent to GitHub Pages — content is decoded and rendered entirely client-side.

Use case

You need to submit one URL (e.g. an application form) but want the recipient to see a list of links or short notes. Encode the content in the hash and share a single link like:

https://<user>.github.io/hashdown/markdown/#This%20is%20my%20markdown%20content%0A%0A-%20Link%201%3A%20https%3A%2F%2Fexample.com

Pages

Path Purpose
/ Composer — paste content, generate a link
/markdown/ Render hash content as markdown
/html/ Render hash content as raw HTML

Encoding

  • URL-encoded (default) — readable in the address bar
  • Base64 — prefix #b64:..., slightly more compact for longer text

Local development

make test     # run unit tests
make start    # background server, reachable on LAN
make stop     # stop background server
make restart  # stop then start
make serve    # foreground server (Ctrl+C to stop)

Tests

Simple Node unit tests for js/encode.js (round-trip encoding, Unicode, Firefox hash handling, invalid base64):

make test
# or: node --test tests/*.test.js

No npm dependencies — uses the built-in node:test runner.

  • Local: http://localhost:8765/
  • LAN v4: http://<your-ipv4>:8765/ (shown by make start)
  • LAN v6: http://[<your-ipv6>]:8765/ (if your network uses IPv6)

The dev server binds to :: by default (all interfaces, IPv4 + IPv6 on Linux). Override if needed:

make start HOST=0.0.0.0   # IPv4 only
make start HOST=127.0.0.1  # local machine only (no LAN)

Ensure your firewall allows inbound TCP on port 8765 if LAN devices cannot connect.

Deployment (GitHub Pages)

This is a static site with no build step. Deploy by pushing main to GitHub and enabling Pages.

One-time setup

  1. Create a GitHub repo. Common choices:

    • hashdown → site at https://<user>.github.io/hashdown/
    • <user>.github.io → site at https://<user>.github.io/ (repo root must be the site files)
  2. Add the remote and push:

    git remote add origin git@github.com:<user>/hashdown.git
    git push -u origin main
  3. In the repo on GitHub: Settings → Pages

    • Source: Deploy from a branch
    • Branch: main
    • Folder: / (root)
    • Save
  4. Wait a minute or two. The site URL appears on the same Settings page.

Day-to-day deploy

make deploy

That pushes main. GitHub Pages rebuilds automatically on each push to the configured branch.

Branch notes

  • Branch: main (not gh-pages — no separate deploy branch is needed)
  • Folder: repository root (/)
  • No build artifacts, no Jekyll config required

To confirm deploy status: repo Actions tab (if enabled) or Settings → Pages for the live URL and last deployment time.

Limits

  • URL length: ~2 KB is safe everywhere; modern browsers tolerate much longer URLs

About

Render markdown or HTML from a URL hash — share link lists as a single link

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors