hieroglyph icon indicating copy to clipboard operation
hieroglyph copied to clipboard

slide_link_html_sections_to_slides not working

Open juliendehos opened this issue 8 years ago • 2 comments

Hi I'm trying to migrate a project from hieroglyph 0.7.1 to hieroglyph 1.0.0 but the slide_link_html_sections_to_slides config option does not work anymore (no link in the output html pages). The slide_link_html_to_slides is enabled (as explained in the docs). Same problem with a new project created with hieroglyph-quickstart.

juliendehos avatar Oct 17 '17 20:10 juliendehos

I confirm the problem. Creating a fresh project with the latest Sphinx and Hieroglyph, I could not get the links from HTML sections to slides to appear. Reverting to Sphinx<1.6 and Hieroglyph<1.0 solved the issue.

pchampin avatar Oct 22 '17 20:10 pchampin

Still not working with Hieroglyph 2 and the latest version of Sphinx... :cry:

I hacked a workaround, by injecting the following JS code in all HTML pages:

window.addEventListener('load', () => {
    let path = window.location.pathname.split('/');
    if (/slides/.test(path)) {
        return; // do not add links in slides
    }
    let filename = path[path.length-1];
    for (a of document.querySelectorAll('a.headerlink')) {
        let b = a.cloneNode();
        b.innerText = '§';
        let hash = (new URL(a.href)).hash;
        b.href = 'slides/' + filename + hash;
        a.parentElement.appendChild(b);
    }
});

NB: that assumes that the slides are in a slides directory as a subdirectory of the "normal" rendering.

pchampin avatar Aug 18 '22 07:08 pchampin