Coder Social home page Coder Social logo

live reload when serving locally about pdoc HOT 3 CLOSED

cs01 avatar cs01 commented on June 16, 2024
live reload when serving locally

from pdoc.

Comments (3)

kernc avatar kernc commented on June 16, 2024 1

If something can be done in about three lines of WebSocket JS API and maybe twice that on the Python end without heavy extra dependencies, absolutely love to see it.

from pdoc.

kernc avatar kernc commented on June 16, 2024

While the web page needs to be refreshed manually, the server doesn't (shouldn't) require to be shut down and restarted as module reloading is in place.

pdoc/pdoc/__init__.py

Lines 169 to 175 in f5b4a54

if inspect.ismodule(module):
if module.__name__.startswith(__name__):
# If this is pdoc itself, return without reloading.
# Otherwise most `isinstance(..., pdoc.Doc)` calls won't
# work correctly.
return module
return importlib.reload(module)

If there's a bug somewhere, the import_module() mechanism is being improved as we speak.

from pdoc.

cs01 avatar cs01 commented on June 16, 2024

Ah I was editing docs for pdoc itself, hence the server wasn't reloading. Still the client-side reload is a nice feature. What do you think?

from pdoc.

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.