Skip to content
This repository has been archived by the owner on Aug 24, 2021. It is now read-only.

Adds an Index page for the Standard Library. Fixes #98. #187

Closed
wants to merge 2 commits into from
Closed

Adds an Index page for the Standard Library. Fixes #98. #187

wants to merge 2 commits into from

Conversation

ngzax
Copy link
Contributor

@ngzax ngzax commented Aug 2, 2017

This is a Proposal and is not ready for merge. I wanted to get this out there, however, before I put in more work to make sure I am going down the right path.

This is a big "itch" of mine because when you read examples, for example in this excellent post: https://urbit.org/fora/posts/~2017.7.20..09.13.38..a812~/, you see gates like cork, crip, and trip and it is difficult to find them in the current 1a, 1b, &c. structure of the standard library docs.

This is unfortunately hampered by the fact that tree doesn't properly follow anchor links when sending to another page. (They do work intra-page). This is an existing bug that is already affecting the docs and I am going to try to take a stab at fixing that as well. But, for now, for this patch you'll just have to imagine it works. 😉 At least it takes you to the right section.

Comments on the formatting and presentation are welcomed.

Looks like this may be complicated by the fact that tree doesn't
properly follow anchor links.
@Fang-
Copy link
Member

Fang- commented Aug 3, 2017

This is so good!

I'm not entirely sure how I feel about sorting these alphabetically rather than by the sections in hoon.hoon. If I'm looking for things to do with lists, I ideally want to be able to ctrl-f for "list" and see all arms under "2b: list logic".

Though that may make the index more similar to existing docs pages, I think having this index function as a quick-ref would be neat. Maybe a format along the lines of the following might be nice (per section)?

Arm Brief Use
find First index in list {nedl/(list) hstk/(list)}
fand All indices in list {nedl/(list) hstk/(list)}

That's just my two cents though, and very much up in the air still. Not to mention "he who does the work...". It'd be cool to get feedback from more people on this, see what everyone's looking for in an index page like this.

Also, +1 for name tags on function arms for those #links, but the next iteration of our markdown-to-html rendered will automagically put those in for you, like Github already does. So spare yourself the effort there!

@ngzax
Copy link
Contributor Author

ngzax commented Aug 4, 2017

Thanks for your feedback, @Fang-.

I think I headed down the alphabetical route because that's how an index is traditonally organized. 😄 .
Moreover, if you know that you want all arms for lists, you already can go to the root page of the standard library (http://localhost:8080/docs/hoon/library/) and search there. I also just kind of like the fact that now you can just sort of browse and see all the different arms and maybe stumble upon one that you hadn't known about before.

As a compromise, what if we retained alpha ordering, but added the section to it like so:

Arm Brief Use Section
find First index in list {nedl/(list) hstk/(list)} 2b: list logic
fand All indices in list {nedl/(list) hstk/(list)} 2b: list logic

I will post something about this PR on /fora to see if we can get a wider audience for comments.

Is there any way I can see the in progress version of tree? (I assume that's what you're calling " our markdown-to-html") I looked in the public repo and I don't see any in progress branches.

@joemfb
Copy link
Member

joemfb commented Aug 4, 2017

I'm inclined to think that alphabetical is best. (I guess that's ironic, since I argued against it for the glossary ...) It comes down to which reading patterns should be prioritized: I think an index is most useful for looking up gates referenced somewhere else. And the pages themselves are already grouped by section.

I'm conflicted when it comes to including the sample mold in the table. Is it helpful context, or extra, confusing information? I'll have to leave that to others.

Finally, it's worthing noting that hoon.hoon and zuse.hoon have been completely refactored on cc-release. Section boundaries are different, and gates have been renamed and/or namespace'd (for instance ++sein will be ++sein:title). I'm not sure how long it will take to pull this together (or when cc-release is expected to be ready) but it's worth anticipating those changes. Maybe the fully namespace'd arm name should be in a separate column?

@galenwp
Copy link
Contributor

galenwp commented Aug 7, 2017

It wouldn't be all that difficult to make a table like the sample one that @ngzax has drawn up above (#187 (comment)) sortable.

It's a toss up to me whether alphabetical or section makes more sense. If you're looking for a 'kind' of gate then you want to sort by section.

Otherwise: this is a great idea. That index page is really not helpful. I feel like https://urbit.org/docs/hoon/reference/ could use some help as well.

@vvisigoth
Copy link
Contributor

Nothing of substance to add, just want to give my support to this idea and lodge another vote in favor of a sortable list, since I can anticipate using one while reading code and while writing.

@ngzax
Copy link
Contributor Author

ngzax commented Aug 7, 2017

@galenwp : Thanks for your feedback.

One of the reasons I made it the way it is now is because I couldn't see any way using any of the table markdown syntaxes I have ever used to make a table in urbit markdown. Is there a syntax? If not, would it need to be added via tree?

I am more than willing (and able) to work on this but as I indicated in my comment to @Fang- above I am concerned that there is a newer version of tree coming soon that isn't publicly visible yet.

@galenwp
Copy link
Contributor

galenwp commented Aug 7, 2017 via email

@ohAitch
Copy link
Contributor

ohAitch commented Aug 8, 2017

For stuff like this you already have to write hoon in ford if you want to generate them dynamically, see .tree-index which is doing something similar. Once you have it generating the right html, it can be plugged into current tree by adding a tree-json clause, or the future infrastructure more directly from ford.

@galenwp
Copy link
Contributor

galenwp commented Aug 8, 2017

I mean, isn't the twig reference (https://urbit.org/docs/hoon/reference/) doing something similar client-side?

@ohAitch
Copy link
Contributor

ohAitch commented Aug 8, 2017 via email

@ngzax
Copy link
Contributor Author

ngzax commented Aug 8, 2017

Thanks guys, I'll check out those pages and see what I can do.

@Fang-
Copy link
Member

Fang- commented Mar 9, 2018

@ngzax Did you see what you can do for this yet? (:

@xykj61
Copy link

xykj61 commented May 10, 2018

This is something that @rmariani is working on as we speak, so I'm going to close this PR for now, and we can always refer back to this if we need.

@xykj61 xykj61 closed this May 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants