Coder Social home page Coder Social logo

Link Anything about mdbook HOT 1 OPEN

dylanowen avatar dylanowen commented on July 18, 2024
Link Anything

from mdbook.

Comments (1)

dylanowen avatar dylanowen commented on July 18, 2024

I managed to get deeplinks.js working with the existing html renderer configuration options however it was a bit clunky:

additional-js doesn't work as deeplinks.js is a module and additional-js doesn't account for that. additonal-js also doesn't copy over dependency imports. Maybe we could define a folder inside of theme that was copied over completely?

I was able to get this working by including a folder in my src directory as js which is copied over to the final book (any name works really). I then changed my theme/head.hbs to:

<script type="module" src="{{path_to_root}}/js/deeplinks.js"></script>

and included this additional-css:

* {
    scroll-margin-block-start: calc(var(--menu-bar-height) + 2em);
}

Screenshot 2024-01-26 at 17 29 54

from mdbook.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.