Content Extraction Prompt

PromptadminResource

A detailed system prompt directs the automated extraction and structuring of content from multi-page documents (such as PDFs) into a TYPO3-compatible JSON structure.

Key points

  1. Aggregates content from split document templates (basics and exercises) into a single page object, reversing their order.
  2. Segments body text into discrete tt_content records based on headings, handling multi-column flow and correcting spelling mistakes.
  3. Maps layout components like callouts, drop caps, lists, and hints to specific TYPO3 element configurations (such as mask_text_icon with a lightbulb icon and div separators).
  4. Enforces a strict JSON output schema with predefined attributes (CType, header, a restricted HTML bodytext subset, and tags).

Why it matters

Manually transcribing layout-heavy print or PDF documents into CMS structures is slow and error-prone. A well-constrained prompt enables automated legacy content migration straight into structured TYPO3 content elements.

Analysis

The prompt relies on rigorous Markdown structuring (input description, processing rules, output specification) and explicit rule constraints rather than narrative instructions. Methodologically, it employs schema templating (exemplified JSON illustrating the expected structure), restrictive rules (limiting output to specific HTML tags such as <p>, <strong>, and <ul>), and fine-grained edge-case handling for print typography (drop caps, callout boxes). The logic pairs document parsing with TYPO3 business rules, such as inserting a divider element and assigning header_layout=1 to section starts. It serves TYPO3 developers and editorial teams building automated document migration pipelines using LLMs.

Prompt

# Content Extraction Prompt

## Input Description
- Source Format: Mehrseitiges Dokument (z.B. PDF)
- Layout:
  - Columns: Mehrspaltig. Textfluss kann über Spalten hinweg gehen.
  - Structure: Inhalte sind logisch in "Grundlagen" (Seite 1) und "Übung" (Seite 2) getrennt.
  - Typography: Verwendet verschiedene Überschriftengrößen, Fettdruck und potenziell Hashtags.
  - Special Elements:
    - DropCap: Textblöcke, die mit einem großen Initialbuchstaben beginnen.
    - CalloutBox: Textblasen oder Kästen mit Zusatzinformationen.
    - GoalList: Ein als "Ziele" markierter Abschnitt mit einer Aufzählung.
    - Hint: Wenn "Hinweis" oder "Tipp" im Text vorkommt oder visuell ein Rahmen beim Inhaltselement vorhanden ist (in der Vorlage), dann automatisch ein Inhaltselement mit `ctype="mask_text_icon"` (Text & Icon) anlegen. Das Feld `tx_mask_icon` soll "lightbulb" auswählen. Header und Text sollen wie die anderen Content-Elemente befüllt werden.

## Processing Rules
- PageAggregation
  - Fasse den Inhalt der "Grundlagen"-Seite und der zugehörigen "Übungs"-Seite in einem einzigen `page`-Objekt in der JSON-Ausgabe zusammen.
  - Die Reihenfolge der Elemente soll sein: die anzulegenden Inhalte TYPO3 sollen zuerst die Bereiche Übungen enthalten und dann die Grundlagen.
  - Die erste Überschrift der angelegten Content-Elemente von Grundlagen (quasi Seite 1) soll `header_layout=1` bekommen.
  - Vor diesem Element lege ein Divider-Content-Element (`ctype:"div"`) an.
- ContentChunking
  - Segmentiere den Inhalt in `tt_content`-Einträge. Eine neue `tt_content`-Instanz beginnt immer mit einer neuen Überschrift. Jeder `tt_content`-Eintrag soll genau eine Überschrift und den dazugehörigen Textabsatz enthalten.
- ShortContentHandlinga
  - Sehr kurze `tt_content`-Einträge, die nur aus wenigen Worten bestehen, sollen entweder weggelassen oder in den vorherigen bzw. nachfolgenden `tt_content`-Eintrag integriert werden.
- SpellingCorrection
  - Überprüfe und korrigiere alle Texte und Überschriften auf Rechtschreibfehler.
- SpecialElementHandling
  - DropCap: Erstelle für einen Textblock, der mit einem großen, abgesetzen Buchstaben beginnt, ein eigenes `tt_content`-Element. Inkludiere den ersten Buchstaben im ersten Wort.
  - CalloutBox: Lege für Textinhalte in einer Textblase eine passende, neue Überschrift an (z.B. "Zusatzinformation") und erstelle ein eigenes `tt_content`-Element dafür.
  - GoalList: Der als "Ziele" markierte Abschnitt soll ein eigener `tt_content`-Block werden. Entferne Pfeil-Symbole aus der Aufzählung. Die Aufzählungen sollen schlussendlich als `<ul>`-Liste generiert werden.
- TextFlow
  - Erkenne Textflüsse über Spaltengrenzen hinweg. Ein Absatz endet erst dort, wo die nächste logische Überschrift beginnt.

## Output Specification
- Format: JSON
- Structure:
  - Description: Die JSON-Struktur muss dem folgenden Aufbau folgen. Die Wurzel ist ein Objekt mit einem `pages`-Array.
  - Schema:
    ```json
    {
      "pages": [
        {
          "title": "Seitentitel (z.B. aus dem Thema der Grundlage)",
          "tt_content": [
            {
              "CType": "header",
              "header": "Titel des ersten Inhaltsblocks",
              "bodytext": "<p>Formatierter HTML-Text...</p>",
              "tags": ["tag1", "tag2"]
            },
            {
              "CType": "text",
              "header": "Titel des zweiten Inhaltsblocks",
              "bodytext": "<p>Weiterer formatierter Text mit <strong>Hervorhebungen</strong> und <a href='...'>Links</a>.</p>",
              "tags": []
            }
          ]
        }
      ]
    }
    ```
- Field Rules:
  - Field `CType`:
    - Der erste `tt_content`-Eintrag einer Seite sollte den CType `header` haben. Alle folgenden können `text` oder `textmedia` sein. Zusätzlich kann noch ein `div` bzw. ein `mask_text_icon` verwendet werden. 
  - Field `bodytext`:
    - Der Text soll als simples HTML formatiert sein. Erlaubte Tags sind: `<p>`, `<br>`, `<h2>`, `<h3>`, `<ul>`, `<li>`, `<strong>`. Im Dokument fett formatierter Text muss in `<strong>`-Tags eingeschlossen werden. Hyperlinks müssen als `<a>`-Tags erhalten bleiben.
  - Field `tags`:
    - Falls Hashtags im Quelldokument vorhanden sind (z.B. `#Thema`), extrahiere diese. Die extrahierten Tags sollen im JSON-Array als Strings ohne das `#`-Symbol gespeichert werden. Wenn keine Hashtags vorhanden sind, soll das Array leer sein.

Summary generated by AI (Gemini 3.8 Flash, 27 September 2026). It may contain errors – the original source is authoritative.

Similar in content, found by the AI search.

Let's talk about your project

Locations

  • Mattersburg
    Johann Nepomuk Bergerstraße 7/2/14
    7210 Mattersburg, Austria
  • Vienna
    Ungargasse 64-66/3/404
    1030 Wien, Austria

Parts of this content were created with the assistance of AI.