add wfh files

This commit is contained in:
WorldTeacher
2024-02-19 18:12:19 +01:00
parent 506206a0fb
commit 6d1119783f
13 changed files with 6618 additions and 1491 deletions

View File

@@ -0,0 +1,37 @@
import sys
#from PyQt6 import Webview
from PySide6.QtWebEngineWidgets import QWebEngineView
import os
from PySide6.QtWidgets import QTabWidget
documentation_path = "docs"
class DocumentationViewer(QMainWindow):
def __init__(self):
super().__init__()
self.setWindowTitle("Documentation Viewer")
self.setGeometry(100, 100, 800, 600)
self.tabs = QTabWidget()
self.setCentralWidget(self.tabs)
self.set_documentation_tabs()
def set_documentation_tabs(self):
files = [os.path.join(documentation_path, file) for file in os.listdir(documentation_path) if file.endswith(".html")]
for file in files:
with open(file, "r") as f:
html_content = f.read()
tab_name = os.path.basename(file).split(".")[0]
self.load_documentation(tab_name, html_content)
def load_documentation(self, tab_name="Documentation", html_content="<h1>Documentation</h1><p>Your HTML documentation content goes here.</p>"):
documentation_tab = QWebEngineView()
documentation_tab.setHtml(html_content)
self.tabs.addTab(documentation_tab, tab_name)
if __name__ == "__main__":
app = QApplication(sys.argv)
viewer = DocumentationViewer()
viewer.show()
sys.exit(app.exec())