click-contrib / click-man

Automate generation of man pages for python click applications :star:
MIT License
169 stars 35 forks source link

How to generate man pages at build time ? #7

Open gtristan opened 7 years ago

gtristan commented 7 years ago

Hi,

I realize from reading your README that you may not consider this a bug, this is fine I'm not arguing this, but I need some help to figure out how to do what the README recommends not doing, I've spent an entire day swimming in setuptools/distutils code and still have not resolved this.

Currently, I have a horrible work around which is to generate the man pages in tree and commit the result to my source tree, which means I need to manually re-run and re-commit man pages whenever my frontend CLI commands and/or documentation changes.

After this, I am able to specify with setup() 'data_files' that the man pages go into ${prefix}/share/man/man1, this part works very well because:

My related setup.py is here, and I tried to follow this blog post for the purpose of ensuring the man pages are automatically built in the build stage, but I can't seem to wrap my head around this or get it to work.

From what I understand, I should be able to:

I am sadly not able to achieve the above, or have not understood the correct way to do this.

Any help here would be really greatly appreciated, thanks.