JessicaTegner / pypandoc

Thin wrapper for "pandoc" (MIT)
http://pypi.python.org/pypi/pypandoc/
Other
875 stars 111 forks source link

make meaningless encoding parameter from convert_file method deprecated #340

Closed chrisdecker1201 closed 1 year ago

chrisdecker1201 commented 1 year ago

I think this encoding parameter is a relic of copying the convert_text method, because it's not used.

As far as I understood the current behavior of the convert_file method, it will just execute pandoc with the given file(s).

I think there might be the possibility to implement the encoding parameter in two ways:

  1. check the encoding and bring an error if it's the wrong encoding
  2. convert the given encoding to utf-8 in a temporary file and use this temporary file as input for pandoc

Nevertheless, I think to remove confusion it might be the best solution to just remove the parameter :)

JessicaTegner commented 1 year ago

@chrisdecker1201 I agree. We could remove it. TO do this, I would suggest having it in the function signature as is (basically current behaviour), but issue a deprecation warning that it will be removed in pypandoc 1.13 so 1.11 (current) 1.12 (warning) 1.13 (removed).

Let me know what you think

chrisdecker1201 commented 1 year ago

@JessicaTegner I think this is a good idea. But I've no idea how to set this property to deprecated.

JessicaTegner commented 1 year ago

@chrisdecker1201 it's not that complicated, it is the following:

chrisdecker1201 commented 1 year ago

@JessicaTegner Like that?

Thank you for taking your time for this 🙂

chrisdecker1201 commented 1 year ago

@JessicaTegner Just question: Do you just remove the parameter then in version 1.13 or should I prepare a PR?

JessicaTegner commented 1 year ago

@chrisdecker1201 there is really 2 options.