### Install Dependencies
Source: https://github.com/docling-project/website/blob/main/README.md
Run this command to install the necessary dependencies for the project.
```bash
uv sync
```
--------------------------------
### Install Docling Service Client
Source: https://github.com/docling-project/website/blob/main/blog/20260615_00_docling_for_ibm_watsonx/post.md
Install the Docling Service Client using pip. Choose the full package or the slim version with the 'service-client' extra for minimal dependencies.
```bash
pip install docling
```
```bash
pip install "docling-slim[service-client]"
```
--------------------------------
### Install Docling with VLM Support
Source: https://github.com/docling-project/website/blob/main/blog/20260203_00_chart_understanding_in_docling/post.md
Install Docling with the necessary components for Visual Language Model (VLM) support, which is required for chart extraction.
```bash
pip install "docling[vlm]"
```
--------------------------------
### Run Development Server
Source: https://github.com/docling-project/website/blob/main/README.md
Start the local development server to view the website. The server automatically reloads on changes.
```bash
uv run website/main.py
```
--------------------------------
### Bash Fenced Code Block Example
Source: https://github.com/docling-project/website/blob/main/blog/template/post.md
Shows example shell commands within a fenced code block. Useful for demonstrating command-line operations.
```bash
# Shell commands
echo "Hello, World!"
ls -la
```
--------------------------------
### Markdown Admonition (Tip) Example
Source: https://github.com/docling-project/website/blob/main/blog/template/post.md
Illustrates a 'Tip' admonition block. Use for providing helpful suggestions or best practices.
```markdown
> **Tip**
> This is a tip callout.
```
--------------------------------
### Markdown Definition List Example
Source: https://github.com/docling-project/website/blob/main/blog/template/post.md
Shows the syntax for creating definition lists in Markdown. Suitable for glossaries or term explanations.
```markdown
Term 1
: Definition 1
Term 2
: Definition 2a
: Definition 2b
```
--------------------------------
### Blog Post Markdown Structure
Source: https://github.com/docling-project/website/blob/main/README.md
Example of the front matter and content structure for a blog post in Markdown format.
```markdown
---
title: My Awesome Post
date: 06-03-2026
summary: A brief description that appears in the blog listing
thumbnail: images/thumbnail.jpg
---
Your blog content starts here...
## Section Heading
You can use all standard Markdown features, code blocks, images, etc.

```
--------------------------------
### Markdown Footnote Example
Source: https://github.com/docling-project/website/blob/main/blog/template/post.md
Demonstrates how to create and reference footnotes in Markdown. Useful for adding citations or supplementary explanations.
```markdown
Here's a sentence with a footnote[^1].
[^1]: This is the footnote content.
```
--------------------------------
### Add Placeholder Routes for FAQ and Releases
Source: https://github.com/docling-project/website/blob/main/plans/feature_01_navigation_restructure.md
Adds asynchronous GET routes for '/faq/' and '/releases/' that return a 'Coming Soon' HTML page. Ensure the `ComingSoonPage` component and `HTMLResponse` are correctly imported.
```python
from fastapi import FastAPI
from fastapi.responses import HTMLResponse
app = FastAPI()
# Placeholder component (assuming it exists elsewhere)
class ComingSoonPage:
def __init__(self, page_name):
self.page_name = page_name
def __str__(self):
return f"
{self.page_name} is coming soon!
" # Minimal stub
@app.get("/faq/", response_class=HTMLResponse)
async def get_faq():
return str(ComingSoonPage("FAQ"))
@app.get("/releases/", response_class=HTMLResponse)
async def get_releases():
return str(ComingSoonPage("Releases"))
```
--------------------------------
### Blog Post Front-Matter Example
Source: https://github.com/docling-project/website/blob/main/plans/feature_05_blog_enhancements.md
Extend markdown front-matter with optional 'tags' and 'featured' fields. Existing posts are valid without these fields.
```markdown
---
title: Understanding Docling's Chunking Strategy
date: 15-01-2025
summary: A deep dive into how Docling splits documents for RAG pipelines.
tags: chunking, rag, tutorial
featured: true
---
```
--------------------------------
### Markdown Admonition (Note) Example
Source: https://github.com/docling-project/website/blob/main/blog/template/post.md
Demonstrates a 'Note' admonition or callout block. Use for highlighting important information or remarks.
```markdown
> **Note**
> This is a note callout.
```
--------------------------------
### Example Folder Naming Convention
Source: https://github.com/docling-project/website/blob/main/papers/README.md
Illustrates the required naming convention for paper folders, which includes a date prefix and a lowercase title with underscores.
```convention
20250117_docling_an_efficient_open_source_toolkit_for_ai_driven_document_conversion
```
--------------------------------
### Markdown Table Example
Source: https://github.com/docling-project/website/blob/main/blog/template/post.md
Provides a standard Markdown table structure. Use for presenting tabular data.
```markdown
| Header 1 | Header 2 | Header 3 |
|----------|----------|----------|
| Cell 1 | Cell 2 | Cell 3 |
| Cell 4 | Cell 5 | Cell 6 |
```
--------------------------------
### Markdown Reference-Style Link Example
Source: https://github.com/docling-project/website/blob/main/blog/template/post.md
Demonstrates reference-style links in Markdown, where the link text and URL are defined separately. This improves readability for complex links.
```markdown
[Link text][reference]
[Another link][ref2]
[reference]: https://example.com "Optional Title"
[ref2]: https://example.org
```
--------------------------------
### HTML Details and Summary Example
Source: https://github.com/docling-project/website/blob/main/blog/template/post.md
Illustrates the use of HTML's details and summary elements for creating collapsible content sections. Ideal for hiding supplementary information.
```html
Click to expand
Hidden content goes here.
```
--------------------------------
### Markdown Automatic Link Example
Source: https://github.com/docling-project/website/blob/main/blog/template/post.md
Illustrates automatic link creation for URLs and email addresses in Markdown. Simply enclose them in angle brackets.
```markdown
```
--------------------------------
### Markdown Abbreviation Example
Source: https://github.com/docling-project/website/blob/main/blog/template/post.md
Illustrates how to define abbreviations in Markdown using a reference style. This helps in clarifying acronyms used in the text.
```markdown
The HTML specification is maintained by the W3C.
*[HTML]: Hyper Text Markup Language
*[W3C]: World Wide Web Consortium
```
--------------------------------
### Markdown Image with Link Example
Source: https://github.com/docling-project/website/blob/main/blog/template/post.md
Shows how to create a linked image in Markdown by wrapping an image tag within a link. Clicking the image will navigate to the specified URL.
```markdown
](https://example.com)
```
--------------------------------
### Convert LaTeX to Markdown using CLI
Source: https://github.com/docling-project/website/blob/main/blog/20260315_00_the_latex_story/post.md
Use the Docling CLI to convert a LaTeX source file to Markdown. Ensure Docling is installed via pip.
```bash
pip install docling
# Convert a LaTeX source file to Markdown
docling paper.tex --from latex --to md --output ./out
```
--------------------------------
### Markdown Table with Alignment Example
Source: https://github.com/docling-project/website/blob/main/blog/template/post.md
Demonstrates a Markdown table with specified text alignment for each column. Useful for controlling data presentation.
```markdown
| Left Aligned | Center Aligned | Right Aligned |
|:-------------|:--------------:|--------------:|
| Left | Center | Right |
| Text | Text | Text |
```
--------------------------------
### Markdown Line Break Example
Source: https://github.com/docling-project/website/blob/main/blog/template/post.md
Demonstrates multiple ways to create line breaks in Markdown: using two spaces, a backslash, or an HTML `
` tag. Useful for controlling text layout.
```markdown
To create a line break, end a line with two or more spaces,
or use a backslash\
or use `
` tag.
Like this.
```
--------------------------------
### Docling Package Data
Source: https://github.com/docling-project/website/blob/main/plans/feature_08_ecosystem_overview.md
JSON data structure defining properties for each Docling package, including name, description, installation command, GitHub repository, and documentation link.
```json
[{"name": "docling", "description": "Core document conversion library.", "install": "pip install docling", "github": "https://github.com/docling-project/docling", "docs": "https://docling-project.github.io/docling"}, {"name": "docling-serve", "description": "REST API wrapper for deploying Docling as a service.", "install": "pip install docling-serve", "github": "https://github.com/docling-project/docling-serve"}, {"name": "docling-mcp", "description": "Model Context Protocol server for agentic access to Docling.", "github": "https://github.com/docling-project/docling-mcp"}, {"name": "docling-ts", "description": "TypeScript library for rendering Docling Documents in the browser.", "github": "https://github.com/docling-project/docling-ts"}]
```
--------------------------------
### HTML Div Element Example
Source: https://github.com/docling-project/website/blob/main/blog/template/post.md
Shows how to embed an HTML div element with inline styling for custom text formatting. Use for specific visual treatments not achievable with standard Markdown.
```html
This text is orange.
```
--------------------------------
### Load ChartNet Grounded QA Subset
Source: https://github.com/docling-project/website/blob/main/blog/20260612_00_chartnet_dataset/post.md
Loads the 'grounded_qa' subset of the ChartNet dataset, which includes bounding boxes for grounded question answering. The 'datasets' library must be installed.
```python
# Grounded QA with bounding boxes
grounded_qa = load_dataset("ibm-granite/ChartNet", "grounded_qa", split="train")
```
--------------------------------
### Python Fenced Code Block Example
Source: https://github.com/docling-project/website/blob/main/blog/template/post.md
Demonstrates a basic Python function within a fenced code block. Use this for including Python code examples in your documentation.
```python
def hello_world():
print("Hello, World!")
return True
```
--------------------------------
### Create Blog Post Directory
Source: https://github.com/docling-project/website/blob/main/README.md
Use this command to create the directory structure for a new blog post, including an images subfolder.
```bash
mkdir -p blog/20260306_14_my-awesome-post/images
```
--------------------------------
### Use Docling Service Client for Document Conversion
Source: https://github.com/docling-project/website/blob/main/blog/20260615_00_docling_for_ibm_watsonx/post.md
Initialize the DoclingServiceClient with service URL and API key, then use it to convert a document and export its content to Markdown. Ensure DOCLING_SERVICE_URL and DOCLING_API_KEY environment variables are set.
```python
from pathlib import Path
from docling.service_client import DoclingServiceClient
import os
# Setup required endpoint details
SERVICE_URL = os.getenv("DOCLING_SERVICE_URL")
API_KEY = os.getenv("DOCLING_API_KEY")
# Initialize the client
with DoclingServiceClient(url=SERVICE_URL, api_key=API_KEY) as client:
# Convert a document as you usually do
result = client.convert(
source=Path("path/to/doc.pdf")
)
markdown = result.document.export_to_markdown()
print(markdown)
```
--------------------------------
### Initialize Docling Viewer in Browser
Source: https://github.com/docling-project/website/blob/main/plans/feature_06_docling_ts_viewer.md
Client-side script to fetch paper data and instantiate the docling-ts viewer. Load the docling-ts library from a CDN or bundled asset and fetch the paper's docling.json. The viewer is then loaded into a specified DOM element, and a modal is displayed.
```javascript
import { DoclingViewer } from 'docling-ts';
async function openViewer(arxivId) {
const data = await fetch(`/papers/${arxivId}/docling.json`).then(r => r.json());
const viewer = new DoclingViewer(document.getElementById('paper-viewer'));
viewer.load(data);
document.getElementById('paper-modal').showModal();
}
```
--------------------------------
### Markdown Comment Example
Source: https://github.com/docling-project/website/blob/main/blog/template/post.md
Shows how to include comments in Markdown that will not be rendered in the output. Useful for notes to collaborators or for temporarily hiding content.
```markdown
```
--------------------------------
### FAQ Page Component Rendering
Source: https://github.com/docling-project/website/blob/main/plans/feature_02_faq_page.md
Renders the FAQ content on the `/faq/` page. Each section is displayed as a heading, with questions presented as collapsible accordions using HTML's `` and `` tags. Existing CSS styles for details elements are sufficient.
```python
# website/pages/faq.px (new)
from website.models.faq import load_faq_data
def FaqPage():
faq_data = load_faq_data()
return [
"FAQ
",
"Can't find your answer? Ask in [Discord] or open a [GitHub issue].
",
*[
f"{section.title}
" +
"".join([
f"\n{item.question}
\n{item.answer}
\n "
for item in section.items
])
for section in faq_data.sections
]
]
```
--------------------------------
### Markdown Admonition (Warning) Example
Source: https://github.com/docling-project/website/blob/main/blog/template/post.md
Shows a 'Warning' admonition block. Use to draw attention to potential issues or cautionary advice.
```markdown
> **Warning**
> This is a warning callout.
```
--------------------------------
### JavaScript Fenced Code Block Example
Source: https://github.com/docling-project/website/blob/main/blog/template/post.md
Illustrates a simple JavaScript function in a fenced code block. Suitable for showcasing JavaScript code snippets.
```javascript
function helloWorld() {
console.log("Hello, World!");
return true;
}
```
--------------------------------
### Load Default ChartNet Permissive Subset
Source: https://github.com/docling-project/website/blob/main/blog/20260612_00_chartnet_dataset/post.md
Loads the default 'core_permissive' subset of the ChartNet dataset, which is released under the CDLA-Permissive-2.0 license. Ensure the 'datasets' library is installed.
```python
from datasets import load_dataset
# Default permissive subset (CDLA-Permissive-2.0)
core_permissive = load_dataset("ibm-granite/ChartNet", "core_permissive")
```
--------------------------------
### Tolerant LaTeX Parsing with pylatexenc
Source: https://github.com/docling-project/website/blob/main/blog/20260315_00_the_latex_story/post.md
Demonstrates the use of `LatexWalker` with `tolerant_parsing=True` for building a LaTeX node tree, which is crucial for handling messy or non-standard LaTeX source.
```python
LatexWalker(..., tolerant_parsing=True)
```
--------------------------------
### Python: Configure and Run Docling for Chart Extraction
Source: https://github.com/docling-project/website/blob/main/blog/20260203_00_chart_understanding_in_docling/post.md
Configure PdfPipelineOptions to enable chart extraction and use DocumentConverter to process a PDF. Extracted chart data is accessed via PictureItem metadata.
```python
from pathlib import Path
import pandas as pd
from docling.datamodel.base_models import InputFormat
from docling.datamodel.pipeline_options import PdfPipelineOptions
from docling.document_converter import DocumentConverter, PdfFormatOption
from docling_core.types.doc import PictureItem
pdf_path = Path("reports/market-report.pdf")
pipeline_options = PdfPipelineOptions()
pipeline_options.do_chart_extraction = True
converter = DocumentConverter(
format_options={
InputFormat.PDF: PdfFormatOption(pipeline_options=pipeline_options)
}
)
result = converter.convert(pdf_path)
for item, _ in result.document.iterate_items():
if not isinstance(item, PictureItem):
continue
if item.meta is None or item.meta.tabular_chart is None:
continue
chart_data = item.meta.tabular_chart.chart_data
# Rebuild extracted grid as a DataFrame
grid = [["" for _ in range(chart_data.num_cols)] for _ in range(chart_data.num_rows)]
for cell in chart_data.table_cells:
grid[cell.start_row_offset_idx][cell.start_col_offset_idx] = cell.text
df = pd.DataFrame(grid)
print(df.to_csv(index=False, header=False))
```
--------------------------------
### Link to Colab Notebook
Source: https://github.com/docling-project/website/blob/main/plans/feature_07_live_demo.md
Use this HTML anchor tag to create a 'Try in Colab' button. This is the lowest effort option for providing an interactive demo.
```html
Try in Colab
```
--------------------------------
### Chart Extraction with Granite Vision 4.1-4B
Source: https://github.com/docling-project/website/blob/main/blog/20260612_00_chartnet_dataset/post.md
Demonstrates how to use the Granite Vision 4.1-4B model for chart-to-CSV, chart-to-summary, and chart-to-code generation using task tags. Requires transformers, torch, and pillow libraries.
```python
# Requires: transformers>=5.8.0, torch, pillow
import torch
from transformers import AutoProcessor, AutoModelForImageTextToText
from PIL import Image
model_id = "ibm-granite/granite-vision-4.1-4b"
device = "cuda" if torch.cuda.is_available() else "cpu"
processor = AutoProcessor.from_pretrained(model_id)
model = AutoModelForImageTextToText.from_pretrained(
model_id, dtype=torch.bfloat16, device_map=device
).eval()
chart = Image.open("chart.jpg").convert("RGB")
# ChartNet's core tasks:
# -> underlying data table as CSV
# -> natural-language description
# -> Python code that recreates the chart
for task in ["", "", ""]:
conversation = [{"role": "user", "content": [
{"type": "image"},
{"type": "text", "text": task},
]}]
text = processor.apply_chat_template(
conversation, tokenize=False, add_generation_prompt=True
)
inputs = processor(text=text, images=[chart], return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=4096)
print(f"{task}:\n{processor.decode(out[0, inputs['input_ids'].shape[1]:], skip_special_tokens=True)}\n")
```
--------------------------------
### Embed HuggingFace Space Demo
Source: https://github.com/docling-project/website/blob/main/plans/feature_07_live_demo.md
Embed a HuggingFace Space Gradio demo using an iframe. This option requires a maintained demo Space and handles compute externally.
```html
```
--------------------------------
### Docling LaTeX Backend Directory Structure
Source: https://github.com/docling-project/website/blob/main/blog/20260315_00_the_latex_story/post.md
Illustrates the organizational structure of the Docling LaTeX backend, showing the separation of concerns among different modules like handlers, engines, and utilities.
```text
docling/docling/backend/latex/
├── __init__.py
├── backend.py
├── constants.py
├── context.py
├── engines/
│ ├── __init__.py
│ └── base.py
├── handlers/
│ ├── __init__.py
│ ├── environments.py
│ ├── macros.py
│ └── math.py
├── libraries/
│ ├── __init__.py
│ └── base.py
└── utils/
├── __init__.py
├── encoding.py
├── table.py
└── text.py
```