Code Monkey home page Code Monkey logo

Comments (8)

lipp avatar lipp commented on July 20, 2024 1

@dleitee this improves the strman usability a lot (though, still not great)
https://doclets.io/dleitee/strman/v1.3.0

from doclets.

tolmasky avatar tolmasky commented on July 20, 2024

Hi, the real solution is for us to make them load faster. However, while we work on that, I have had success simply delaying the loading. If you look at this blog post I wrote, it loads many examples and still remains fast scrolling: http://tolmasky.com/2016/03/24/generalizing-jsx/ . The code is in that same file.

from doclets.

lipp avatar lipp commented on July 20, 2024

@tolmasky Thank you very much!!!! 💯 I'll try to integrate your temp solution.

from doclets.

lipp avatar lipp commented on July 20, 2024

@tolmasky ... sorry... could you please point me to the piece of code which handles the loading/delaying/whatever of the tonicdev examples? Thanks!!!

from doclets.

tolmasky avatar tolmasky commented on July 20, 2024

Sure, its just:

var samples = document.querySelectorAll(".highlighter-rouge");
var index = 0;
var count = samples.length;

function load(aSample)
{
    var source = Tonic.sourceFromElement(aSample);

    aSample.innerHTML = "";

    Tonic.createNotebook(
    {
        // the parent element for the new notebook
        element: aSample,

        // specify the source of the notebook
        source: source,
        nodeVersion: "4.x.x"
    });
}

function loadAll(samples, index)
{
    while (index < count && samples[index].tagName !== "DIV")
        ++index;

    if (!(index < count))
        return;

    load(samples[index]);

    setTimeout(loadAll, 1000, samples, index + 1);
}

loadAll(samples, 0);


That will crawl down and do 1 per sec.

from doclets.

lipp avatar lipp commented on July 20, 2024

@tolmasky Thanks 💯 again! This is in now...
As long as the tonic devs don't load faster, this is probably an as-good-as-possible solution, so i'll close this for now.

from doclets.

dleitee avatar dleitee commented on July 20, 2024

@lipp Thank you, I will see doclets project and verify if I can contribute with improvements and fixes.

from doclets.

tolmasky avatar tolmasky commented on July 20, 2024

Another strategy is to do what lodash has done: http://lodash.github.io (show the embed/ run it when clicked)

from doclets.

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.