beautifier / js-beautify

Beautifier for javascript
https://beautifier.io
MIT License
8.55k stars 1.37k forks source link

Python port of HTML-beautifier - how to approach ? #2292

Open jkmnt opened 1 month ago

jkmnt commented 1 month ago

I (mostly) ported the html formatter to python: https://github.com/jkmnt/js-beautify-py-html/tree/pyhtml/python/jsbeautifier/html

It passes the smoke test :-) The missing parts are calls to the embedded js/css formatters and cli.

Any chances of it to be eventually merged ? If yes, I would like to have need some guidance on cli part (now the js and css beautifiers are separate packages in Python) and running HTML tests. If no, I'll just finalize and use my own fork.

I added a some typehints to the core to simplify the porting. Maybe merging these is a good first step, since there are no runtime changes.

jkmnt commented 1 month ago

I guessed the tests are must in any case. It passes all the tests now :)