Skip to content

Add WordPress plugin for automatic GitHub documentation integration with wiki navigation and search support - #275

Merged
makr-code merged 10 commits into
developfrom
copilot/add-themis-wiki-integration
Jan 7, 2026
Merged

makr-code merged 10 commits into
developfrom
copilot/add-themis-wiki-integration

Conversation

Copilot AI commented Jan 7, 2026 •

Copy link
Copy Markdown
Contributor

Implements WordPress plugin to automatically sync ThemisDB documentation from GitHub repository into WordPress pages via shortcodes. Includes wiki navigation from _Sidebar.md for seamless documentation browsing and WordPress search integration.

Core Implementation

GitHub API Integration

  • Fetches markdown files via GitHub Contents API with Bearer token auth
  • Transient caching (1hr TTL) with manual sync override
  • Configurable repo/branch/path via admin panel

Shortcodes

// Display single document with optional TOC
[themisdb_wiki file="README.md" lang="de" show_toc="yes"]

// List available documentation
[themisdb_docs lang="de" layout="grid"]

// Display wiki navigation from _Sidebar.md
[themisdb_wiki_nav lang="de" style="accordion"]

Wiki Navigation from _Sidebar.md

  • Automatically parses _Sidebar.md from GitHub repository
  • Three display styles: Sidebar (classic), Accordion (collapsible), Horizontal (compact)
  • WordPress Widget support for sidebars and widget areas
  • Current page highlighting with auto-expand in accordion mode
  • Hierarchical structure with sections and subsections

WordPress Search Integration

  • Hybrid Approach: WordPress pages with dynamic GitHub content via shortcodes
  • Pages are indexed by WordPress search (titles and metadata)
  • Content remains synchronized with GitHub automatically
  • Comprehensive setup guide with WP-CLI automation scripts
  • SEO optimization for documentation pages

Markdown Parser

  • Regex-based conversion with XSS protection via wp_kses()
  • Escaped URLs with esc_url(), code blocks with esc_html()
  • Proper list nesting (fixes malformed HTML from naive regex wrapping)

Security Hardening

  • Modern Clipboard API with deprecated execCommand() fallback
  • Nonce escaping with esc_js() in AJAX handlers
  • Input sanitization on all GitHub content

Plugin Structure

themisdb-wiki-integration/
├── themisdb-wiki-integration.php      # Main plugin (19KB)
├── assets/
│   ├── css/wiki-integration.css       # Responsive + dark mode (7KB)
│   └── js/wiki-integration.js         # TOC navigation, accordion, copy-to-clipboard (7KB)
├── templates/
│   └── admin-settings.php             # Configuration UI
├── WIKI_NAVIGATION_GUIDE.md           # Comprehensive navigation usage guide
└── WORDPRESS_PAGES_SETUP.md           # WordPress search integration guide

Multi-language support: DE/EN/FR via docs/{lang}/ path convention
Auto-sync: Optional hourly cron job to clear cache and refresh content
Admin UI: Settings panel under WordPress Settings → ThemisDB Wiki
Widget: "ThemisDB Wiki Navigation" widget for sidebars
Search Integration: Step-by-step guide for enabling WordPress search with automatic GitHub sync

CodeQL scan: 0 vulnerabilities

Original prompt

gibt es für wordpress ein plugin um die themis wiki auch im wordpress zu integrieren ggf. automatisch von github aus?


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Add Themis wiki integration for WordPress Add WordPress plugin for automatic GitHub documentation integration Jan 7, 2026
Copilot AI requested a review from makr-code January 7, 2026 19:50
@makr-code

Copy link
Copy Markdown
Owner

@copilot Die Wiki hat in der _sidebar.md immer ein Dokumenten - Index. Dieser sollte immer Ausgangspunkt für die wiki-navi sein. Wir brauchen eine sinnvolle Navigation die sich natlos in das wordpress einbettet und aus der github wiki gespeist wird.

Copilot AI commented Jan 7, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Die Wiki hat in der _sidebar.md immer ein Dokumenten - Index. Dieser sollte immer Ausgangspunkt für die wiki-navi sein. Wir brauchen eine sinnvolle Navigation die sich natlos in das wordpres...

Die _Sidebar.md wird jetzt als Ausgangspunkt für die Wiki-Navigation verwendet. Implementiert in Commit 4f06c1b:

Neue Features:
✅ Shortcode [themisdb_wiki_nav] - Rendert Navigation aus _Sidebar.md
✅ WordPress-Widget "ThemisDB Wiki Navigation" für Sidebars
✅ Drei Anzeigestile: Sidebar, Accordion, Horizontal
✅ Automatisches Highlighting der aktuellen Seite
✅ Hierarchische Sections aus GitHub-Wiki übernommen

