Spaces:
Sleeping
Sleeping
Create governance_site.py
Browse files- governance_site.py +15 -0
governance_site.py
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
|
| 3 |
+
def load_governance_doc(name="index.html"):
|
| 4 |
+
base = "governance_docs"
|
| 5 |
+
path = os.path.join(base, name)
|
| 6 |
+
|
| 7 |
+
if not os.path.exists(path):
|
| 8 |
+
return "<h3>Governance documentation unavailable.</h3>"
|
| 9 |
+
|
| 10 |
+
with open(path, "r", encoding="utf-8") as f:
|
| 11 |
+
html = f.read()
|
| 12 |
+
|
| 13 |
+
# Safety: strip scripts for HF sandbox
|
| 14 |
+
html = html.replace("<script", "<script")
|
| 15 |
+
return html
|