- Racket 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| protocols | ||
| renderers | ||
| transports | ||
| .gitignore | ||
| bookmarks-edit.rkt | ||
| build.rkt | ||
| CHANGELOG.md | ||
| config.rkt | ||
| fafi.gif | ||
| history.rkt | ||
| info.rkt | ||
| LICENSE | ||
| main.rkt | ||
| multi-renderer.rkt | ||
| multi-transport.rkt | ||
| persist.rkt | ||
| preferences.rkt | ||
| README.md | ||
| styles.rkt | ||
| TODO.md | ||
| utils.rkt | ||
| window.rkt | ||
Fafi Browser
Fafi is a Small Internet browser written in Racket. It is early days for this code base and there is much work to be done. At the moment it is a bit less than an MVP, don't get me wrong, it is viable it is just less than the minimal set of features needed. This begun as just an experiment to calm me during my free hours, now I want to make it into a real small internet browser.
Protocols supported
Gemini Protocol
Gemini is a new protocol that is simple to implement and focused on privacy and low-resource usage. It is somewhere between gopher and the web. You can learn more about it in gemini.circumlunar.space — this is a proxy link
Text Protocol
Text protocol is a bit odd. It looks like Mercury protocol to me, but I'm not sure. Anyway, Fafi can load text:// links. It reuses the Gemini renderer to display the text/plain content from text:// URLs since Gemtext appears to be a superset of that format.
Renderers
Fafi can render the following mime types:
text/gemini--> uses the Gemini Renderer.text/plain--> uses either the Gemini Renderer or the Markdown renderer depending on the URL schema.text/markdown--> uses the Markdown Renderer.image/*--> for a limitted set of*, basically anything the Racket image class can render (safe for JPEG and PNG at least).application/rss+xml--> uses the Feed rendererapplication/atom+xml--> uses the Feed rendererapplication/xml--> uses the Feed renderer
Running
On your terminal:
Install the needed dependencies with:
$ raco pkg install
fafi needs the following packages:
You can continue without the step above if you already have them installed.
$ racket main.rkt
If you want to open an specific capsule:
$ racket main.rkt gemini://port1965.eu
Or run main.rkt on DrRacket.
Building
If you want a standalone version of Fafi browser you can build it with:
$ racket build.rkt
That will create a dist/ folder and place a distributable version of Fafi inside it. It will also create a single packaged file at the repository root folder that you can distribute to your friends. This file is either a .dmg on macOS, a .zip in Windows, or a .tar.gz in UNIX-like OS.
Keyboard & Mouse shortcuts
- F5: reload
- Home: go to homepage.
- alt+left: go back.
- alt+right: go forward.
- ctrl+w / cmd+w: close tab.
- ctrl+t / cmd+t: new tab.
- ctrl-l / cmd+l: jump to address bar.
- ctrl+q: quit.
- middle-button click: opens link in a new tab.
- ctrl+h: opens history queue.
History management
Be aware that Fafi uses a single queue for history management. This means that all the tabs are a part of the same queue regardless if you navigated to that capsule as a new tab or in the same tab. This is different than major web browsers which usually use a per-tab history queue. Fafi approach is simpler but it is different than what you are probably used to. The history is erased when the app quits.
To view your history queue select the View → History menu.
Issue tracker
https://todo.sr.ht/~soapdog/racket-gemini
Changelog
Check CHANGELOG.md.
Support me
If you want you can buy me a coffee at ko-fi. You contribution helps me write books and software focused on programming, decentralization, and the small internet.
Thanks
- Erkin: For reaching out on Mastodon with a Racket-based Gopher client full of inspiring code for me to look at. I got a lot of useful code snippets from Gophwr ❤️
- Alex HHH: For the marvelous work wiht Racket and the prolific blogging that taught me so much, also for this specific blog post about creating a markdown viewer with Racket from which I stole the basis for
gemini-view%,gemini-renderer%, andmarkdown-renderer%. - m455: For the encouragement in all things Racket.
- Maleficient: For helping me understand style deltas.
- Cel: For introducing me to Gemini.
- Louis77: For all the macOS-related improvements.
Contact
- Scuttlebutt:
@gaQw6z30GpfsW9k8V5ED4pHrg8zmrqku24zTSAINhRg=.ed25519 - Mastodon: @soapdog@toot.cafe
- Twitter: @soapdog
License
MIT
