Coder Social home page Coder Social logo

Comments (2)

kernc avatar kernc commented on September 22, 2024 1
  1. Could pdoc3 have the same behavior as pdoc 0.3.2 to render the documentation for all available modules if no argument provided?

This was disabled intentionally and should remain thus at least for non---http modes (e.g. text, HTML out and PDF modes). If you'd like to look into making specifying the module optional for --http mode, welcome. But I suppose this won't work so well in complex Python environments as all modules will have to be loaded to fetch the docstrings (slow, error prone) and the caching mechanics have been purged (slower).

  1. Could pdoc3 use the default localhost:8000 if no arguments are provided to --http?

I don't think it can be made optional for as long as the type is set to the checking function:

pdoc/pdoc/cli.py

Lines 93 to 109 in 24a561c

def _check_host_port(s):
if s and ':' not in s:
raise argparse.ArgumentTypeError(
"'{}' doesn't match '[HOST]:[PORT]'. "
"Specify `--http :` to use default hostname and port.".format(s))
return s
aa(
"--http",
default='',
type=_check_host_port,
metavar='HOST:PORT',
help="When set, pdoc will run as an HTTP server providing documentation "
"for specified modules. If you just want to use the default hostname "
"and port ({}:{}), set the parameter to :.".format(DEFAULT_HOST, DEFAULT_PORT),
)

There simply is no way of knowing whether the user intended a switch parameter or the next argument. That said, pdoc uses the default if simply : is passed to --http, as documented.

This was introduced in stead of a flood of separate switches for as little used a feature. At the time, I thought --http : was not too bad to type out, particularly as most command-line shells today offer readline/history ().

  1. If a module name is always required, could pdoc3 return the full URL to the specified module (see below)

More than one module can be specified. What then? It isn't that hard to click through another hyperlink. Or even just leave the tab in development open.

from pdoc.

KyleKing avatar KyleKing commented on September 22, 2024

Thanks for the feedback. I missed the shortcut on just passing :. I think you answered all my questions and I'll close this

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.