neocotic / europa

Library for converting HTML into valid Markdown
MIT License
159 stars 24 forks source link

Refactor plugin and preset API #83

Closed neocotic closed 2 years ago

neocotic commented 2 years ago

Previously, the plugin and preset API was OOP and this could lead to problems due to inheritance and exact version matching. Additionally, the source code for all predefined plugins and presets was included in that of Europa Core, limiting future attempts to perform independent package versioning.

Not only is the plugin and preset API now purely interface based but all predefined plugin and presets have now been split out into their own packages within the monorepo. The Europa methods to register plugins and presets have also changed as a result.

A Europa Build package has also been created to simplify the generation and maintenance of plugin and preset packages.

Hidden in this commit is an addition of a new Service that Europa Core implementations must provide, CharsetService, which provides the EOL character which can be used by all plugins to ensure consistency on the platform. Browser's always use NL but Node.js will use EOL from the os module.