Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ src/config.php
/e2e/playwright-report/
/e2e/test-results/
/doc-site/_site/
/doc-site/docs/legacy-html/
/doc-site/docs/user-guide/chapters/
Comment thread
alorbach marked this conversation as resolved.

src/index.html
2 changes: 1 addition & 1 deletion doc-site/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ LogAnalyzer is a PHP web front end for browsing syslog and related log data. Thi
- **[Quick start](user-guide/quick-start.md)** — run with Docker and skim the UI with screenshots.
- **[Interface map](user-guide/interface-map.md)** — main routes and where to read more.
- [Third-party and bundled libraries](third-party.md) lists versions and update notes.
- [User guide overview](legacy-html-manuals.md) indexes every imported manual page; sources remain [`doc/*.html`](https://github.com/rsyslog/loganalyzer/tree/master/doc) on GitHub.
- [User guide overview](user-guide/overview.md) indexes every imported manual page; sources remain [`doc/*.html`](https://github.com/rsyslog/loganalyzer/tree/master/doc) on GitHub.

Handbook build: `doc-site/`; published at [https://rsyslog.github.io/loganalyzer/](https://rsyslog.github.io/loganalyzer/) (`site_url` in `mkdocs.yml`).
6 changes: 3 additions & 3 deletions doc-site/docs/user-guide/interface-map.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ LogAnalyzer is a PHP web UI. URLs below are the primary entry points; your deplo
| Reports | `reports.php` | Report-oriented views. |
| Administration | `admin/index.php` | Manage sources, users, and system options (administrators). |

See [Search syntax](../legacy-html/searching.md) for query syntax used in filters and searches.
See [Search syntax](chapters/searching.md) for query syntax used in filters and searches.

## Documentation trail

- **Operational setup:** [Docker & CI](../docker.md), [Installation](../legacy-html/install.md), [Troubleshooting](../legacy-html/troubleshoot.md).
- **Using the product:** [Basics](../legacy-html/basics.md), [Search syntax](../legacy-html/searching.md), [Text log files](../legacy-html/textfiles.md), [Windows Event Log](../legacy-html/windowsevent.md).
- **Operational setup:** [Docker & CI](../docker.md), [Installation](chapters/install.md), [Troubleshooting](chapters/troubleshoot.md).
- **Using the product:** [Basics](chapters/basics.md), [Search syntax](chapters/searching.md), [Text log files](chapters/textfiles.md), [Windows Event Log](chapters/windowsevent.md).

## Screenshots

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ Every `*.html` manual under [`doc/`](https://github.com/rsyslog/loganalyzer/blob

## Pages (in-site)

- [Documentation home](legacy-html/manual.md) (`manual.html`)
- [Basics](legacy-html/basics.md) (`basics.html`)
- [Installation](legacy-html/install.md) (`install.html`)
- [Search syntax](legacy-html/searching.md) (`searching.html`)
- [Troubleshooting](legacy-html/troubleshoot.md) (`troubleshoot.html`)
- [Build from repo](legacy-html/build_from_repo.md) (`build_from_repo.html`)
- [Free support](legacy-html/free_support.md) (`free_support.html`)
- [Professional services](legacy-html/professional_services.md) (`professional_services.html`)
- [Text log files](legacy-html/textfiles.md) (`textfiles.html`)
- [Windows Event Log](legacy-html/windowsevent.md) (`windowsevent.html`)
- [Documentation home](chapters/manual.md) (`manual.html`)
- [Basics](chapters/basics.md) (`basics.html`)
- [Installation](chapters/install.md) (`install.html`)
- [Search syntax](chapters/searching.md) (`searching.html`)
- [Troubleshooting](chapters/troubleshoot.md) (`troubleshoot.html`)
- [Build from repo](chapters/build_from_repo.md) (`build_from_repo.html`)
- [Free support](chapters/free_support.md) (`free_support.html`)
- [Professional services](chapters/professional_services.md) (`professional_services.html`)
- [Text log files](chapters/textfiles.md) (`textfiles.html`)
- [Windows Event Log](chapters/windowsevent.md) (`windowsevent.html`)

## Source in the repository

Expand Down
4 changes: 2 additions & 2 deletions doc-site/docs/user-guide/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ PNG files under `doc-site/docs/assets/user-guide/` are produced with **Playwrigh
## Go deeper

- [Interface map](interface-map.md) — how main areas fit together.
- [User guide overview](../legacy-html-manuals.md) — full list of imported chapters from `doc/`.
- [Installation](../legacy-html/install.md) and [Basics](../legacy-html/basics.md) for configuration and concepts.
- [User guide overview](overview.md) — full list of imported chapters from `doc/`.
- [Installation](chapters/install.md) and [Basics](chapters/basics.md) for configuration and concepts.
26 changes: 13 additions & 13 deletions doc-site/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,18 @@ nav:
- Home: index.md
- Docker & CI (from AGENTS.md): docker.md
- LogAnalyzer user guide:
- Overview: legacy-html-manuals.md
- Quick start: user-guide/quick-start.md
- Interface map: user-guide/interface-map.md
- Documentation home: legacy-html/manual.md
- Basics: legacy-html/basics.md
- Installation: legacy-html/install.md
- Search syntax: legacy-html/searching.md
- Troubleshooting: legacy-html/troubleshoot.md
- Build from repo: legacy-html/build_from_repo.md
- Free support: legacy-html/free_support.md
- Professional services: legacy-html/professional_services.md
- Text log files: legacy-html/textfiles.md
- Windows Event Log: legacy-html/windowsevent.md
- 'Overview': user-guide/overview.md
- 'Quick start': user-guide/quick-start.md
- 'Interface map': user-guide/interface-map.md
- 'Documentation home': user-guide/chapters/manual.md
- 'Basics': user-guide/chapters/basics.md
- 'Installation': user-guide/chapters/install.md
- 'Search syntax': user-guide/chapters/searching.md
- 'Troubleshooting': user-guide/chapters/troubleshoot.md
- 'Build from repo': user-guide/chapters/build_from_repo.md
- 'Free support': user-guide/chapters/free_support.md
- 'Professional services': user-guide/chapters/professional_services.md
- 'Text log files': user-guide/chapters/textfiles.md
- 'Windows Event Log': user-guide/chapters/windowsevent.md
- Repository README: project-readme.md
- Third-party components: third-party.md
54 changes: 35 additions & 19 deletions doc-site/prepare_docs.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
"""Prepare doc-site/docs from repository Markdown; embed legacy HTML as MkDocs pages."""
"""Prepare doc-site/docs from repository Markdown; embed upstream doc/*.html as MkDocs pages under user-guide/chapters/."""
from __future__ import annotations

import os
Expand All @@ -9,7 +9,10 @@

REPO_ROOT = Path(__file__).resolve().parent.parent
OUT_DIR = Path(__file__).resolve().parent / "docs"
LEGACY_SUBDIR = "legacy-html"
# Handbook-native pages live in user-guide/; imported doc/*.html render under user-guide/chapters/.
USER_GUIDE_DIR = "user-guide"
IMPORTED_CHAPTERS_DIR = "chapters"
OVERVIEW_MD = "overview.md"
REPO_URL = os.environ.get("GHP_REPO_URL", "https://github.com/rsyslog/loganalyzer").rstrip("/")
DEFAULT_BRANCH = os.environ.get("GHP_DEFAULT_BRANCH", "master").strip() or "master"

Expand Down Expand Up @@ -122,13 +125,15 @@ def _ordered_legacy_stems(stems: set[str]) -> list[str]:
def _format_legacy_nav_lines(stems_ordered: list[str]) -> list[str]:
lines = [
LEGACY_NAV_HEADER,
" - Overview: legacy-html-manuals.md",
" - Quick start: user-guide/quick-start.md",
" - Interface map: user-guide/interface-map.md",
f" - {_yaml_single_quoted('Overview')}: {USER_GUIDE_DIR}/{OVERVIEW_MD}",
f" - {_yaml_single_quoted('Quick start')}: {USER_GUIDE_DIR}/quick-start.md",
f" - {_yaml_single_quoted('Interface map')}: {USER_GUIDE_DIR}/interface-map.md",
]
for stem in stems_ordered:
label = LEGACY_NAV_LABELS.get(stem, stem.replace("_", " ").title())
lines.append(f" - {label}: legacy-html/{stem}.md")
lines.append(
f" - {_yaml_single_quoted(label)}: {USER_GUIDE_DIR}/{IMPORTED_CHAPTERS_DIR}/{stem}.md"
)
Comment on lines 132 to +136

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The navigation labels should be quoted to ensure the generated mkdocs.yml remains valid even if a label contains special YAML characters (like a colon). Using the existing _yaml_single_quoted helper will make this more robust.

Suggested change
for stem in stems_ordered:
label = LEGACY_NAV_LABELS.get(stem, stem.replace("_", " ").title())
lines.append(f" - {label}: legacy-html/{stem}.md")
lines.append(
f" - {label}: {USER_GUIDE_DIR}/{IMPORTED_CHAPTERS_DIR}/{stem}.md"
)
for stem in stems_ordered:
label = LEGACY_NAV_LABELS.get(stem, stem.replace("_", " ").title())
lines.append(
f" - {_yaml_single_quoted(label)}: {USER_GUIDE_DIR}/{IMPORTED_CHAPTERS_DIR}/{stem}.md"
)

return lines


Expand Down Expand Up @@ -177,6 +182,16 @@ def _write_legacy_markdown(
out_path.write_text(md, encoding="utf-8", newline="\n")


def _remove_pre_migration_doc_artifacts(out_dir: Path) -> None:
"""Remove handbook output from the pre-PR layout (legacy-html/, legacy-html-manuals.md)."""
for name in ("legacy-html", "legacy-html-manuals.md"):
path = out_dir / name
if path.is_dir():
shutil.rmtree(path)
elif path.is_file():
path.unlink()


def main() -> int:
OUT_DIR.mkdir(parents=True, exist_ok=True)
agents = REPO_ROOT / "AGENTS.md"
Expand All @@ -188,12 +203,16 @@ def main() -> int:
text = readme.read_text(encoding="utf-8", errors="replace")
(OUT_DIR / "project-readme.md").write_text(text, encoding="utf-8", newline="\n")
print(f"Wrote {OUT_DIR / 'project-readme.md'}")
_remove_pre_migration_doc_artifacts(OUT_DIR)
manuals = REPO_ROOT / "doc"
if manuals.is_dir():
legacy_out = OUT_DIR / LEGACY_SUBDIR
if legacy_out.is_dir():
shutil.rmtree(legacy_out)
legacy_out.mkdir(parents=True, exist_ok=True)
guide_root = OUT_DIR / USER_GUIDE_DIR
guide_root.mkdir(parents=True, exist_ok=True)
chapters_out = guide_root / IMPORTED_CHAPTERS_DIR
if chapters_out.is_dir():
shutil.rmtree(chapters_out)
chapters_out.mkdir(parents=True, exist_ok=True)

html_files = sorted(manuals.glob("*.html"))
stems = {f.stem for f in html_files}

Expand All @@ -202,11 +221,11 @@ def main() -> int:
doc_title, body = _extract_title_and_body(raw)
body = _rewrite_hrefs(body, stems)
md_name = src.with_suffix(".md").name
_write_legacy_markdown(legacy_out / md_name, doc_title, body)
print(f"Wrote {legacy_out / md_name} <- {src.name}")
_write_legacy_markdown(chapters_out / md_name, doc_title, body)
print(f"Wrote {chapters_out / md_name} <- {src.name}")

blob_base = f"{REPO_URL}/blob/{DEFAULT_BRANCH}/doc"
rel_prefix = f"{LEGACY_SUBDIR}/"
rel_prefix = f"{IMPORTED_CHAPTERS_DIR}/"

ordered = _ordered_legacy_stems(stems)
stem_to_html = {f.stem: f.name for f in html_files}
Expand Down Expand Up @@ -240,12 +259,9 @@ def main() -> int:
"",
]
)
(OUT_DIR / "legacy-html-manuals.md").write_text(
"\n".join(lines) + "\n",
encoding="utf-8",
newline="\n",
)
print(f"Wrote {OUT_DIR / 'legacy-html-manuals.md'}")
overview_path = OUT_DIR / USER_GUIDE_DIR / OVERVIEW_MD
overview_path.write_text("\n".join(lines) + "\n", encoding="utf-8", newline="\n")
print(f"Wrote {overview_path}")
_patch_mkdocs_legacy_nav(_ordered_legacy_stems(stems))
return 0

Expand Down
Loading