Skip to main content
OpenGround can ingest documentation from three source types: git repositories, sitemaps, and local directories. Each source type has a dedicated extractor that produces standardized ParsedPage objects for downstream processing.

Source Types

Git Repositories

Extract documentation from GitHub, GitLab, or any git repository with version control.

How It Works

The git extractor (extract/git.py) uses sparse checkout for efficiency:
Sparse checkout downloads only the documentation directories you need, not the entire repository. This is much faster for large repos.

Version Resolution

OpenGround intelligently resolves git refs (from extract/git.py:80-119):
You can use v1.0.0 or 1.0.0 - OpenGround will find the correct tag automatically.

Supported File Types

From extract/common.py:36-38, git extraction supports:
The extractor automatically:
  • Parses YAML front matter in Markdown/MDX
  • Extracts cells from Jupyter notebooks
  • Converts HTML to Markdown using Trafilatura
  • Skips build artifacts (node_modules, __pycache__, .git)

URL Generation

Each extracted file gets a web URL for reference (from extract/git.py:268-270):

Sitemaps

Extract documentation from websites that provide a sitemap.xml.

How It Works

The sitemap extractor (extract/sitemap.py) fetches and processes web pages:
1

Fetch Sitemap

2

Check robots.txt

OpenGround respects robots.txt and only crawls allowed URLs.
3

Process Pages Concurrently

Downloads and processes up to 50 pages concurrently for speed.
4

Extract Content

Trafilatura extracts clean content, removing navigation, ads, etc.
Some sites use client-side rendering (React, Vue, Next.js) which requires JavaScript. OpenGround will detect this and skip those pages. Use the git source type instead for such documentation.

JavaScript Detection

From extract/sitemap.py:141-156, OpenGround warns about JS-required pages:

Local Paths

Extract documentation from directories on your file system.

How It Works

The local path extractor (extract/local_path.py) is the simplest:
Local paths use file:// URLs for references. Perfect for work-in-progress documentation or private codebases.

Version Naming

For local paths, OpenGround generates a version string automatically:

Source Configuration Files

OpenGround remembers source configurations so you can update libraries without re-specifying URLs.

Sources File Locations

From config.py:35-37, there are two sources files:

Priority Order

From extract/source.py:109-161, OpenGround checks sources in order:
1

Custom Path

If you specify --sources-file /path/to/sources.json, use that.
2

Project-Local

Check .openground/sources.json in current directory.Allows project-specific configurations to override user defaults.
3

User Sources

Check ~/.openground/sources.json.Shared across all your projects.
4

Package Bundled

Fall back to bundled sources (if any).

Sources File Format

From the README example (lines 149-162):

Auto-Save Behavior

From extract/source.py:58-89, OpenGround automatically saves sources:
When you run:
OpenGround saves the configuration. Later, you can update without re-specifying:
To disable auto-save:

File Processing Pipeline

All source types share a common file processing pipeline (from extract/common.py:145-227):
1

Filter Files

2

Extract Content

Different handlers for each file type:
  • Markdown/MDX/RST: Parse YAML front matter
  • Jupyter: Extract markdown + code cells
  • HTML: Use Trafilatura for content extraction
3

Generate Metadata

4

Create ParsedPage

Raw Data Storage

Extracted pages are saved as JSON files before embedding (from extract/common.py:230-258):
Default location from config.py:41-52:
Example structure:

Incremental Updates

OpenGround supports efficient updates by detecting changed content (from extract/common.py:260-289):
The update command uses this to:
  1. Fetch new documentation
  2. Hash each page’s content
  3. Compare with existing hashes
  4. Only re-embed changed pages
See the Update Guide for details.

Next Steps

Embeddings

Learn how OpenGround converts text to vector embeddings

Search

Understand hybrid search with vector similarity and BM25

Architecture

See how sources fit into the overall architecture

Add Documentation

Step-by-step guide to adding your first library