getpelican / pelican

Static site generator that supports Markdown and reST syntax. Powered by Python.
https://getpelican.com
GNU Affero General Public License v3.0
12.56k stars 1.81k forks source link

pelican-import fails without pandoc #312

Closed akavlie closed 12 years ago

akavlie commented 12 years ago

After installing BeautifulSoup, pelican-import still fails:

sh: pandoc: command not found
Traceback (most recent call last):
  File "/Users/akavlie/envs/kavlie.net/bin/pelican-import", line 283, in <module>
    main(input_type, args.input, args.markup, args.output, dircat=args.dircat)
  File "/Users/akavlie/envs/kavlie.net/bin/pelican-import", line 242, in main
    fields2pelican(fields, out_markup, output_path, dircat=dircat)
  File "/Users/akavlie/envs/kavlie.net/bin/pelican-import", line 223, in fields2pelican
    with open(out_filename, 'r', encoding='utf-8') as fs:
  File "/Users/akavlie/envs/kavlie.net/lib/python2.7/codecs.py", line 881, in open
    file = __builtin__.open(filename, mode, buffering)

The docs mention the reliance on pandoc in passing, but do not mention the need to install it manually (which I assume is the case, as it's not a Python module).

Two suggestions:

  1. The docs should give explicit instructions to install pandoc to use pelican-import, for formats other than dotclear.
  2. The pelican-import script should abort with a friendly error if it can't find pandoc, rather than the traceback above.
almet commented 12 years ago

+1 on the proposed changes. Enhancing the documentation is probably the best way to do this. We also can point users to the documentation when prompting the error at them.

Do you want to work on a fix for this?

akavlie commented 12 years ago

Added Pandoc requirement to docs in the pull request.

I see that the code already handles missing Pandoc, and it seems to be working for me now. Why did I get the traceback above the other day? I have no idea.

almet commented 12 years ago

okay, closing for now, thanks for the report.