Verwendung:

[themisdb_wiki_nav lang="de" style="accordion"]

Die Navigation integriert sich nahtlos in WordPress und wird dynamisch aus dem GitHub-Repository geladen.

Copilot AI changed the title Add WordPress plugin for automatic GitHub documentation integration Add WordPress plugin for automatic GitHub documentation integration with wiki navigation Jan 7, 2026
@makr-code

Copy link
Copy Markdown
Owner

@copilot kann eine schnelle suche, filter usw. von wordpress genutzt werden oder müssen wir eine implementieren?

Copilot AI commented Jan 7, 2026

Copy link
Copy Markdown
Contributor Author

@copilot kann eine schnelle suche, filter usw. von wordpress genutzt werden oder müssen wir eine implementieren?

WordPress bietet bereits integrierte Suchfunktionalität, die wir nutzen können:

WordPress-native Optionen (keine eigene Implementierung nötig):

  1. WordPress-Suche: Funktioniert automatisch wenn Dokumentation als WordPress-Seiten angelegt wird

  2. Plugin-Integration:

    • Relevanssi (bessere Suche)
    • SearchWP (erweiterte Suche)
    • FacetWP (Filter & Facetten)
  3. Shortcode-Erweiterung möglich:

[themisdb_wiki_search]

Würde JavaScript-basierte Client-seitige Suche in der Navigation hinzufügen (kein Backend nötig).

Empfehlung: WordPress-native Suche nutzen + bei Bedarf ein Search-Plugin. Eigene Implementierung nur wenn spezielle Anforderungen bestehen (z.B. GitHub-Issues durchsuchen, Code-Suche, etc.).

Soll ich eine einfache JavaScript-Suche für die Navigation hinzufügen?

@makr-code

Copy link
Copy Markdown
Owner

@copilot werden die wiki seiten in der wordpress gespeichert ?

Copilot AI commented Jan 7, 2026

Copy link
Copy Markdown
Contributor Author

@copilot werden die wiki seiten in der wordpress gespeichert ?

Nein, die Wiki-Seiten werden nicht in WordPress gespeichert.

Das Plugin arbeitet dynamisch:

  1. GitHub = Single Source of Truth: Dokumentation bleibt in GitHub
  2. Dynamisches Fetching: Bei Shortcode-Aufruf wird Markdown von GitHub abgerufen
  3. Cache: Inhalte werden 1 Stunde im WordPress Transient Cache gespeichert (Performance)
  4. Kein Import: Keine Datenbank-Speicherung, keine Duplikation

Vorteile:

  • ✅ Dokumentation in GitHub pflegen (kein manueller Sync)
  • ✅ Immer aktuelle Version (nach Cache-Ablauf)
  • ✅ Keine Datenbank-Redundanz

Funktionsweise:

GitHub Repo → API → Cache (1h) → WordPress Anzeige

Bei "Sync Now" im Admin-Panel wird der Cache geleert und neu geladen.

@makr-code

Copy link
Copy Markdown
Owner

@copilot dann kann das wordpress suche aber nicht in der github wiki suchen

Copilot AI commented Jan 7, 2026

Copy link
Copy Markdown
Contributor Author

@copilot dann kann das wordpress suche aber nicht in der github wiki suchen

Richtig. Für die Suche gibt es zwei Lösungen:

Option 1: Client-seitige JavaScript-Suche (empfohlen)

  • Durchsucht die Navigation und gecachten Inhalt
  • Kein Backend nötig
  • Schnell und einfach zu implementieren
[themisdb_wiki_search]

Option 2: Dokumentation als WordPress-Seiten anlegen

  • Jedes Dokument bekommt eine WordPress-Seite
  • Shortcode im Seiteninhalt: [themisdb_wiki file="..."]
  • WordPress-Suche funktioniert dann (durchsucht Seitentitel)
  • Seiteninhalt (Markdown) bleibt dynamisch aus GitHub

Option 3: Search-Index aufbauen

  • Bei Sync: Index aller Dokumente in WordPress-DB speichern
  • Custom Search-Endpoint
  • Aufwändiger, aber vollständige Volltextsuche

Empfehlung: Option 1 für schnelle Implementierung, Option 2 für WordPress-native Suche. Soll ich Option 1 implementieren?

@makr-code

Copy link
Copy Markdown
Owner

