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

Sidebar updates #409

Merged
merged 2 commits into from
Apr 16, 2017
Merged

Sidebar updates #409

merged 2 commits into from
Apr 16, 2017

Conversation

mortenpi
Copy link
Member

Style and behaviour updates for the sidebar. Site build available here.

  • Improve contrast of the sidebar menu as discussed here.
  • Update the version selector style and behaviour. Basically to make fit a bit better with the rest of the style and also make sure that it displays the current version when loaded.

The WIP bit is to make makedocs automatically determine the current version name (e.g. latest, tag name) which is currently only done in deploydocs (so, right now it would just show the commit hash for all builds).

I am also not necessarily entirely happy with the version selector's style, so feedback & ideas would be greatly appreciated (cc @cormullion).

Ideally fixes #406.

@cormullion
Copy link
Contributor

Looks pretty good—works well on macOS/Safari. I might prefer it if the dropdown menu and default text in the search box (and the logo) was all centered...

On iPad (and probably iPhone too but...) the navigation bar isn't very usable, though —touch event handling or something. Perhaps that could be added as a separate issue...

@MichaelHatherly
Copy link
Member

Update the version selector style and behaviour.

The selector doesn't display the dropdown arrow as far as see. Could we add that back since it's a useful indication of what it is.

The WIP bit is to make makedocs automatically determine the current version name

makedocs isn't currently dependant on the "version" at all. Changing that would probably require merging makedocs and deploydocs. Best way to handle this in deploydocs would be to create a version.js file containing var DOCUMENTER_VERSION = "<dirname>"; for each version directory. Then use that value for the selector.

@mortenpi
Copy link
Member Author

The selector doesn't display the dropdown arrow as far as see. Could we add that back since it's a useful indication of what it is.

Yup, I agree that it would be nice to have. However, I removed it intentionally since it can't be styled and it is very inconsistent across platforms/browsers and doesn't really match with the rest of the style (especially in Firefox). But I should play around with it a bit more -- I think the standard workaround is to use background images on the select to show an arrow.

Best way to handle this in deploydocs would be to create a version.js file containing var DOCUMENTER_VERSION = "<dirname>"; for each version directory. Then use that value for the selector.

It would be nice if it wouldn't depend on javascript though and the current version would be displayed statically. But this sounds like a reasonable solution for the first iteration.

@mortenpi
Copy link
Member Author

I might prefer it if the dropdown menu and default text in the search box (and the logo) was all centered...

Everything except the text in the search box should be centered. Could you give me a screenshot of what you're seeing?

On iPad (and probably iPhone too but...) the navigation bar isn't very usable, though —touch event handling or something. Perhaps that could be added as a separate issue...

Mobile experience from both the layout and touch experience point of view has not received any attention so far really. Would definitely be something that could be improved.

@MichaelHatherly
Copy link
Member

especially in Firefox

Looks alright for me on Firefox, I think it depends on what dm/wm and theme is being used.

2017-01-19-1484808444-crop

It would be nice if it wouldn't depend on javascript

There's already lots that depends on js in the docs, so for a first pass it's fine to require it for this.

Mobile experience from both the layout and touch experience point of view has not received any attention so far really. Would definitely be something that could be improved.

According to the site analytics mobile views account for less than 5% of all traffic to Documenter's docs, so probably not a critical requirement just yet.

@cormullion
Copy link
Contributor

On Safari I see this:

screen shot 2017-01-19 at 10 05 46

Artist's impression of slight improvement (de gustibus non est disputandum ...):

screen shot 2017-01-19 at 10 05 46 copy copy

@mortenpi
Copy link
Member Author

mortenpi commented Jan 19, 2017

For me on Firefox, when I re-enable the arrow, it looks like this:
documenter_ff

However, I agree that there should be something indicating that you can actually select a version there, so I'll look into that. Also, agreed, let's go with a .js file for the time being.

As for centering -- the select has text-align: center and text-align-last: center, which means it is nicely centered on all the browsers that I've tested (but I don't have access to OSX/Safari). What styling did you add, @cormullion?

The search box I would keep left-aligned since it's quite wide and then it matches the menu below.

Just FYI: I'll be travelling in the coming days though, so this PR will likely be on hold until the latter half of next week.

@MichaelHatherly
Copy link
Member

Looks like a 0.4-specific failure. You're welcome to drop 0.4 support if you'd like to — we've been keeping it going for long enough I think.

@mortenpi
Copy link
Member Author

It's a small type thing with Strings -- as a workaround I think can force the string to be Compat.UTF8String so it works on all versions.

@mortenpi mortenpi mentioned this pull request Jan 27, 2017
@mortenpi mortenpi changed the title WIP: Sidebar updates Sidebar updates Jan 27, 2017
@mortenpi
Copy link
Member Author

Updated on my part, latest build should be here (built and deployed on Travis). Changes:

  • Unified select box triangle with a background image.
  • Uses siteinfo.js to populate the selector's "current version".

I do feel that this needs more work in the long run. Generating siteinfo.js in deploydocs doesn't feel quite right, and the latest/release etc. tags should probably have the exact version shown as well (e.g. "v0.5.0 (latest)" instead of just "latest"). But all that should be in future PRs.

@mortenpi
Copy link
Member Author

mortenpi commented Feb 5, 2017

Cleaned up and rebased, latest build updated. I would say that it's ready to merge.

Only thing unaddressed is the Safari style, which I can't test myself. @cormullion ?

@cormullion
Copy link
Contributor

Looks good to me!

img_0074

@mortenpi
Copy link
Member Author

mortenpi commented Feb 5, 2017

The text in the selector should be centered (and is on other platforms). What did you add before to make it centered in Safari, @cormullion?

@cormullion
Copy link
Contributor

cormullion commented Feb 5, 2017

My artist's impression above, you mean? That was image editing... I moved the stuff around manually. That was after a quick and unsuccessful look at the Safari Inspector thing, which lets you fiddle with the HTML/CSS. (I think Safari on iPad and Mac will be the same. I'll have a look after breakfast...☕️🥐)

@cormullion
Copy link
Contributor

Safari on Mac:

screen shot 2017-02-05 at 10 24 05

@mortenpi
Copy link
Member Author

mortenpi commented Feb 5, 2017

Ah, I thought you did it in the inspector. I added a note about this for future reference as it looks OK even if it is not centered.

@mortenpi mortenpi added this to the 0.10 milestone Mar 4, 2017
Increase the contrast of the text in the sidebar by:
 - making the text near-black, same as the main body
 - make the :hover text on dark background light (same as nav.toc
   background)
Add a version argument to makedocs that will allow specifying the
version shown in the selector by default. If it is not specified then
the version selector will be empty and have visibility: hidden so that
an empty selector wouldn't show up. Using visibility: instead of
display: so that the sidebar wouldn't jump when the selector gets
enabled.

Separate the version selector javascript into a separate requirejs block.
Amend the version selector javascript so that existing selector options
get checked and updated, if necessary. A siteinfo.js file will now also
be generated in the root of the build when being deployed which can be
used to determine the current version.

Move version selector out of search <form> tag, making it easier to
style and since it is not conceptually related to the search.

Update the style of the selector to be uniform across browsers, more in
line with the style and more connected to the package name rather than
the search box. The SVG arrow is necessary to make the dropdown
indicator uniform.
@mortenpi mortenpi merged commit 72a55fd into JuliaDocs:master Apr 16, 2017
@mortenpi mortenpi deleted the fix-style branch April 16, 2017 23:50
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.

Visually distinguish "latest" and "stable"?
3 participants