Compare commits

..

No commits in common. "b17608c3c5d76b6d0a33594fa6a3e590dec5fda4" and "d39398113e11d877cee384ece30b0392f165483b" have entirely different histories.

6 changed files with 4 additions and 77 deletions

View File

@ -1 +1 @@
v20260113-01-changelog-markdown-render v20260112-18-changelog-from-gitea

View File

@ -7,4 +7,3 @@ python-dateutil==2.9.0.post0
gunicorn==23.0.0 gunicorn==23.0.0
requests==2.32.3 requests==2.32.3
reportlab==4.2.5 reportlab==4.2.5
Markdown==3.6

View File

@ -1,7 +1,5 @@
from .routes_shared import * # noqa: F401,F403 from .routes_shared import * # noqa: F401,F403
import markdown
GITEA_CHANGELOG_RAW_URL = ( GITEA_CHANGELOG_RAW_URL = (
"https://gitea.oskamp.info/ivooskamp/backupchecks/raw/branch/main/docs/changelog.md" "https://gitea.oskamp.info/ivooskamp/backupchecks/raw/branch/main/docs/changelog.md"
@ -13,7 +11,6 @@ GITEA_CHANGELOG_RAW_URL = (
@roles_required("admin", "operator", "reporter", "viewer") @roles_required("admin", "operator", "reporter", "viewer")
def changelog_page(): def changelog_page():
changelog_md = "" changelog_md = ""
changelog_html = ""
error = None error = None
try: try:
@ -25,24 +22,12 @@ def changelog_page():
if resp.status_code != 200: if resp.status_code != 200:
raise RuntimeError(f"HTTP {resp.status_code}") raise RuntimeError(f"HTTP {resp.status_code}")
changelog_md = resp.text or "" changelog_md = resp.text or ""
changelog_html = markdown.markdown(
changelog_md,
extensions=[
"fenced_code",
"tables",
"sane_lists",
"toc",
],
output_format="html5",
)
except Exception as exc: # pragma: no cover except Exception as exc: # pragma: no cover
error = f"Unable to load changelog from Gitea ({GITEA_CHANGELOG_RAW_URL}): {exc}" error = f"Unable to load changelog from Gitea ({GITEA_CHANGELOG_RAW_URL}): {exc}"
return render_template( return render_template(
"main/changelog.html", "main/changelog.html",
changelog_md=changelog_md, changelog_md=changelog_md,
changelog_html=changelog_html,
changelog_error=error, changelog_error=error,
changelog_source_url=GITEA_CHANGELOG_RAW_URL, changelog_source_url=GITEA_CHANGELOG_RAW_URL,
) )

View File

@ -34,56 +34,3 @@ main.dashboard-container {
white-space: normal; white-space: normal;
cursor: text; cursor: text;
} }
/* Markdown rendering (e.g., changelog page) */
.markdown-content {
overflow-wrap: anywhere;
}
.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
margin-top: 1.25rem;
margin-bottom: 0.75rem;
}
.markdown-content p {
margin-bottom: 0.75rem;
}
.markdown-content ul,
.markdown-content ol {
margin-bottom: 0.75rem;
}
.markdown-content pre {
padding: 0.75rem;
border-radius: 0.5rem;
background: rgba(0, 0, 0, 0.05);
overflow: auto;
}
.markdown-content code {
font-size: 0.95em;
}
.markdown-content table {
width: 100%;
margin-bottom: 1rem;
}
.markdown-content table th,
.markdown-content table td {
padding: 0.5rem;
border-top: 1px solid rgba(0, 0, 0, 0.15);
}
.markdown-content blockquote {
border-left: 0.25rem solid rgba(0, 0, 0, 0.15);
padding-left: 0.75rem;
margin-left: 0;
color: rgba(0, 0, 0, 0.7);
}

View File

@ -23,8 +23,8 @@
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
{% if changelog_html %} {% if changelog_md %}
<div class="markdown-content">{{ changelog_html | safe }}</div> <pre class="mb-0" style="white-space: pre-wrap; word-break: break-word;">{{ changelog_md }}</pre>
{% else %} {% else %}
<div class="text-body-secondary">No changelog content available.</div> <div class="text-body-secondary">No changelog content available.</div>
{% endif %} {% endif %}

View File

@ -1,9 +1,5 @@
## v20260113-01-changelog-markdown-render
- Updated the changelog route to render remote Markdown content with proper formatting.
- Enabled Markdown parsing so headings, lists, links, and code blocks are displayed as intended.
- Ensured the changelog always fetches the latest version from the source repository at request time.
- Removed plain-text rendering to prevent loss of Markdown structure.
================================================================================================================================================ ================================================================================================================================================
## v0.1.20 ## v0.1.20