@copilot Bei Option 2 würden die Dokumente dann auch ein Update erfahren wenn die Quelle (github wiki) ein update erhält (CRUD)?

Copilot AI commented Jan 7, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Bei Option 2 würden die Dokumente dann auch ein Update erfahren wenn die Quelle (github wiki) ein update erhält (CRUD)?

Ja, bei Option 2 bleiben die Dokumente automatisch aktuell:

Funktionsweise:

  1. WordPress-Seite wird einmal manuell angelegt
  2. Shortcode im Seiteninhalt: [themisdb_wiki file="features.md"]
  3. Bei jedem Seitenaufruf: Shortcode lädt aktuellen Inhalt aus GitHub (via Cache)
  4. Updates automatisch: Wenn GitHub-Datei geändert wird → nach Cache-Ablauf (1h) sichtbar

Hybrid-Ansatz:

  • Statisch: WordPress-Seite (URL, Titel, Metadaten) → für Suche indexiert
  • Dynamisch: Markdown-Inhalt aus GitHub → immer aktuell
  • Best of Both: WordPress-Suche funktioniert + Inhalt aus GitHub

Kein manuelles CRUD nötig - nur initiales Anlegen der Seiten. Inhaltsaktualisierung erfolgt automatisch via Shortcode.

@makr-code

Copy link
Copy Markdown
Owner

@copilot okay dann setzen wir option 2 um.

Copilot AI commented Jan 7, 2026

Copy link
Copy Markdown
Contributor Author

@copilot okay dann setzen wir option 2 um.

Option 2 implementiert in Commit 966f776.

Neues Dokument: WORDPRESS_PAGES_SETUP.md

Inhalt:

  • Schritt-für-Schritt-Anleitung für WordPress-Seiten Setup
  • WP-CLI Script für automatische Seiten-Erstellung
  • WordPress-Template für Dokumentationsseiten
  • Suche-Konfiguration (Native, Relevanssi, SearchWP)
  • SEO-Optimierung
  • Wartung & Best Practices

Hybrid-Ansatz:

  • WordPress-Seiten mit Shortcodes: [themisdb_wiki file="..."]
  • WordPress-Suche funktioniert (Seitentitel/Metadaten)
  • Inhalte bleiben automatisch mit GitHub synchronisiert
  • Kein manuelles CRUD nötig

Der Guide ist produktionsreif und enthält alle Details für die Implementierung.

Copilot AI changed the title Add WordPress plugin for automatic GitHub documentation integration with wiki navigation Add WordPress plugin for automatic GitHub documentation integration with wiki navigation and search support Jan 7, 2026
@makr-code
makr-code marked this pull request as ready for review January 7, 2026 20:52
@makr-code
makr-code merged commit 0464a6d into develop Jan 7, 2026
@makr-code makr-code added this to the v1.0.2 milestone Mar 11, 2026
Copilot AI added a commit that referenced this pull request May 20, 2026
- Add RerouteSerializeFn tests (stub #252)
- AstVisitorFn bridge: TensorAwareQueryOptimizer (stub #275)
- ExactSimilarityFn bridge: TensorFingerprintGraph (stub #276)
- [[deprecated]] attribute: ggmlCorePtrs (stub #277)
- RpcPhase2Fn bridge: DistributedTransactionManager (stub #279)
- AuthorizeFn bridge: RopeApiHandler RBAC (stub #280)
- HttpPostFn bridge: AIPluginGenerator (stub #282)
- HTToTTFn bridge: HTTrain (stub #286)
- ModelPathProviderFn bridge: LoRATrainingService (stub #289)
- AllReduceCpuFn bridge: DistributedTrainer (stub #290)
- NlpContextFn bridge: AdaptiveShardRouter (stub #291)
- StringArrayFn bridge: PropertyGraphManager (stub #292)
- SchemaInspectorFn/SchemaValidatorFn: ImportApiHandler (stub #294)
- Lz4CompressFn/Lz4DecompressFn: SecureTransportClient (stub #295)
- SpamKeywordsProviderFn: FeedbackStore (stub #296)
- MODIFY path fix: FeedbackStore validateWithPlugin (stub #297)
- shared_ptr ResponseBuffer RAII: Http2Session (stub #298)
- ModelPathProviderFn: ThemisHelpLoRA Config (stub #299)
- IngestExternalFileFn: BackupManager (stub #300)
- StatsQueryFn: RopeApiHandler (stub #307)
- Update STUB_INVENTORY.md: 272->292 resolved, 44->24 active

Co-authored-by: Copilot <[email protected]>

Co-authored-by: makr-code <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants