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
- Host: GitHub
- URL: https://github.com/samfisherirl/jinja-pywebview-bs-guis-without-flask
- Owner: samfisherirl
- Created: 2023-02-23T09:21:00.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-08-18T18:25:01.000Z (almost 2 years ago)
- Last Synced: 2025-02-21T10:07:20.535Z (3 months ago)
- Topics: bootstrap, css, jinja2, jinja2-template, jinja2-templates, js, json, pywebview
- Language: HTML
- Homepage:
- Size: 2.05 MB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
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 `