sphinx-contrib / emojicodes

An extension to use emoji codes in your Sphinx documentation! 😍
https://sphinxemojicodes.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
50 stars 15 forks source link

RemovedInSphinx40Warning: The app.add_javascript() is deprecated #19

Closed domdfcoding closed 4 years ago

domdfcoding commented 4 years ago

Hi,

sphinxemoji.py calls app.add_javascript() three times on lines 60, 61 and 62 (right at the bottom of the file). This function was renamed to add_js_file in Sphinx version 1.8 and the old version will be removed in Sphinx 4.0.

Currently Sphinx only throws a warning about this but eventually it will break. It looks like the two functions have the same syntax, so the fix should be as simple as changing the name in sphinxemoji.py.

See https://www.sphinx-doc.org/en/master/extdev/appapi.html#sphinx.application.Sphinx.add_js_file for a bit more info.

Peque commented 4 years ago

@domdfcoding Thanks for reporting! Would you mind opening a pull request with the change? :blush:

domdfcoding commented 4 years ago

Done.

I realised it's actually only two instances of app.add_javascript(); the third one is app.add_stylesheet(), which becomes app.add_css_file().