gpoore / codebraid

Live code in Pandoc Markdown
BSD 3-Clause "New" or "Revised" License
376 stars 13 forks source link

AttributeError and TypeError in normal use #3

Closed jwnki closed 5 years ago

jwnki commented 5 years ago

Hi, This looks like a really nice project, and I really wanted to give it a try but unfortunately it crashes badly. First, invoking simply codebraid (without any args) results in:

Traceback (most recent call last):
  File "/home/<user>/venv/pyactr/bin/codebraid", line 11, in <module>
    sys.exit(main())
  File "/home/<user>/venv/pyactr/lib/python3.6/site-packages/codebraid/cmdline.py", line 57, in main
    args.func(args)
AttributeError: 'Namespace' object has no attribute 'func'

And using codebraid pandoc rep.md -o rep.pdfreturns:

Traceback (most recent call last):
  File "/home/<user>/venv/pyactr/bin/codebraid", line 11, in <module>
    sys.exit(main())
  File "/home/<user>/venv/pyactr/lib/python3.6/site-packages/codebraid/cmdline.py", line 57, in main
    args.func(args)
  File "/home/<user>/venv/pyactr/lib/python3.6/site-packages/codebraid/cmdline.py", line 78, in pandoc
    other_pandoc_args=other_pandoc_args)
  File "/home/<user>/venv/pyactr/lib/python3.6/site-packages/codebraid/converters/pandoc.py", line 1143, in convert
    raise TypeError
TypeError

Do you know what could be wrong?

gpoore commented 5 years ago

It should work after the latest commit. I hadn't added compatibility for the case in which Pandoc determines the output format based on the output file name, rather than receiving the format explicitly via the --to flag (which wouldn't actually work in this case anyway, since Pandoc treats PDF as a special case and automatically uses an intermediary format).

jwnki commented 5 years ago

Thanks for your quick reply! Looks like everything works now :) Keep up the good work