This commit is contained in:
1 parent
23b1cb2966
commit
e9532e8878
30 files changed
+1835
-542
No files matched your search
@@ -1,4 +1,58 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
FILE: scripts/dump_note_chunks.py
|
||||
VERSION: 2.1.0 (2025-12-15)
|
||||
STATUS: Active
|
||||
COMPATIBILITY: v2.9.1 (Post-WP14/WP-15b)
|
||||
|
||||
Zweck:
|
||||
-------
|
||||
Gibt die Chunks einer bestimmten Note in lesbarer Form aus.
|
||||
Nützlich zur Analyse der Chunk-Struktur und -Inhalte.
|
||||
|
||||
Funktionsweise:
|
||||
---------------
|
||||
1. Sucht Note nach note-id im Vault
|
||||
2. Erzeugt Chunks via assemble_chunks
|
||||
3. Gibt Chunks formatiert aus:
|
||||
- Chunk-ID, Token-Anzahl, Section-Pfad
|
||||
- Vollständiger Chunk-Text
|
||||
|
||||
Ergebnis-Interpretation:
|
||||
------------------------
|
||||
- Ausgabe: Formatierter Text
|
||||
* Header: "# Titel (note-id) — X chunks"
|
||||
* Pro Chunk: "--- chunk_id | tokens | section_path ---"
|
||||
* Gefolgt vom Chunk-Text
|
||||
- Exit-Code 0: Erfolgreich
|
||||
- Fehlermeldung, wenn Note nicht gefunden
|
||||
|
||||
Verwendung:
|
||||
-----------
|
||||
- Analyse der Chunk-Struktur einer spezifischen Note
|
||||
- Debugging von Chunking-Problemen
|
||||
- Validierung der Chunk-Inhalte
|
||||
|
||||
Hinweise:
|
||||
---------
|
||||
- Nutzt synchrones assemble_chunks (kann async sein)
|
||||
- Gibt nur erste gefundene Note aus (bei Duplikaten)
|
||||
|
||||
Aufruf:
|
||||
-------
|
||||
python3 -m scripts.dump_note_chunks --vault ./vault --note-id my-note-id
|
||||
|
||||
Parameter:
|
||||
----------
|
||||
--vault PATH Pfad zum Vault-Verzeichnis (erforderlich)
|
||||
--note-id ID Note-ID zum Dumpen (erforderlich)
|
||||
|
||||
Änderungen:
|
||||
-----------
|
||||
v2.1.0 (2025-12-15): Dokumentation aktualisiert
|
||||
v1.0.0: Initial Release
|
||||
"""
|
||||
from __future__ import annotations
|
||||
import argparse, os, glob
|
||||
from app.core.parser import read_markdown, normalize_frontmatter, validate_required_frontmatter
|
||||
|
||||
Reference in new issue
Block a user