Overview
The/siaa/ver/<nombre_doc> endpoint serves complete document content as a formatted HTML page. It supports section highlighting and search term emphasis, and is typically accessed via links in chat responses.
Endpoint
Path Parameters
Document filename (lowercase). Examples:
acuerdo_no._psaa16-10476.mdjuzgado_civil_municipal.mdcircular_cendoj_10-2022.md
Query Parameters
Section to highlight and scroll to. The first occurrence matching this string (case-insensitive) will be highlighted and brought into view.Example:
?sec=ARTÍCULO 8Search query for keyword highlighting (future enhancement - currently not implemented but reserved)
Response
Returns a fully-formatted HTML page with:- Branded header: SIAA branding with document name and collection badge
- Markdown rendering: Headings, bold, italic, lists
- Section highlighting: Yellow highlight on target section with smooth scroll
- Print button: Floating print button (hidden on print)
- Responsive design: Mobile-friendly layout
Response Headers
text/html; charset=utf-8HTML Structure
The rendered page includes:Error Responses
404 Not Found
Returned when the document doesn’t exist:Examples
Example 1: View Full Document
Example 2: View with Section Highlight
- Article 5 highlighted in yellow
- Page automatically scrolled to Article 5
- Highlight blinks 3 times to draw attention
Example 3: Open in Browser
xdg-open on Linux or start on Windows.
Example 4: Access from Chat Response
Chat responses include clickable links:Use Cases
1. Verify AI Response
When SIAA cites a document, users can click the link to verify the source and read the full context.2. Read Complete Regulations
For queries like “¿Cuáles son las secciones del formulario SIERJU?”, the chat may return a summary. The document link lets users read the complete enumeration.3. Print Legal Documents
The print button provides a clean, printer-friendly version without headers or buttons.4. Navigate to Specific Articles
When SIAA responds “según Artículo 5°”, the citation link can include?sec=ARTÍCULO 5 to jump directly to that section.
Document Format Support
The endpoint processes.md and .txt files from /opt/siaa/fuentes/:
- Markdown headings:
#,##,###,####rendered as<h1>through<h4> - Bold text:
**text**rendered as<strong> - Italic text:
_text_rendered as<em> - Paragraphs: Automatic
<p>wrapping - Blank lines: Preserved as spacing
Styling
The page uses a judicial theme:-
Colors:
- Primary blue:
#1a2a6c(header background) - Gold accent:
#c5a059(badges, borders, highlights) - Text:
#1e293b(dark slate)
- Primary blue:
-
Typography:
- Font: Segoe UI (sans-serif fallback)
- Line height: 1.75 for readability
- Headings: Blue with gold left border on
<h2>
-
Highlight effect:
- Background:
#fef9c3(yellow-50) - Border: 5px solid gold on left
- Animation: Blinks between yellow-50 and yellow-400, 3 times
- Background:
Technical Details
Document Lookup
The endpoint performs fuzzy matching:- Exact match:
nombre_doc.lower()matches document key - Fuzzy match: If exact fails, searches for partial matches with underscores/spaces normalized
/siaa/ver/acuerdo no. psaa16-10476.md/siaa/ver/acuerdo_no._psaa16-10476.md
Section Highlighting
Thesec parameter performs:
- Case-insensitive search: “artículo 5” matches “ARTÍCULO 5°”
- First match only: Only the first occurrence is highlighted
- Smooth scroll: JavaScript
scrollIntoView({behavior:"smooth", block:"center"}) - Visual emphasis: Blink animation draws user’s eye
Print Optimization
@media print CSS rules:
- Hide header and print button
- Remove padding for more content per page
- Preserve text formatting and structure
Integration Example
Typical flow when a user asks a question:- User query: “¿Qué sanciones hay por incumplimiento?”
- SIAA response:
- User clicks link: Browser opens full document scrolled to Article 19
- User reviews: Reads full article in context, can print if needed
Related Endpoints
- POST /siaa/chat - Generates links to this endpoint in citations
- GET /siaa/recargar - Reload documents after updates
- GET /siaa/status - Check which documents are loaded