-
-
Notifications
You must be signed in to change notification settings - Fork 67
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
Table of Contents #182
Comments
Just a heads up, I edited your parser code example to make it more correct and readable, feel free to change it if I made a mistake. Thanks for the compliment, and I'm happy to hear you're interested in working on this feature!
Definitely. I find the current method of rendering somewhat ugly and hacky, and more importantly, it requires the entire document being available, but gemtext is line-based. This is actually quite related to the idea of streaming gemtext responses (#9), which would require a parser. In this comment I suggested a parser that implemented Of course there are other ways to do this, like to have the network connection as a field of the parser, and then the parser reads and renders in a goroutine or something. I'm not sure what's the best method. Now all of this is somewhat separate from your original idea of building a ToC feature. I've brought it up because it would be a good thing to work on if it simplifies or helps things. If it's too much extra work to close #9 then don't worry about it, any parser you write will be helpful in moving towards that goal anyway.
Yep! Although I think we should stay away from actually using anchors for now, as that's not standardized in Gemini yet. So the table of contents data will need to contain heading lines, but it will also need to know what line of the document that heading is. I'm not sure if there should be a separate table of contents struct, or it can be built or stored with the
This feels like the trickier one to me, space is limited.
This is what I picture as well. I would use the right side, as Amfora is designed to have a larger right margin then left margin on larger screens. You'll need to create a You may want to use a You should be basing your work off the I will "assign" you this issue in GitHub's interface. If you can't work on it anymore in the future for whatever reason, just let me know and I'll unassign you. |
@ThomasAdam I see you've begun this work here. Have you made further private progress on this? I ask because I am going to be working on #9 next, and that will mean implementing the things we discussed above like a parser, everything short of an actual ToC feature. If you're started or completed this yourself I'd be happy to see that work and possibly use it, otherwise I'll start on it myself and you can continue your ToC work once I've finished. Thanks! |
Apologies for the delay. You're working a lot faster than I am. Please go ahead with #9 and I'll both review that and complete the ToC work. |
All good, thanks for getting back to me. And yeah, unfortunately it might make sense to hold off on this until #9 is completed because of how related they are. |
Hey @makeworld-the-better-one
As others have echoed many times, thanks for this client -- it's certainly one of the better terminal ones!
I was looking at the TODO list, and noticed you had an item on there which I'm keen to work on, assuming it's not already being implemented elsewhere (in which case I'll look at some other feature to code), and that's adding a ToC (Table of Contents).
In adding this, I have some questions before I start submitting PRs for this. The first one is to do with the parser (in
renderer.go
). At the moment, the parser is stateless in that it's rendering the page line-by-line, and building up a display output which can be rendered. I'm actually wondering if we should instead have the concept of aParser
, perhaps something like:Where we have a
bufio.Scanner
representing the raw gemini lines, and thatLines
is out struct of parsed content.From there, we can introduce further types that know how to handle:
Most of this is yak-shaving to then be able to build up a ToC though, which is my next point. As I see it, a ToC would have to represent two things:
foo.html#whatever
)Did you have anything in mind with regards to point 2? I was imagining a sidebar on either the left or right of the screen which can be toggled on and off, perhaps?
Point 1 is just a variation on a theme about getting the
Parser
into a shape where adding in these ephemeral states which fall outside of pure gemini-rendering become easier.Let me know your thoughts, and I'll happily crack on with this.
Thanks again!
Thomas
The text was updated successfully, but these errors were encountered: