An open API service indexing awesome lists of open source software.

https://github.com/samfisherirl/jinja-pywebview-bs-guis-without-flask

Automatically inject CSS, bootstrap, and Javascript in PyWebView GUIs for Jinja2 Template Engine without Flask
https://github.com/samfisherirl/jinja-pywebview-bs-guis-without-flask

bootstrap css jinja2 jinja2-template jinja2-templates js json pywebview

Last synced: 3 months ago
JSON representation

Automatically inject CSS, bootstrap, and Javascript in PyWebView GUIs for Jinja2 Template Engine without Flask

Awesome Lists containing this project

README

        

# Inject CSS and JS (including Bootstrap) into Pywebview + Jinja2 without flask or restructuring standard website assets.

This solution takes Pywebview with Jinja2, and loops through all files in your ./assets/ or ./templates/ looking for any file with *.js and *.css extensions. Read, and inject the code into (eg.) index.html prior to Pywebview displaying in Webview.

Rquired:

-Jinja2

-Python 3.10

-minify-html

#

This is a new project as of 2/23/23, expect small bugs and changes daily.

#

Very simply, before the index file loads, main.py loops through all files in /templates/. For all files with *.css, they get read and inserted right before the `` tag, inbetween ``and ``. Same thing for js happens before end of `