chore: remove trailing whitespace from README.md formatting

This commit is contained in:
2025-11-16 00:48:39 +00:00
parent f83770683a
commit ed7d316199
4 changed files with 160 additions and 55 deletions
+119 -52
View File
@@ -53,48 +53,122 @@ class LegalDocument(ABC):
return self.get_header() + self.get_content() + self.get_footer()
def to_html(self) -> str:
"""Generate the complete document in HTML format."""
# Content is already HTML, just wrap in basic HTML structure
"""Generate the complete document as Jinja2 template extending base.html."""
html_content = self.get_content()
html_content = f"""<html>
<head>
<title>{self.title}</title>
<style>
body {{
font-family: 'Times New Roman', serif;
line-height: 1.6;
max-width: 800px;
margin: 0 auto;
padding: 20px;
color: #333;
}}
h1, h2, h3 {{
color: #2c3e50;
margin-top: 30px;
}}
h1 {{ font-size: 2em; border-bottom: 2px solid #3498db; padding-bottom: 10px; }}
h2 {{ font-size: 1.5em; border-bottom: 1px solid #bdc3c7; padding-bottom: 5px; }}
ul {{ margin-left: 20px; }}
li {{ margin-bottom: 8px; }}
strong {{ color: #2c3e50; }}
</style>
</head>
<body>
<h1>{self.title}</h1>
<p><em>Last Updated: {self.last_updated}</em></p>
template_content = f"""{{% extends "base.html" %}}
{{% block title %}}{self.title} - MyWebdav{{% endblock %}}
{{% block description %}}{self.title} for MyWebdav cloud storage service.{{% endblock %}}
{{% block extra_css %}}
<style>
.legal-content {{
max-width: 900px;
margin: 0 auto;
padding: 3rem 2rem;
background: white;
border-radius: 8px;
}}
.legal-title {{
font-size: 2.5rem;
font-weight: 700;
color: #1565c0;
margin-bottom: 1rem;
padding-bottom: 1rem;
border-bottom: 3px solid #1976d2;
}}
.legal-updated {{
color: #666;
font-style: italic;
margin-bottom: 2rem;
}}
.legal-content h2 {{
font-size: 1.75rem;
color: #333;
margin-top: 2rem;
margin-bottom: 1rem;
padding-bottom: 0.5rem;
border-bottom: 2px solid #e0e0e0;
}}
.legal-content h3 {{
font-size: 1.25rem;
color: #555;
margin-top: 1.5rem;
margin-bottom: 0.75rem;
}}
.legal-content p {{
line-height: 1.8;
color: #555;
margin-bottom: 1rem;
}}
.legal-content ul {{
margin-left: 2rem;
margin-bottom: 1rem;
}}
.legal-content li {{
margin-bottom: 0.5rem;
line-height: 1.6;
color: #555;
}}
.legal-content strong {{
color: #333;
font-weight: 600;
}}
.legal-contact {{
margin-top: 3rem;
padding: 2rem;
background: #f5f5f5;
border-radius: 8px;
border-left: 4px solid #1976d2;
}}
.legal-contact h3 {{
color: #1565c0;
margin-top: 0;
}}
@media (max-width: 768px) {{
.legal-title {{
font-size: 2rem;
}}
.legal-content {{
padding: 2rem 1rem;
}}
}}
</style>
{{% endblock %}}
{{% block content %}}
<div class="legal-content">
<h1 class="legal-title">{self.title}</h1>
<p class="legal-updated">Last Updated: {self.last_updated}</p>
{html_content}
<hr>
<h3>Contact Information</h3>
<p>If you have any questions about this {self.title.lower()}, please contact us:</p>
<ul>
<li><strong>Email:</strong> <a href="mailto:{self.contact_email}">{self.contact_email}</a></li>
<li><strong>Website:</strong> <a href="{self.website}">{self.website}</a></li>
<li><strong>Address:</strong> MyWebdav Technologies, European Union</li>
</ul>
<p>MyWebdav Technologies</p>
</body>
</html>"""
return html_content
<div class="legal-contact">
<h3>Contact Information</h3>
<p>If you have any questions about this {self.title.lower()}, please contact us:</p>
<ul>
<li><strong>Email:</strong> <a href="mailto:{self.contact_email}">{self.contact_email}</a></li>
<li><strong>Website:</strong> <a href="{self.website}">{self.website}</a></li>
<li><strong>Address:</strong> MyWebdav Technologies, European Union</li>
</ul>
</div>
</div>
{{% endblock %}}
"""
return template_content
class PrivacyPolicy(LegalDocument):
@@ -867,28 +941,21 @@ def get_all_legal_documents() -> Dict[str, LegalDocument]:
}
def generate_legal_documents(output_dir: str = "static/legal"):
"""Generate all legal documents as Markdown and HTML files."""
def generate_legal_documents(template_dir: str = "templates/legal"):
"""Generate all legal documents as Jinja2 templates."""
import os
os.makedirs(output_dir, exist_ok=True)
os.makedirs(template_dir, exist_ok=True)
documents = get_all_legal_documents()
for doc_name, doc in documents.items():
# Generate Markdown
md_filename = f"{doc_name}.md"
md_path = os.path.join(output_dir, md_filename)
with open(md_path, "w") as f:
f.write(doc.to_markdown())
# Generate HTML
html_filename = f"{doc_name}.html"
html_path = os.path.join(output_dir, html_filename)
html_path = os.path.join(template_dir, html_filename)
with open(html_path, "w") as f:
f.write(doc.to_html())
print(f"Generated {md_filename} and {html_filename}")
print(f"Generated {html_filename}")
if __name__ == "__main__":