Giter Site home page Giter Site logo

Comments (11)

leerho avatar leerho commented on June 28, 2024

You are absolutely right. This is a P.I.T.A. and I agree! Our problem is that none of us on the core team are front-end developers with skills in javascript and the bootstrap cdn libraries. This site has been cobbled together by copy & paste from other similar sites and could really use help from someone with those skills. The #83 was to fix another problem, which may not have been the right fix. If you know how to fix the ToC menu we would welcome it!

from datasketches-website.

leerho avatar leerho commented on June 28, 2024

@mkaszas
Thank you Máté for fixing this!
Closing this issue.

from datasketches-website.

leerho avatar leerho commented on June 28, 2024

@mkaszas
We still have some strange behavior:

The following ToC links collapse back all the way to the fully collapsed ToC. I can't figure out what the pattern is but it is generally the first and sometimes the second actual page link under a subheading, but not always.

This may be a problem in the way the ToC.html is being generated from the JSON. But I can't seem to find it.

Background / The Challenge
Sketch Families / Most Frequent / Frequent Sketches Overview
Sketch Families / Most Frequent / Frequent Item Sketches / Frequent Items Overview
Sketch Families / Quantiles And Histograms / Quantiles Overview
Sketch Families / Quantiles And Histograms / Quantiles Accuracy and Size
Sketch Families / Quantiles And Histograms / Quantiles Examples / Quantiles Sketch Java Example
Sketch Families / Quantiles And Histograms / Quantiles Studies / Definitions for Quantiles Studies
Community / Community
Community / Downloads

There is another problem where we have the same page listed multiple times in the ToC.
For example, the page "Using Sketches in Druid" is listed in each of the "Examples" sections. These links will pop you back to the first reference of this page in the ToC, which is disorienting for the user. We probably need a dummy page with a forwarding link to the actual page here, but I'm not sure even that will work.

Could you please look at this?

Thanks a Million!!

from datasketches-website.

leerho avatar leerho commented on June 28, 2024

@mkaszas
Remove Sketch Families / Quantiles And Histograms / Quantiles Sketch Theory from the list.

from datasketches-website.

mkaszas avatar mkaszas commented on June 28, 2024

@leerho Looks like there are 2 separate issues, but they are closely related:

  • Background > The Challenge, Community > Downloads, Community > Community and Research > Research
    There are links to these pages in the header of the page, and the script we execute on page load looks for the first link pointing to the current url and tries to highlight and expand it. This can be solved with using a more specific selector, so we only look for the link inside the TOC.

  • For the other links, the only issue I could reproduce was with pages that are referenced inside the TOC more than once. For example: Sketch Families > Most Frequent > Frequent Distinct Sketches > Frequent Distinct Tuples Sketch
    In these cases, the easiest solution would be to copy the contents of these pages to a new page, with a different path, so all of the links inside the TOC are unique.

I can send in a PR for the first point tomorrow, let me know what you think about the second one.

I couldn't see any issues with any of these pages though:

Sketch Families / Most Frequent / Frequent Sketches Overview
Sketch Families / Most Frequent / Frequent Item Sketches / Frequent Items Overview
Sketch Families / Quantiles And Histograms / Quantiles Overview
Sketch Families / Quantiles And Histograms / Quantiles Accuracy and Size
Sketch Families / Quantiles And Histograms / Quantiles Examples / Quantiles Sketch Java Example
Sketch Families / Quantiles And Histograms / Quantiles Studies / Definitions for Quantiles Studies

from datasketches-website.

leerho avatar leerho commented on June 28, 2024

@mkaszas
Thanks for your efforts on this! I had pretty much come to the same conclusion wrt the two categories you identified, but I suspect there may be a third:

  1. Overlap with NavBar links. It would be great if there is a way for a link from the NavBar would force the ToC to open to the right place showing where that page is located in the ToC in addition to opening the page. (If this is what I think you said is possible.) You will have to teach me how to properly reference these pages from the NavBar to accomplish this.

  2. Duplicating pages would be a maintenance nightmare. However, instead of having multiple links in the ToC linking to the same page, we can easily restructure the ToC to remove duplicate links. Then in the text of the pages themselves, if we want to cross -reference to another page it would re-expand the ToC to show where that page is located in the ToC. (Again, there may be a special way to reference the page to accomplish this.) This way the back-link will return the user to his prior page and the state of the ToC for that page. (If my understanding is correct! )

  3. I suspect the weird behavior with the other pages may have to do with interactions with the browser cache. My default is Chrome on a Macbook Pro. This morning I tried those ToC links from Safari and had no weird behavior. Then I cleared the cache on Chrome and again had no weird behavior. So I guess the solution to this, if it occurs again, is to clear the browser cache.

If this makes sense to you, go ahead and submit your PR.

Cheers,

Lee.

from datasketches-website.

mkaszas avatar mkaszas commented on June 28, 2024

Just submitted a PR for 1., there's no need to change the way we reference these pages in the navbar or the TOC - the menu items in the toc will be expanded, and the top nav item highlighted when we arrive on one of these pages.

For 2., as long as we can remove the duplicates from the ToC, this should work as you described. Cross referencing pages and expanding the menu item already works (example: On https://datasketches.apache.org/docs/Architecture/LargeScale.html there is a link to Spark Examples)

number 3 is a good catch, I didn't think about browser caching. As the toc script is delivered with each page, if some of the pages are cached in your browser, it could happen that for those pages, the ToC script won't work (until the cache is invalidated)

from datasketches-website.

leerho avatar leerho commented on June 28, 2024

So my dumb question: Is this browser caching problem a result of all our pages being statically rendered? In other words, is there a more sophisticated way of handling the ToC that would be more robust? Would "Frames" help?

from datasketches-website.

mkaszas avatar mkaszas commented on June 28, 2024

Yes, jekyll creates a separate html file for each page, and copies the contents of the ToC, as well as the script in each of them. One way to avoid inconsistent behaviour would be to serve the script as a js file separately, and include it in the header of each page. That way a single file would be cached, so the behaviour would be more consistent.

Realistically, it should not take longer than a couple of days for all user cache to be invalidated, unless there's an unreasonably long cache expiry date set on the server.

from datasketches-website.

leerho avatar leerho commented on June 28, 2024

Hmmm. Well, as an example, after merging your PR and eliminating the duplicates in the ToC and merging that I tried out the new ToC. And clicking on Downloads in the NavBar did not open the ToC. But after dumping the browser cache it worked.

If the website was static for long periods of time, living with the default cache invalidation would probably be ok. But during active development of the site it is a PITA. So I am open to your suggestion. Is having the separate js file and including it on each page a big change? Also, what downsides would there be with this approach? Is it slower?

from datasketches-website.

leerho avatar leerho commented on June 28, 2024

@mkaszas
Thank you for all your help! It seems to be working quite reliably now :)

Lee.

from datasketches-website.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.