-
Notifications
You must be signed in to change notification settings - Fork 106
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
[Feature] --bootstrap should detect existing poetry config #197
Comments
I'm still struggling to understand how it works. pydoc-markdown --bootstrap mkdocs -I ..
> error: --bootstrap must be used as a sole argument
pydoc-markdown --bootstrap mkdocs
> created pydoc-markdown.yml
pydoc-markdown --server --open -I ..
> error: renderer 'MarkdownRenderer' cannot be used with --server |
Oh ok, it supports reading configuration from a |
Hey @melMass , sorry if the docs confused you. There's definitely room for improvement. 😄
Are you sure your |
Ahah, yes, I know how some things can seem obvious from the inside sometimes, that's why I created the issue! This is my layout: |- myLib
|- Documentation
|- pydoc-markdown.yml
|- pyproject.toml
|- moduleA
|- ..
|- moduleB
|- ..
|- setup.py and loaders:
- type: python
processors:
- type: filter
- type: smart
- type: crossref
renderer:
type: mkdocs
pages:
- title: Home
name: index
source: README.md
- title: API Documentation
contents:
- '*'
mkdocs_config:
mkdocs_config:
site_name: My Project
theme: readthedocs
All the commands I was referring to are issued from the |
@melMass That is because if you use
You need to add the search path the your configuration like so: loaders:
- type: python
search_path: [ .. ]
# ... |
I did figure how to set the path in the meantime! Oh ok I'm used to config files being loaded from I think it all boils down to detecting existing poetry config file, and either add to the file, or notify the user with a link to the config doc for instance. Just my two cents! |
So the idea here is that Pydoc-Markdown can be used quickly from the terminal to generated some API documentation in Markdown right into stdout. If you do use a configuration file, it is expected that you don't need to make any additional changes to the way Pydoc-Markdown locates your source code and generates it. Thus the options like About bootstrapping, there is definitely an issue right now when I would suggest that the user is asked whether the config should be appended to the TOML file. If the user says yes, we'll just load the templated config, convert it to TOML and append it. Otherwise, we can still write into a About the What do you think? |
Yes! I would go for the second one, creating the > created pydoc-markdown.yml
> info: We detected a pyproject.toml,
note that you can use this file as your configuration.
see https://github.com/NiklasRosenstein/pydoc-markdown/blob/develop/docs/configuration.md Or maybe ask for user input as bootstrap would rarely be run headless (C.I etc...)
Yes I think adding > warning: using `-I` aka `search-path`, ignoring the config file. can be useful. Tbf the commands help is explaining things quite clearly, I was just confused by the bootstrapping/out-of-source documentation aspect of things. I have yet to test, but I think it should be also stated that the generated files are store in a Great job on this, it's exactly what I was looking for and it's much easier to integrate with custom tools than the other methods I tried. |
Hi,
Sorry If I'm dumb, but I don't find the quickstart to give enough information, like from where are you supposed to issue the command, your python project root? I'm using poetry and running
pydoc-markdown --bootstrap mkdocs
from the root returnserror: file already exists: 'pyproject.toml'
, will it create a subfolder, things like that.I'm pretty sure I will find the solution to all of this after playing with it a bit, but I guess I'm not the only one wondering those and it could be streamlined in the quickstart doc
Thanks for PyDoc ❤️
Close at will
The text was updated successfully, but these errors were encountered: