bruiken / Notepad--

Notepad--, a lightweight web based editor with numerous optional features.
MIT License
3 stars 0 forks source link

Implementing a better system to include features #4

Closed bruiken closed 3 years ago

bruiken commented 3 years ago

When we merge #1, we officially have our first feature.

Note that this feature is included using regular if-statements in python. It would be nice if we can completely put this code outside of the app.py file. This could be done using AOP and pointcuts. If we create a function on which we can put pointcuts to add endpoints we can already remove the syntax highlighting feature from app.py.

Extra javascript is most definitely also needed, the syntax-highlighting way of dealing with this is fine, if we create separate folders for the custom js/css for a feature, we can just ignore the folder altogether if we are not using that feature. For possible releases, this means that we can just remove the folder if the client does not want that feature. Or on the contrary, add it when the client really wants it.

For the templates, we might want to do something similar to the idea of app.py. We can create functions such as load_scripts() and load_styles() which we can extend using AOP. Then we can call those functions in the templates. This way we can also remove all feature-specific code from the templates.

Justin-Reniers commented 3 years ago

Has been implemented through AOP.