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

Text files generation #43

Closed
b09dan opened this issue Mar 10, 2019 · 6 comments

Comments

2 participants
@b09dan
Copy link

commented Mar 10, 2019

Expected Behavior

At the home page of the project it is stated that library has an ability of "Plain text, HTML, or PDF output". It is expected to have such command:

pdoc3 --text --text-dir ./documentation_dir module_name

Actual Behavior

pdoc3 help says that there is no such option like text and it does't provide a name of this option: pdoc3: error: unrecognized arguments: --text

Additional info

  • pdoc version: pdoc3 0.5.3
@kernc

This comment has been minimized.

Copy link
Contributor

commented Mar 11, 2019

Have you tried plainly pdoc module_name which outputs slightly adapted original markdown?

@b09dan

This comment has been minimized.

Copy link
Author

commented Mar 11, 2019

@kernc thanks for reply! Yeah, but I thought it has different functionality, as it doesn't look whole project recursively, like pdoc with option “--html” does. May be there is a possibility to have similar output (text-markdown file on each module that are specified through imports in selected module)?
E.g. it is result of pdoc3 --html --html-dir documentation backend:

documentation/
└── backend
    ├── config
    │   ├── dev_config.html
    │   ├── index.html
    │   ├── params.html
    │   └── prod_config.html
    ├── helpers
    │   ├── index.html
    │   └── is_int.html
    ├── index.html
    ├── modules
    │   ├── ai_consultant
    │   │   ├── index.html
    │   │   ├── models.html
    │   │   └── route.html
    │   ├── authentication
    │   │   ├── auth.html
    │   │   ├── index.html
    │   │   └── models.html
    │   ├── home_page
    │   │   ├── home_page.html
    │   │   └── index.html
    │   ├── index.html
    │   ├── process_mining
    │   │   └── index.html
    │   └── survey
    │       ├── index.html
    │       ├── interact
    │       │   ├── answer_creator.html
    │       │   ├── index.html
    │       │   ├── session_setter.html
    │       │   └── survey_getter.html
    │       ├── manage
    │       │   ├── index.html
    │       │   ├── language_getter.html
    │       │   ├── survey_assessment.html
    │       │   ├── survey_creator.html
    │       │   ├── survey_dimension_type_getter.html
    │       │   ├── survey_getter.html
    │       │   ├── survey_scope_getter.html
    │       │   ├── survey_updater.html
    │       │   └── user_getter.html
    │       ├── models.html
    │       └── routes.html
    └── run.html

And it is output of pdoc3 backend:

Module backend
==============

Sub-modules
-----------
* backend.config
* backend.helpers
* backend.modules
* backend.run
@kernc

This comment has been minimized.

Copy link
Contributor

commented Mar 11, 2019

Indeed, it's different. I believe the text output was initially meant more for instant in-terminal module doc viewing.

You could achieve about the thing you expect with:

find project/dir -name '*.py' \! -ipath '*/_[a-z]*' \
    -exec sh -c 'mkdir -p "md/$(dirname "$1")"; pdoc "$1" > "md/$(dirname "$1")/$(basename "$1").md"' -- {} \;

tree md

This is somewhat involved, and it's not particularly portable, so your request is justified.

May I ask why you seek to get text files?

@kernc kernc added the enhancement label Mar 11, 2019

@b09dan

This comment has been minimized.

Copy link
Author

commented Mar 11, 2019

@kernc thanks, I also thought about similar solution! I will try to implement it in your library in the future!

May I ask why you seek to get text files?

I have two main reasons:

  1. I need to import generated documentation to the project wiki. It doesn't take any effort with markdown.
  2. My chef wants to see docs in single document (It is easy to convert markdown files to .docx/.pdf/.odt)

@kernc kernc changed the title There is no command for generating documentation in text format Text files generation Mar 11, 2019

@b09dan

This comment has been minimized.

Copy link
Author

commented Mar 19, 2019

@kernc

This comment has been minimized.

Copy link
Contributor

commented Mar 19, 2019

I think, ideally, --html-dir would become --output-dir, and that's where the files lie.

@kernc kernc added this to the 0.6.0 milestone Apr 22, 2019

@kernc kernc closed this in 71b1783 Apr 24, 2019

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.