-
Notifications
You must be signed in to change notification settings - Fork 17
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
Packaging docs / documentation serving #13
Comments
Thanks a lot for your interest and your ideas, I think I considered most of them at some point, and they are definitely in the long term plan but with caveats
I think it is reasonable, though PyPI/Conda and other package managers do both a lot more and not enough. For documentation we do not need dependency solving; and/or we could have multiple version of the docs installed to know about future deprecations. Plus the install step need to run the crosslink step; so that sort of goes against the direction package manager are going to which is to just unpack a zip with the right links. So I have the feeling that's shoving a round peg in a square hole, though I'd love to have package manger like condaundestand how to install the docs.
That should be really limited, for security and perf reason you really want to avoid executing code when viewing docs; I guess you could use placeholders in docs that re filled when viewing live docs, and that's I don't want to tackle initially. the first pass will be really narrow in scope.
Yes, but I think this is just a toolink question. Not easy to implement, but with the right datastructure on disk it should be pretty straightforward to have the equivalent of an editable install.
I think those two are the same – people just tend to see both differently. Right not the implementation only allow to render If you squint a bit you realize that
Thanks, that's my view as well, I would appreciate any work on any of the idea you presented; right now I'm mostly focusing on the really core idea, and the minimal useful subset (better rendering of |
Is it possible to have this cross-linking done at access time, if Papyri serves as a documentation server? I agree with the sentiment that things should not be done at install time (otherwise we just move back towards setuptools-only installers). I think this probably relates to the idea of an editable install, though.
Hmm, I suppose this depends upon how Papyri integrates into IPython - how it knows which documentation corresponds to which token / object. Right now I know that we have a bit of everything going on with Jedi integration + IPython.
Yes, I quite agree. The IR is, after all, probably generated from the Thanks for the quick reply @Carreau, I'll throw some of my thoughts towards this when I first get a chance. |
Yes/No. the forward reference can, not the backward, or you would have to scan all files (assuming installation is dezip
Well, not doing things at install time fall two categories IMHO.
The first one is problematic, but the second one is not. For example conda and pip do install entrypoints right ? The problem with "execute at install" is when the code you execute is part of package you install as you have no clue Admittedly my current choices are to do as much work at install time, as I hate to wait even a tiny bit when I'm That is of course not what you want when developing a library for sure; but I think that could be arranged, The data store is currently an abstraction, and nothing would prevent us from having a hook that make some of the files But for the time being I don't want to deal with the concurrency issues with sqlite and files are way more debug-able I've also seen that sqlite now have ability to store and hook into json, that might be the perfect case to store a graph At least all of the above are my thoughts, i can be convince i'm wrong and proven otherwise. My hope is that if docbundles are standardized, then multiple tooling with different trade off will emerge (or be Though, if you want to try some changes, please go ahead, I would be happy to merge explorations and options to see
For the For non-docstrings, I don't think it matters, as you would already be "in papyri" while you navigate. So as long as each Ok, already too long so stopping here, and please feel free to experiment and send PRs to test ideas. |
Hi @Carreau, this is a really cool project!
I was thinking about this today when considering docstrings in Literary.
Background
TL;DR Literary enables you to develop a package with Jupyter Notebooks. Notebooks form the source+docs+tests, whilst there is a build step that produces specialised views (e.g. pure Python source for PyPI, clean rendered docs, etc). During development, notebooks can be imported via an import hook.
I'm planning on treating specially tagged Markdown cells as docstrings, so that there can be rich markup instead of plain-old-text. The best approach for this (I think) is using MyST markdown (which jupyterlab-myst can render in the source notebook), which can then be used with Papyri and Sphinx to generate the intermediate Papyri IR.
Proposed Developer Features
There are a couple of features that I think might be useful for Papyri to support. To be clear, these are not "can you add this" ideas; rather, I am curious as to whether these sorts of features are aligned with your view of the direction of the project.
data_files
.It might be useful for package authors to leverage the existing packaging system (PyPI / conda-forge) to distribute documentation. I'm not an expert here, so there might be unforeseen issues with this, but I wonder whether having
numpy-docs
installed as an extras package fornumpy
would be a good way of bundling documentation._rich_doc_
I would like to be able to annotate generated modules with metadata that would provide Papyri with the IR for each object. I imagined something like
_papyri_ir_
or something analogous to__doc__
. I did see your comment that suggests this might already be a feature of sorts - If Literary places the markdown in__doc__
, then it would seem that Papyri would implement a system to determine how to parse it. Maybe this is what I want?Whilst the above point enables IR generation for Python objects, if this IR references other parts of the API, I would like to be able to generate that IR for Papyri. For my use case, notebooks will be the main document format, anduring development, I don't want users to have to run an
update-docs
-like command in order to be able to follow documentation links. It would be nice if there were some way besidesdata_files
to provide documentation i.e. a documentation server. The idea here is that Literary would provide a plugin to generate documentation modules on-the-fly for notebook-backed Python modules. This is a very use-case specific request, so I realise that it might not align with the scope of the tool.One thing that might be confusing here is that I feel as though Papyri is attempting to do many different things, including:
object?
, orhelp(object)
I'm not totally clear yet on how these two different things interact;
__doc__
is usually a subset of the documentation, but in the existing IPython space there is no navigation, just__doc__
renderingI hope I've distinguished between the two carefully.
Regardless of my use case, I think this is a really exciting idea for the Jupyter ecosystem. Documentation rendering is the one thing that hasn't really moved forward with the rest of the Jupyter tools, and this project would make a big difference to the every-day experience of developers.
The text was updated successfully, but these errors were encountered: