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

sub-Module-level variables not documented #391

Open
apassy opened this issue Mar 29, 2022 · 2 comments
Open

sub-Module-level variables not documented #391

apassy opened this issue Mar 29, 2022 · 2 comments

Comments

@apassy
Copy link

apassy commented Mar 29, 2022

Expected Behavior

Top-level variables from module file documented, e.g.
SQL_SERVER_MAX_VALUES_IN_INSERT = 1000 #: The maximum number of values in an insert statement for sql server

Actual Behavior

They don't show up in documentation

Steps to Reproduce

1.define submodule in Module
2. add variable
3. run pdoc --html -o ./docs --force ./<top-level_module>

Additional info

structure:
Top-level
|- init.py (empty)
|- submodule.py (with variable of interest)

  • pdoc version:
@apassy
Copy link
Author

apassy commented Mar 29, 2022

NM, only pep224 docs work.

Maybe add to docs?

@kernc
Copy link
Member

kernc commented Apr 3, 2022

Variable doc-comments were introduced in #292. Your example works for me with the latest version.

$ mkdir foo

$ touch foo/__init__.py

$ cat >foo/foo.py <<EOF                                                             
SQL_SERVER_MAX_VALUES_IN_INSERT = 1000 #: The maximum number of values in an insert statement for sql server

EOF

$ tree foo
foo
├── foo.py
└── __init__.py

0 directories, 2 files

$ pdoc foo.foo
Module foo.foo
==============

Variables
---------
`SQL_SERVER_MAX_VALUES_IN_INSERT`
:   The maximum number of values in an insert statement for sql server

$ pdoc --html foo
html/foo/index.html
html/foo/foo.html

$ grep SQL_SERVER_MAX_VALUES_IN_INSERT html/foo/foo.html 
<pre><code class="python">SQL_SERVER_MAX_VALUES_IN_INSERT = 1000 #: The maximum number of values in an insert statement for sql server</code></pre>
<dt id="foo.foo.SQL_SERVER_MAX_VALUES_IN_INSERT"><code class="name">var <span class="ident">SQL_SERVER_MAX_VALUES_IN_INSERT</span></code></dt>
<li><code><a title="foo.foo.SQL_SERVER_MAX_VALUES_IN_INSERT" href="#foo.foo.SQL_SERVER_MAX_VALUES_IN_INSERT">SQL_SERVER_MAX_VALUES_IN_INSERT</a></code></li>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants