FreeCAD / DevelopersHandbook

A handbook about FreeCAD development
41 stars 29 forks source link

Unable to link directly to a section header in jekyll rendered page #68

Closed luzpaz closed 1 year ago

luzpaz commented 1 year ago

Screenshot_20230929_104635

I've annotated the above screenshot to show where i expected to find the classic markdown link icon so one could anchor their link to a specific section within the page.

Is there something in Jekyll to enable this feature ?

yorikvanhavre commented 1 year ago

Not 100% sure I got your question right, but maybe look at the page in github rather than the jekyll-rendered version?

I always do these kind of links more or less manually, something like somepage.md#section-name where section-name is the text of the subsection, lower-cased, stripped of all non-alphanumeric characters, and with spaces replaced with -...

Usually if you look at the page in github and hover over the subsection titles it will show you the correct link. Maybe that will work with jekyll too?

luzpaz commented 1 year ago

but maybe look at the page in github rather than the jekyll-rendered version?

Yes, in github you see the link symbol trailing the section headers Screenshot_20231006_100038

ref: https://freecad.github.io/DevelopersHandbook/gettingstarted/

This is not available in the current FreeCAD jekyll developer handbook.

And this sort of defeats the purpose of the jekyll handbook if that option is not available (to link directly to a section of a page).

yorikvanhavre commented 1 year ago

But if you use the correct link syntax as indicated on the github version, does it work on the jekyll-rendered version? If yes then it's not a too big problem...

chennes commented 1 year ago

You can, but it is pretty annoying to have to hand-construct the links. It would be better if we could modify the template (or find an existing one that provides the explicit link markers).

chennes commented 1 year ago

It looks like we can use: https://github.com/allejo/jekyll-anchor-headings#usage

chennes commented 1 year ago

OK, I've implemented this -- I'm not over-fond of the hashtag symbol, but I leave it to someone with more CSS and HTML talent than I to implement something nicer.