v2.ocaml.org icon indicating copy to clipboard operation
v2.ocaml.org copied to clipboard

Adding table of contents on https://ocaml.org/learn/tutorials/ page.

Open gurleennsidhuu opened this issue 3 years ago • 10 comments

I think it would be feasible for the user if we add a table of contents on https://ocaml.org/learn/tutorials/. The site now looks like this. a After the change: b

Please let me know if you have any suggestions. If this get approved, I would like to work on this. :)

gurleennsidhuu avatar Apr 03 '21 08:04 gurleennsidhuu

I agree that that would improve consistency inside tutorials given that every tutorial has a table of contents. So I'd say you can go ahead and work on this, if you'd like :) You have two sections in your screenshot: the first one doesn't have a name at the moment and the second one is calle External links. You could call the first one Tutorials.

pitag-ha avatar Apr 06 '21 09:04 pitag-ha

I am facing an issue. I thought if I wanted to make changes in the html syntax, I need to run make local which would create html files of every md file. When I do so, the changes are visible on browser but the edited file's name is not visible when I run git status. I am not sure if I am doing it right.

gurleennsidhuu avatar Apr 06 '21 14:04 gurleennsidhuu

the edited file's name is not visible when I run git status

My guess would be that the generated html files end up somewhere in ocaml.org/ which is in .gitignore. Is that possible?

pitag-ha avatar Apr 06 '21 15:04 pitag-ha

the edited file's name is not visible when I run git status

My guess would be that the generated html files end up somewhere in ocaml.org/ which is in .gitignore. Is that possible?

I didn't know that. :( Can you please guide me about how to make the changes?

gurleennsidhuu avatar Apr 06 '21 16:04 gurleennsidhuu

Yes, the way that's implemented in ocaml.org is not very standard xD

You can see on the page of one of the concrete tutorials, e.g. a first hour with ocaml how to include a ToC (have a look at the beginning of the file). You can see here in the makefile how that actually triggers the generation of the ToC.

pitag-ha avatar Apr 07 '21 17:04 pitag-ha

Yes, the way that's implemented in ocaml.org is not very standard xD

You can see on the page of one of the concrete tutorials, e.g. a first hour with ocaml how to include a ToC (have a look at the beginning of the file). You can see here in the makefile how that actually triggers the generation of the ToC.

In the screenshot that I attached above, I added the table of content by adding *Table of contents* to the md file, but now, I am confused because I want to make some changes to the ToC.

gurleennsidhuu avatar Apr 07 '21 17:04 gurleennsidhuu

That might be an intersting task to do :) what kind of changes do you want to make?

pitag-ha avatar Apr 07 '21 18:04 pitag-ha

That might be an intersting task to do :) what kind of changes do you want to make?

Like you said, one section doesn't have a name but the other section is named External Links. I wanted to add the name for the 1st section.

gurleennsidhuu avatar Apr 07 '21 18:04 gurleennsidhuu

Sorry for my last 2 replies; after reading the beginning again I've noticed that I totally mixed this up with another issue!

Like you said, one section doesn't have a name but the other section is named External Links. I wanted to add the name for the 1st section.

For adding the name for the 1st section I would guess the easy way would be to add that section header to the page in a way that it is picked up by the ToC generator. The harder and more interesting way (maybe too hard, I'm not sure. cc @patricoferris ) would be to have a look at the ToC generator to see how you could tweak it.

pitag-ha avatar Apr 08 '21 20:04 pitag-ha

I just caught up with the discussion in this issue and looking at #1493. I don't think adding a ToC to an index page adds much to that particular page, as the links are just repeated. Without a compelling reason otherwise, I'd suggest moving onto another issue. (but thank you for trying it -- it helps to see the result of the change to judge whether or not it's an improvement or not, so this is a positive contribution).

avsm avatar Apr 19 '21 19:04 avsm