docs: add English quick reference to help
This commit is contained in:
@@ -39,6 +39,7 @@ DOCS_DIR = os.path.join(app.root_path, "docs")
|
||||
DEFAULT_DOC_LANGUAGE = "de"
|
||||
USER_MANUAL_FILENAME = "user_manual.md"
|
||||
RECENT_CHANGES_FILENAME = "recent_changes.md"
|
||||
QUICK_REFERENCE_FILENAME = "quick_reference.md"
|
||||
WHATS_NEW_SUMMARY_FILE = os.path.join(app.root_path, "static", "recent_changes.json")
|
||||
UNKNOWN_BUILD_INFO = {
|
||||
"version": "unknown",
|
||||
@@ -305,6 +306,11 @@ def render_recent_changes(language=DEFAULT_DOC_LANGUAGE):
|
||||
"""Read and render the Markdown recent changes document."""
|
||||
return render_markdown_document(RECENT_CHANGES_FILENAME, language)
|
||||
|
||||
|
||||
def render_quick_reference(language="en"):
|
||||
"""Read and render the Markdown quick reference document."""
|
||||
return render_markdown_document(QUICK_REFERENCE_FILENAME, language)
|
||||
|
||||
@app.route("/", methods=["GET"])
|
||||
@auth.login_required
|
||||
def index():
|
||||
@@ -330,6 +336,12 @@ def user_manual():
|
||||
"user_manual.html",
|
||||
document_title="User Manual",
|
||||
document_subtitle="RollCalc technical user documentation",
|
||||
document_actions=[
|
||||
{
|
||||
"href": url_for("quick_reference"),
|
||||
"label": "Open English Quick Reference",
|
||||
}
|
||||
],
|
||||
error_title="User Manual unavailable",
|
||||
manual_html=manual_html,
|
||||
toc=toc,
|
||||
@@ -341,6 +353,12 @@ def user_manual():
|
||||
"user_manual.html",
|
||||
document_title="User Manual",
|
||||
document_subtitle="RollCalc technical user documentation",
|
||||
document_actions=[
|
||||
{
|
||||
"href": url_for("quick_reference"),
|
||||
"label": "Open English Quick Reference",
|
||||
}
|
||||
],
|
||||
error_title="User Manual unavailable",
|
||||
manual_html=None,
|
||||
toc=[],
|
||||
@@ -351,6 +369,40 @@ def user_manual():
|
||||
), 500
|
||||
|
||||
|
||||
@app.route("/help/quick-reference", methods=["GET"])
|
||||
@auth.login_required
|
||||
def quick_reference():
|
||||
"""Render the English Quick Reference inside the RollCalc Help layout."""
|
||||
log_access(auth.current_user(), "/help/quick-reference", "GET")
|
||||
try:
|
||||
quick_html, toc = render_quick_reference("en")
|
||||
return render_template(
|
||||
"user_manual.html",
|
||||
document_title="Quick Reference",
|
||||
document_subtitle="Concise English reference for common RollCalc workflows",
|
||||
document_actions=[],
|
||||
error_title="Quick Reference unavailable",
|
||||
manual_html=quick_html,
|
||||
toc=toc,
|
||||
render_error=None
|
||||
)
|
||||
except Exception:
|
||||
app.logger.exception("Could not render quick reference")
|
||||
return render_template(
|
||||
"user_manual.html",
|
||||
document_title="Quick Reference",
|
||||
document_subtitle="Concise English reference for common RollCalc workflows",
|
||||
document_actions=[],
|
||||
error_title="Quick Reference unavailable",
|
||||
manual_html=None,
|
||||
toc=[],
|
||||
render_error=(
|
||||
"The quick reference could not be loaded. "
|
||||
"Please contact the RollCalc maintainer if the problem persists."
|
||||
)
|
||||
), 500
|
||||
|
||||
|
||||
@app.route("/help/recent-changes", methods=["GET"])
|
||||
@auth.login_required
|
||||
def recent_changes():
|
||||
@@ -362,6 +414,7 @@ def recent_changes():
|
||||
"user_manual.html",
|
||||
document_title="Recent Changes",
|
||||
document_subtitle="RollCalc release notes",
|
||||
document_actions=[],
|
||||
error_title="Recent Changes unavailable",
|
||||
manual_html=changes_html,
|
||||
toc=toc,
|
||||
@@ -373,6 +426,7 @@ def recent_changes():
|
||||
"user_manual.html",
|
||||
document_title="Recent Changes",
|
||||
document_subtitle="RollCalc release notes",
|
||||
document_actions=[],
|
||||
error_title="Recent Changes unavailable",
|
||||
manual_html=None,
|
||||
toc=[],
|
||||
|
||||
Reference in New Issue
Block a user