### Install Dependencies Source: https://github.com/docling-project/website/blob/main/README.md Install the project dependencies using uv. ```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]" ``` -------------------------------- ### Run Development Server Source: https://github.com/docling-project/website/blob/main/README.md Start the development server locally on port 5001. ```bash uv run website/main.py ``` -------------------------------- ### Define Thumbnail Paths Source: https://github.com/docling-project/website/blob/main/blog/template/post.md Examples of valid thumbnail configuration values. ```text thumbnail: images/thumbnail.jpg thumbnail: images/thumbnail.jpeg thumbnail: images/thumbnail.png thumbnail: images/thumbnail.webp ``` -------------------------------- ### 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]" ``` -------------------------------- ### Implement Fenced Code Blocks Source: https://github.com/docling-project/website/blob/main/blog/template/post.md Examples of syntax highlighting for different programming languages. ```python def hello_world(): print("Hello, World!") return True ``` ```javascript function helloWorld() { console.log("Hello, World!"); return true; } ``` ```bash # Shell commands echo "Hello, World!" ls -la ``` -------------------------------- ### 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")) ``` -------------------------------- ### 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 ``` -------------------------------- ### 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 --- ``` -------------------------------- ### 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 ``` -------------------------------- ### 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"}] ``` -------------------------------- ### 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") ``` -------------------------------- ### Create Blog Post Directory Source: https://github.com/docling-project/website/blob/main/README.md Command to initialize the folder structure for a new blog post. ```bash mkdir -p blog/20260306_14_my-awesome-post/images ``` -------------------------------- ### Serve Static Build Source: https://github.com/docling-project/website/blob/main/README.md Serve the generated static files using a local HTTP server. ```bash python3 -m http.server 8000 --directory dist ``` -------------------------------- ### Build Static Site Source: https://github.com/docling-project/website/blob/main/README.md Generate the static site files into the dist directory. ```bash uv run website/build.py ``` -------------------------------- ### Preview Sub-path Build Source: https://github.com/docling-project/website/blob/main/README.md Build and serve the site with a specific base path for sub-path deployment testing. ```bash uv run website/build.py --out /tmp/site/website --base-path /website python3 -m http.server 5055 --directory /tmp/site ``` -------------------------------- ### 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) ``` -------------------------------- ### 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") ``` -------------------------------- ### 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(); } ``` -------------------------------- ### 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 ] ] ``` -------------------------------- ### Project Directory Structure Source: https://github.com/docling-project/website/blob/main/README.md The file system layout for the website source and public assets. ```text website/ pages/ one module per route — section composition only components/ reusable product components (hero, document demo, ...) data/ site content: navigation, samples, product copy, integrations highlight.py build-time Pygments highlighting (no client-side highlighter) seo.py sitemap.xml and robots.txt, generated from one route list public/ css/ cascade layers: tokens, reset, base, layout, components, pages js/ ES modules, one per concern, loaded via js/main.js font/ self-hosted IBM Plex Sans (variable) and Plex Mono ``` -------------------------------- ### 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 ``` -------------------------------- ### Define Blog Post Metadata Source: https://github.com/docling-project/website/blob/main/blog/template/post.md The YAML front matter required at the top of every post.md file. ```yaml --- title: The title of your post date: 10-02-2019 summary: A short description of your post that will be shown in the overview. thumbnail: images/thumbnail.jpg category: technical --- ``` -------------------------------- ### Load Single File from ChartNet Core Subset Source: https://github.com/docling-project/website/blob/main/blog/20260612_00_chartnet_dataset/post.md Loads only the first file ('core_000.parquet') from the 'core' subset of ChartNet. This is useful for exploring the dataset before committing to a full download, as subsets can be very large. Requires the 'datasets' library. ```python first_core_file = load_dataset("ibm-granite/ChartNet", data_files="core/core_000.parquet") print(first_core_file.shape) # {'train': (10000, 5)} ``` -------------------------------- ### Blog Post Metadata Template Source: https://github.com/docling-project/website/blob/main/README.md The YAML front matter and content structure for a post.md file. ```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. ![Image description](images/my-image.jpg) ``` -------------------------------- ### Load ChartNet Experimental Subsets Source: https://github.com/docling-project/website/blob/main/blog/20260612_00_chartnet_dataset/post.md Loads the 'core' and 'reasoning' subsets, which correspond to the paper's experiments. These subsets can be joined using the 'id' column. The 'datasets' library is required. ```python # Core and reasoning subsets (joinable on the "id" column) core = load_dataset("ibm-granite/ChartNet", "core") reasoning = load_dataset("ibm-granite/ChartNet", "reasoning") ``` -------------------------------- ### Passing Post Data to `` in `blog.px` Source: https://github.com/docling-project/website/blob/main/plans/feature_09_seo.md In `website/pages/blog.px`, the `title` and `summary` of a blog post are passed as props to the `` component to generate unique SEO tags for individual blog posts. ```html ``` -------------------------------- ### Load ChartNet Human-Verified Test Split Source: https://github.com/docling-project/website/blob/main/blog/20260612_00_chartnet_dataset/post.md Loads the human-verified test split of the ChartNet dataset. This split is disjoint from the other subsets. Requires the 'datasets' library. ```python # Human-verified train/test splits (disjoint from the other subsets) human_verified_test = load_dataset("ibm-granite/ChartNet", "human_verified", split="test") ``` -------------------------------- ### Blog Post Directory Structure Source: https://github.com/docling-project/website/blob/main/README.md The required directory layout for new blog posts, using a timestamped folder naming convention. ```text blog/ └── YYYYMMDD_HH_post-title/ ├── post.md └── images/ ├── thumbnail.jpg └── other-images.jpg ```