Code Monkey home page Code Monkey logo

Comments (4)

gfwilliams avatar gfwilliams commented on July 4, 2024 1

The actual reference is created in https://github.com/espruino/Espruino/blob/master/scripts/build_board_docs.py - or via make docs - it's called from https://github.com/espruino/EspruinoDocs/blob/master/build.sh#L31

But the whole website isn't public I'm afraid - but to get the page we basically just shove the generated file inside the attached wrapper.

If you're happy to make some changes to the wrapper to get this working differently that'd be really helpful - but it's used for the whole website, so I don't really want to find it's something that's broken everything.

it seems like the heading points to the sidebar entry and the sidebar entry points to the header.

That's the idea... People do use the reference html file on its own (in which case the sidebar is at the top, so it can be handy to flick to and fro)

main-template.txt

from espruinodocs.

mariusGundersen avatar mariusGundersen commented on July 4, 2024

It looks like most of the changes can be done in the carousel.css file and the sitewide.js file. I noticed now that the table of contents is moved into the sidebar using js. That isn't really needed with the following css rule:

@media (min-width: 992px) {
  #contents {
    position: fixed;
    top: 50px;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    overflow-x: hidden;
    width: 300px;
  }

  #maincontent:has(#contents) {
    margin-left: 300px;
  }
}

This way you can remove all the wrapping divs and have just

<body>
  <div id="header">...</div>
  <div id="maincontent">...</div>
</body>

The result is that the ToC is shown in the sidebar on desktop and at the top of the page on mobile devices.

The header (.navbar-wrapper) should have the rule position: sticky rather than position:absolute, and .navbar-wrapper .navbar should have margin-bottom: 0.

from espruinodocs.

gfwilliams avatar gfwilliams commented on July 4, 2024

Thanks! I've just pulled those changes in, and the reference appears to load a lot faster now it doesn't rearrange the divs in JS.

I haven't got rid of the content div yet though as I seem to recall that bootstrap kind of expected it and I think it might mess up some of the rest of the website.

from espruinodocs.

mariusGundersen avatar mariusGundersen commented on July 4, 2024

There is some bootstrap grid layout code that isn't strictly necessary, since the grid only has a single column, given that the sidebar is positioned using fixed. It's also from bootstrap 3 which had to rely on float and hacks in order to get layouts that are now pretty easy to do with grid and flexbox.

from espruinodocs.

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.