Skip to content
Open
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
c3a97de
Add MkDocs Material configuration
anatoly-scherbakov Jun 1, 2026
5594559
Use MkDocs Material for documentation dependencies
anatoly-scherbakov Jun 1, 2026
8908ed4
Add documentation homepage
anatoly-scherbakov Jun 1, 2026
1b4491f
Add installation documentation
anatoly-scherbakov Jun 1, 2026
c3e84e6
Add JSON-LD quick examples documentation
anatoly-scherbakov Jun 1, 2026
01c3f5f
Add document loader overview documentation
anatoly-scherbakov Jun 1, 2026
813b482
Document RequestsDocumentLoader usage
anatoly-scherbakov Jun 1, 2026
3f3348a
Document AioHttpDocumentLoader usage
anatoly-scherbakov Jun 1, 2026
570840b
Document FrozenDocumentLoader usage
anatoly-scherbakov Jun 1, 2026
d27ad22
Add manual public API reference
anatoly-scherbakov Jun 1, 2026
01e2c44
Add documentation deployment workflow
anatoly-scherbakov Jun 1, 2026
a966bfa
Add MkDocs serve target
anatoly-scherbakov Jun 1, 2026
0747f9c
Document MkDocs contributor commands
anatoly-scherbakov Jun 1, 2026
daa6776
Ignore MkDocs site output
anatoly-scherbakov Jun 1, 2026
51f60bd
Remove Sphinx docs Makefile
anatoly-scherbakov Jun 1, 2026
d417b98
Remove Sphinx docs configuration
anatoly-scherbakov Jun 1, 2026
f7e5e15
Remove Sphinx docs index
anatoly-scherbakov Jun 1, 2026
a5b00e8
Remove Sphinx Windows build script
anatoly-scherbakov Jun 1, 2026
a75f9a8
Build documentation on every branch push
anatoly-scherbakov Jun 1, 2026
af6c2e9
Pin documentation workflow actions
anatoly-scherbakov Jun 1, 2026
178bb76
Add documentation macros module
anatoly-scherbakov Jun 1, 2026
747e7d2
Add MkDocs macros dependency
anatoly-scherbakov Jun 1, 2026
fc68f8c
Enable MkDocs macros plugin
anatoly-scherbakov Jun 1, 2026
d49ca6d
Render bundled contexts in frozen loader docs
anatoly-scherbakov Jun 1, 2026
8d5417f
Import bundled contexts in docs macro
anatoly-scherbakov Jun 1, 2026
d9d6035
Install runtime dependencies for docs macros
anatoly-scherbakov Jun 1, 2026
7de8a94
Convert README from rst to md and update the contents.
mielvds Jun 9, 2026
df2cd9a
Add README in markdown
mielvds Jun 9, 2026
ee797ac
Change symbolic link README.txt
mielvds Jun 9, 2026
54105bb
Wrap markdown at 80 ch
mielvds Jun 9, 2026
c612d48
Convert CONTRIBUTING to markdown
mielvds Jun 10, 2026
09e509c
Update README.md
mielvds Jun 10, 2026
4cca153
Update README.md
mielvds Jun 10, 2026
2a86785
Remove trailing links in contributing.md
mielvds Jun 10, 2026
1d7079c
Adjust changelog
mielvds Jun 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Documentation

on:
push:
pull_request:
branches:
- '**'

permissions: {}

concurrency:
group: pages
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
with:
python-version: '3.14'
cache: 'pip'
- name: Install documentation dependencies
run: |
python -m pip install --upgrade pip
pip install -r docs/requirements.txt
- name: Build documentation
run: mkdocs build --strict
- name: Upload Pages artifact
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1
with:
path: site

deploy:
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
needs: build
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ build
cover
dist
docs/_build
site/
Comment thread
mielvds marked this conversation as resolved.
lib/PyLD.egg-info
profiler
tests/test_caching.py
Expand Down
21 changes: 21 additions & 0 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,27 @@ Code
* Use version X.Y.Z-dev in dev mode.
* Use version X.Y.Z for releases.

Documentation
-------------

The public documentation site is built with MkDocs Material.

* Install documentation dependencies:

* ``pip install -r docs/requirements.txt``

