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

slide_link_html_sections_to_slides not working #133

Open
juliendehos opened this issue Oct 17, 2017 · 2 comments
Open

slide_link_html_sections_to_slides not working #133

juliendehos opened this issue Oct 17, 2017 · 2 comments

Comments

@juliendehos
Copy link

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.

@pchampin
Copy link

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
Copy link

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

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants