Skip to content
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

Add a Tasks list to the left column. #357

Closed
wants to merge 2 commits into from

Conversation

jverkoey
Copy link
Collaborator

Similar to Apple's docs, this "Tasks" section shows all of the task section on the current page.

I've put the Tasks list above the other links which makes it a little harder to jump between APIs because the Tasks list might grow/shrink/not exist. What are your thoughts here @jpsim?

@jverkoey
Copy link
Collaborator Author

Need to update the integration specs repo.

if task[:name]
{ name: task[:name], url: "#/"+task[:uid] }
end
end
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.compact

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, my ruby-fu is fairly undeveloped - where should I put the .compact? I see in the docs that it "Returns a copy of self with all nil elements removed.", but I'm checking a child element of task (:name), not the task itself.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just put it at the end of this line, otherwise the array you're mapping to can contain nil

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't you use tasks.flat_map instead of tasks.map?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless I've been ruined by Swift and Ruby's Array::flat_map doesn't reject nil elements?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$ irb
2.2.0 :001 > [1, 2, 3].flat_map { |x| x * 10 if x > 1 }
 => [nil, 20, 30] 

A case Ruby is actually stricter than Swift. Inform the media!

@pcantrell
Copy link
Collaborator

I have mixed feelings about this. As you point out, this makes it much harder to navigate between classes. Also, the left sidebar already has serious scrolling issues in general (sometimes I can’t get it to scroll at all, and instead the whole doc scrolls). That will only get more annoying if the content gets taller.

I do see the advantage of having the task list at the ready, though.

Do you mind posting a screenshot, or a link to docs build with your PR?

@jverkoey
Copy link
Collaborator Author

Screenshot:
screen shot 2015-11-11 at 11 56 32 am

@jverkoey
Copy link
Collaborator Author

re: content jumping around.

Jazzy's side bar is presently a "top-level site nav".

Apple's docs, on the other hand, only use the side bar for links either within the page or related to the page. Top-level site nav is available at the framework index page.

I'll admit that my pull request is conflating the two. Perhaps a discussion needs to be had around what should go in the side bar?

One could argue that placing the site nav in the sidebar is optimizing for quickly jumping between classes, while I'd wager that someone viewing a particular class would prefer quick access to the internals of the doc (via the Task List) or related APIs. The latter is how Apple's docs are structured as far as I can tell.

Happy to work with y'all to find a solution here :) Not sure how strongly the opinions are on the content currently in the sidebar.

Reference content:

@pcantrell
Copy link
Collaborator

Jazzy's side bar is presently a "top-level site nav". Apple's docs, on the other hand, only use the side bar for links either within the page or related to the page. I'll admit that my pull request is conflating the two.

I think you’ve hit the nail on the head here. I would like to see this worked out, though; it bugs me a little too.

Two important differences in the Apple case:

  1. Those Apple classes are huge. They really need the task-based nav in a way that I really hope our smaller libraries don’t!
  2. With “inherits from” and “conforms to,” they’re providing a lot more navigation than Jazzy does to related pages.

@jverkoey
Copy link
Collaborator Author

To summarize the things that are missing that could help jazzy's overall navigation:

Per-API

  • Inherits from
  • Conforms to
  • Related documentation
  • Availability
  • Import statements

Top-level

  • An intro (already using README.md here)
  • A list of the entire class hierarchy.
  • All other symbols listed out.

@pcantrell
Copy link
Collaborator

Related documentation is already available via - SeeAlso: plus the new autolinking.

@jverkoey
Copy link
Collaborator Author

Ah true :)

Though I was referring specifically to including Related Documentation in the side bar. Does jazzy already do that?

@jpsim
Copy link
Collaborator

jpsim commented Nov 16, 2015

Good points. I agree, and we're already tracking all of these:

Inherits from/Conforms to

#8

Related documentation

- see:/- SeeAlso:/@see

Availability/Import statements

#11

An intro (already using README.md here)

README, as you mentioned. This is configurable from the command line / YAML file too.

A list of the entire class hierarchy.

Not quite covered by #8, but could be an expansion thereof.

All other symbols listed out.

What do you mean by this?

@jverkoey
Copy link
Collaborator Author

What do you mean by this?

That the top level page would consist of a readme, class hierarchy, and then all of the other top-level symbols (enums, c functions, etc...)

@jpsim
Copy link
Collaborator

jpsim commented Nov 17, 2015

I see that as an extension of your other points, and yes it would be good!

@pcantrell
Copy link
Collaborator

It would be nice to see some ideas mocked up with actual libraries. Maybe we could even involve a real live designer. (!)

I have a feeling that Apple’s doc design is better suited to their behemoth framework than to our little libs. Even RestKit is but a pebble at the feet of UIKit.

@jverkoey
Copy link
Collaborator Author

jverkoey commented Mar 6, 2016

I'm going to close this now that there is support for themes. If themes don't prove to solve some of the issues outlined in this PR we can reopen and revisit the thread :)

@jverkoey jverkoey closed this Mar 6, 2016
@jverkoey jverkoey deleted the taskslist branch March 6, 2016 00:31
@istx25 istx25 modified the milestone: The Past Nov 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants