TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Zero-Config Documentation Websites for Python

233 pointsby timothycrosleyover 5 years ago

12 comments

danking00over 5 years ago
Tried this on our project, GitHub.com&#x2F;hail-is&#x2F;hail.<p>Sphinx is a persistent thorn in our side, but we&#x27;ve made it work. A couple things I had to do to get this working:<p>- something thinks a filename with dots (e.g. example.8bits.bgen) means there is a python module that needs to be imported (e.g. example), and fails when that does not exist; we have files like this in a data directory<p>- I could not quickly figure out how to ignore files, so I had to delete a Sphinx conf.py file.<p>- Sphinx resolves the _templates folder relative to where it is called, not relative to the doc string&#x27;s source file, so I had to add several symlinks (rather than manually edit every doc string).<p>---<p>OK docs are generating. Quite slow, maybe a couple minutes. Looks like one core is at 100% during this process. We&#x27;ve got ~400 files. Maybe its parsing some data files? The whole directory is 318 MB.<p>---<p>Now I&#x27;m looking at the docs.<p>First thing I notice is that Python type hint forward references break everything. Consider:<p><pre><code> class GroupedMatrixTable( parent: &#x27;MatrixTable&#x27;, ... </code></pre> The generated doc page is missing the class name and the entire class definition is inlined as a preformatted block (with highlighting :shrug:).<p>All my python function def&#x27;s seem to be missing the function name?<p>No arg functions look really weird<p><pre><code> def ( ) </code></pre> So all our docs are in ReST (thanks Sphinx :|). This means they&#x27;re not valid Markdown. It seems that invalid markdown in a class doc string can break the formatting of all the methods (presenting them again as one reformatted block).<p>---<p>On the bright side, the mobile version looks great and the search works better than my experience with Sphinx.<p>EDIT: formatting
评论 #20802118 未加载
评论 #20802266 未加载
评论 #20802194 未加载
dragonshover 5 years ago
My team at present use sphinx-doc[1] and generate both HTML and PDF. We write the documentation as part of the code using docstring and then other documents manually in rst. We use Sphinx plugin to automatically generate document from code.<p>I will give portray a try and see.<p>Is there any comparison between Sphinx-doc and portray?<p>[1] <a href="http:&#x2F;&#x2F;www.sphinx-doc.org&#x2F;en&#x2F;master&#x2F;" rel="nofollow">http:&#x2F;&#x2F;www.sphinx-doc.org&#x2F;en&#x2F;master&#x2F;</a>
评论 #20801674 未加载
评论 #20801126 未加载
评论 #20802211 未加载
gillesjacobsover 5 years ago
This is great! You hit the need for configless docsites that many Pythonistas who are in data science and research have: we write a lot of experimental and prototype code. Docstring documentation in itself feels like a considerable investment in these contexts so anything that helps publication without any hassle is more than welcome.<p>Are you planning to support Restructured Text next to Markdown? I find ResT is used more often (in the machine learning ecosystem at least).
评论 #20803185 未加载
noobiemcfoobover 5 years ago
I just used this on a random project I happen to be building documentation for. I&#x27;m pretty in love with the minimalism of &#x27;portray&#x27;. I wish there was a chance to get my team to use it, but I&#x27;ll definitely be using it in my personal projects going forward!
contravariantover 5 years ago
It&#x27;s always kind of interesting to look at a document created by the tool it&#x27;s describing.
评论 #20801675 未加载
hultnerover 5 years ago
Very neat, I especially like it&#x27;s compability with mkdocs-themes. Will try this out on some project :)
MadWombatover 5 years ago
I am confused, all I get is &quot;No Python project found in the given directory&quot;.
评论 #20803525 未加载
peteretepover 5 years ago
Excited to try this. From a Perl background, used to POD, Python&#x27;s doc systems have been a sewer.
amjithover 5 years ago
How is the search implemented?
评论 #20802222 未加载
评论 #20802230 未加载
fucking_tragedyover 5 years ago
How easy is it to theme for when Material starts looking dated?
评论 #20802128 未加载
abakusover 5 years ago
Kudos to using toml for configuration.
isbjorn16over 5 years ago
I was super pumped by this, and took some time to look into pdoc3 too.<p>- <a href="https:&#x2F;&#x2F;github.com&#x2F;pdoc3&#x2F;pdoc&#x2F;issues&#x2F;87" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;pdoc3&#x2F;pdoc&#x2F;issues&#x2F;87</a><p>- <a href="https:&#x2F;&#x2F;github.com&#x2F;pdoc3&#x2F;pdoc&#x2F;issues&#x2F;64" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;pdoc3&#x2F;pdoc&#x2F;issues&#x2F;64</a><p>That&#x27;s a hard pass from me. I&#x27;m not going to link my employer&#x27;s name (much less my own name) to anything with a swastika on it.
评论 #20803170 未加载
评论 #20803672 未加载
评论 #20805091 未加载
评论 #20803206 未加载
评论 #20804003 未加载
评论 #20803621 未加载
评论 #20803658 未加载
评论 #20803691 未加载