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

Implement table of content #42

Open
kelson42 opened this issue Oct 9, 2018 · 13 comments · May be fixed by #1201
Open

Implement table of content #42

kelson42 opened this issue Oct 9, 2018 · 13 comments · May be fixed by #1201
Assignees
Milestone

Comments

@kelson42
Copy link
Collaborator

kelson42 commented Oct 9, 2018

This is a really old feature request, for Kiwix Desktop 1.0 too.

See this old ticket: https://sourceforge.net/p/kiwix/feature-requests/1000/

@stale
Copy link

stale bot commented Nov 27, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions.

@stale stale bot added the stale label Nov 27, 2019
@kelson42 kelson42 changed the title Implement TOC like in Mockup Implement TAble of contee Jul 11, 2020
@stale stale bot removed the stale label Jul 11, 2020
@kelson42 kelson42 changed the title Implement TAble of contee Implement TAble of content Jul 11, 2020
@kelson42 kelson42 changed the title Implement TAble of content Implement table of content Jul 11, 2020
@stale
Copy link

stale bot commented Sep 9, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions.

@kelson42
Copy link
Collaborator Author

The strategy here is:

@knowledge-is-power
Copy link

@kelson42 Hi. i saw this issue before opening my own. the fact that this thread is 4 years old without any progress in sight compelled me to make a fresh one. i would like to just clarify here that wikipedia zims already contain the ToCs and Templates(nav boxes). it's just that the kiwix-desktop application is unable to show them.
If the kiwix pwa is able to show this stuff, i suppose the same feature could be easily implemented in kiwix-desktop app by borrowing the same feature from pwa. i don't understand why this is not being done? can you please comment on the following two strategies of such implementation (originally presented by @Jaifroid):

  • Introduce Desktop CSS (as an option) for Kiwix Desktop -- clearly this makes a lot of sense for an app that targets desktop users;
  • Display hidden navboxes -- an option to force-unhide these would be a "quick fix" and could be made available without swapping CSS for the article. It could be done as part of the JS API project.

@stale stale bot removed the stale label Aug 10, 2022
@Jaifroid
Copy link
Member

@knowledge-is-power Just to be clear, the ToC is not in the Wikipedia archives (not even hidden) so it needs to be constructed dynamically from the headers in the article. This isn't too hard, and some work was done on it in this PR, but then stalled. Reader software can implement a generic ToC if an article has H1, H2, H3 etc., but it's probably best done inside the ZIM.

Navboxes, etc., are another matter. These are mostly in the Wikipedia ZIMs, but are hidden by the mobile style, so have to be force-unhidden (unless desktop CSS can be applied).

@knowledge-is-power
Copy link

@Jaifroid Ah, I see. thanks for the clarification. my main concern is actually the navboxes (which are very imp for extended exploration). so, will there be any work done towards force-unhiding or getting desktop css in kiwix-desktop application?

@Jaifroid
Copy link
Member

@knowledge-is-power Just so you're aware, Kiwix JS isn't just a PWA, we also have installable packages for various platforms, and packages for Linux as well as Windows. See http://kiwix.github.io/kiwix-js-windows/kiwix-js-electron.html. Although it's not the full-featured Desktop app, it works very well with Wikimedia archives (and many others too). It's good to have options!

@kelson42
Copy link
Collaborator Author

Reminder: please one topic per ticket, here you mixed two topics which have nothing in common:

  • box collapsing
  • TOC

For the rest, the way forward is pretty known, we just need to have the development resources. It's an old problem, but this is on the roadmap and this will be fixed/implemented at some point.

@knowledge-is-power
Copy link

@kelson42 yeah I thought both issues were part of the same problem that's why I made a single ticket, sorry about that. now that its clear to me that they are unrelated, is it okay if i open a dedicated ticket for wiki navboxes/templates? (cuz this ticket is dedicated to ToC issue)

@juuz0
Copy link
Collaborator

juuz0 commented Aug 11, 2022

I created a ticket here #869

@ShaopengLin
Copy link
Collaborator

ShaopengLin commented Aug 8, 2024

@kelson42 Javascript Injection works fine. QWebEngineScript allows us to inject Javascript in separate files and we can also write the CSS styles over there. I can create a Mock up and you can advise on how to adjust the presentation (This is injected so it will feel foreign and we need a balance).
Screenshot from 2024-08-07 23-33-42

Edit: Mock up:
Screenshot from 2024-09-08 13-30-09

@ShaopengLin ShaopengLin linked a pull request Sep 9, 2024 that will close this issue
@kelson42
Copy link
Collaborator Author

kelson42 commented Sep 9, 2024

@ShaopengLin So, far too late, but here is the mockup:
image

You don't have to implement all the refinements of this mockup (search, back/forth buttons, indicator of localisation in the page), but it has to be as a sidebar and clean. I will open dedicated issues to be done later for the rest.

@kelson42 kelson42 modified the milestones: 2.5.0, 2.4.0 Sep 14, 2024
@srd424
Copy link

srd424 commented Oct 15, 2024

Just jumping in to say .. I was really disappointed in the lack of TOCs, but have discovered that there is at least one chrome/firefox extension which generates them dynamically from page content, and it seems to work nicely with kiwix-serve: https://github.com/FallenMax/smart-toc

I'm sure there are others, still looking ..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: REVIEW
Development

Successfully merging a pull request may close this issue.

7 participants