* Preview documentation locally:

* ``mkdocs serve``

* Check documentation before submitting changes:

* ``mkdocs build --strict``

* Refresh bundled JSON-LD context files:

* ``make download-bundled-contexts``

Versioning
----------

Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
.PHONY: install test upgrade-submodules download-bundled-contexts
.PHONY: install test serve upgrade-submodules download-bundled-contexts

install:
pip install -e .

test:
pytest --cov=pyld

serve:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you can serve the docs from make, I'd expect you can build them too (including installing the deps).

mkdocs serve --dev-addr 127.0.0.1:8008

upgrade-submodules:
git submodule update --remote --init --recursive

Expand Down
136 changes: 0 additions & 136 deletions docs/Makefile

This file was deleted.

135 changes: 135 additions & 0 deletions docs/api-reference.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
# API Reference

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was generated using some tool?


This page lists the public APIs that are intended for direct user code. PyLD
also contains internal processor classes and helper functions that are not
documented here.

## Module `pyld.jsonld`

### `compact(input_, ctx, options=None)`

Compact a JSON-LD document using the provided context.

### `expand(input_, options=None, on_property_dropped=noop)`

Expand a JSON-LD document, removing context aliases and producing expanded
JSON-LD form. `on_property_dropped` can be used to observe or reject properties
that do not expand to absolute IRIs.

### `flatten(input_, ctx=None, options=None)`

Flatten a JSON-LD document. If `ctx` is supplied, compact the flattened output
with that context.

### `frame(input_, frame, options=None)`

Frame a JSON-LD document according to the supplied frame.

### `link(input_, ctx, options=None)`

Experimentally link a JSON-LD document's nodes in memory. This is equivalent to
framing with `@embed: @link`.

### `normalize(input_, options=None)`

Normalize a JSON-LD document. Common options include `algorithm` and `format`.
Use `{"algorithm": "URDNA2015", "format": "application/n-quads"}` to produce
canonical N-Quads.

### `from_rdf(input_, options=None)`

Convert RDF input to JSON-LD.

### `to_rdf(input_, options=None)`

Convert JSON-LD input to RDF dataset form.

### `set_document_loader(load_document_)`

Set the global document loader callable.

### `get_document_loader()`

Return the current global document loader callable.

### `load_document(url, options, base=None, profile=None, request_profile=None)`

Load a remote document using the configured or supplied document loader.

### `requests_document_loader(**kwargs)`

Create a `requests`-based document loader. Pass `secure=True` to require HTTPS.
Other keyword arguments are forwarded to `requests.get()`.

### `aiohttp_document_loader(**kwargs)`

Create an `aiohttp`-based document loader. Pass `secure=True` to require HTTPS.
Other keyword arguments are forwarded to `aiohttp` request calls.

### `register_rdf_parser(content_type, parser)`

Register an RDF parser for a content type.

### `unregister_rdf_parser(content_type)`

Remove a registered RDF parser for a content type.

### `parse_link_header(header)`

Parse an HTTP `Link` header.

### `JsonLdProcessor`

Processor class behind the module-level convenience functions. Most callers use
the module-level functions directly.

### `JsonLdError`

Exception type raised for JSON-LD processing and loading errors.

### `ContextResolver`

Context resolver that can be supplied in operation options for custom context
loading and caching behavior.

### `freeze(value)`

Return an immutable mapping for dictionary values. This is used by PyLD's
context caches.

## Top-Level Exports

### `jsonld`

The main JSON-LD processing module.

### `DocumentLoader`

Abstract base class for class-based document loaders. PyLD still accepts any
callable with the loader signature.

### `RemoteDocument`

Typed mapping shape returned by document loaders.

### `RequestsDocumentLoader`

Class-based remote document loader implemented with `requests`.

### `AioHttpDocumentLoader`

Class-based remote document loader implemented with `aiohttp`.

### `FrozenDocumentLoader`

Allowlist-only document loader for deployments that must not fetch arbitrary
remote contexts.

### `BUNDLED_CONTEXTS`

Mapping of selected common JSON-LD context URLs to bundled local context files.

### `ContextResolver`

Context resolver that can be supplied in operation options for custom context
loading and caching behavior.
Loading
Loading