pycco-docs / pycco

Literate-style documentation generator.
https://pycco-docs.github.io/pycco/
Other
845 stars 143 forks source link

Support for non-standard file extensions (rpy, tac...) #31

Closed lvh closed 12 years ago

lvh commented 13 years ago

Hi!

I tried to use pycco today to document some tutorial code. That code lives in rpy files -- long story short, they're Python, except they allow me to do some webby stuff with Twisted with less boilerplate.

Obviously, in order to teach pycco how to deal with that, I had to edit the source. It's kind of shitty that people need my specific modified version of pycco to get anything done. Ideally pycco would be able to figure out it's Python, despite the funky extension.

I have two potential solultions to this problem:

  1. pycco --force-type=.py ...
  2. Use python-magic (Python bindings for libmagic) when available to figure out what kind of file something is, instead of relying on the extension. This does not mean an extra dependency: you can try to use magic, if it doesn't work, fall back to the extension mechanism.

Which one do you like best? Perhaps both can live side by side? If my pycco + sphinx prototypal documentation is received well, I might implement it.

cheers, lvh

fitzgen commented 13 years ago

Hi!

I think that using python-magic would be the cleaner of the two options.

Note that I am not actively developing this project anymore, but if you provide me with a clean pull request (feature branch, on-topic commits, etc) I would have no problem merging this in to master.

Good luck!

Nick