makew0rld / amfora

A fancy terminal browser for the Gemini protocol.
GNU General Public License v3.0
1.14k stars 65 forks source link

Support URL fragments for linking to headers #286

Open makew0rld opened 2 years ago

makew0rld commented 2 years ago

See this comment: https://gitlab.com/gemini-specification/gemini-text/-/issues/3#note_771701460

Basically, a small conversion would be applied to each header in the document, and the first one that matched the fragment would be jumped to.

It would also be cool if a small CLI tool was created where you could give a header and it would output the fragment version? Just as a handy way to generate them.

Anyway, this feature requires parsing the gemtext document, so #182 is related. It's not required for ToC to be implemented, but whichever is done first will make the other easier, and #182 should be looked at if this one is developed first. As mentioned in #182, it makes sense for #9 to be completed before this.

makew0rld commented 2 years ago

More discussion is happening the in the thread, and the more I think about it, the more potential good options there are for fragments. So this could easily be different than the implementation in the specific comment I linked to.

No implementation of this should go in the master branch until Solderpunk / the spec spec speaks on this.

makew0rld commented 2 years ago

Should the URL fragment in the bottom bar automatically change as you scroll through the document, to link to the current section you're in? It could be configurable, but I think that would be nice.