Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default HTML output line wraps source code #112

Open
peterjc opened this issue Jul 29, 2016 · 0 comments

Comments

Projects
None yet
1 participant
@peterjc
Copy link

commented Jul 29, 2016

I can reproduce this locally, but also:

  1. Browse to http://pdoc.burntsushi.net/pdoc
  2. Scroll to the first yellow "SHOW SOURCE" button
  3. Click "SHOW SOURCE"
  4. Look at the displayed code

In both Safari and Chrome I see this where I have marked the line breaks with *

"""
Module pdoc provides types and functions for accessing the public *
documentation of a Python module. This includes modules (and *
sub-modules), functions, classes and module, class and instance *
variables.  Docstrings are taken from modules, functions and *
classes *
using the special `__doc__` attribute. Docstrings for variables are *
extracted by examining the module's abstract syntax tree. *

The public interface of a module is determined through one of two *
ways. If `__all__` is defined in the module, then all identifiers *
in *
that list will be considered public. No other identifiers will be *
considered as public. Conversely, if `__all__` is not defined, then *
`pdoc` will heuristically determine the public interface. There are *
three rules that are applied to each identifier in the module: *
...

Notice classes and in have been wrapped to the next line. These lines were only 68 characters:

>>> len("variables.  Docstrings are taken from modules, functions and classes")
68
>>> len("ways. If `__all__` is defined in the module, then all identifiers in")
68

In view of the current PEP8 guidelines https://www.python.org/dev/peps/pep-0008/#maximum-line-length the default output from pdoc should ideally show lines of up to 79 characters without line wrapping.

Also, perhaps the source blocks should automatically use horizontal scrolling if required rather than line wrapping?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.