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

Download area: Added PC/VM linking to correct tabs in docu #337

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

StephanStS
Copy link
Collaborator

The linking to the DietPi docu always led to the first tab of the installation description (SBC part). Now, the linking directs to the VMware, Proxmox,... tab.

See [DietPi Forum - Native PC for UEFI always boot to Clonezilla](https://dietpi.com/forum/t/native-pc-for-uefi-always-boot-to-clonezilla/20624/10)

The linking to the DietPi docu always led to the first tab of the installation description (SBC part).
Now, the linking directs to the VMware, Proxmox,... tab.
@StephanStS StephanStS added enhancement New feature or request index.html labels Jul 2, 2024
@StephanStS StephanStS self-assigned this Jul 2, 2024
@Joulinar
Copy link
Collaborator

Joulinar commented Jul 2, 2024

I don't believe we should change the link. I think that it is already correct to link to the main article. Then the user can select his device.

@StephanStS
Copy link
Collaborator Author

I don't believe we should change the link. I think that it is already correct to link to the main article. Then the user can select his device.

As we saw, at least one user could have benefit from the linking to the according tabs...

@MichaIng
Copy link
Owner

MichaIng commented Jul 3, 2024

I actually like this new MkDocs material feature to link to individual tabs directly. But before we use them, we should assign reasonable IDs to those tabs, to avoid those cryptic numbers.

Probably this will work already:

=== "tab name" {#anchor-name}

Else, we'd need to use the slugify function, to have tab IDs generated from tab names or header_name-tab_name (makes sense in our case, since the same tab names are repeated below different headers on the same page):

- pymdownx.tabbed: # Tabbed content blocks
    alternate_style: true
    slugify: !!python/object/apply:pymdownx.slugs.slugify
      kwds:
        case: lower
    combine_header_slug: true

This should be probably done anyway, and then we can adjust individual IDs from there, when needed.

@StephanStS
Copy link
Collaborator Author

Just setting an {#anchor-name} after the tab name and referencing it did not work.
Using the slugify option did work in a manner like {#header-name-tab-name} with a - as a separator between the header and the tab as well as a blank separator.

#header name

=== "tab name"

Also for

#header-name

=== "tab name"
#header-name

=== "tab-name"

etc.

One drawback is that the links do not work in a local mkdocs server via mkdocs serve: Links like e.g.
http://localhost:8000/docs/getting_started/#how-to-install-dietpi-virtualbox
did not work: It only highlights the desired tab but do not jump to its contents.
This somehow reduces the local testing via mkdocs serve.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request index.html
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants