Skip to content

Commit

Permalink
docs(quarto): override api code blocks with custom renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
machow authored and cpcloud committed Sep 6, 2023
1 parent 8344079 commit b504fee
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/_quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ code-annotations: hover
execute:
warning: false
error: false
eval: false

filters:
- interlinks
Expand Down Expand Up @@ -146,6 +147,7 @@ quartodoc:
title: Reference
sidebar: reference/_sidebar.yml
render_interlinks: true
renderer: _renderer.py
sections:
- title: Expressions
desc: ""
Expand Down
18 changes: 18 additions & 0 deletions docs/_renderer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from __future__ import annotations

import griffe.dataclasses as dc # noqa: F401
import griffe.docstrings.dataclasses as ds # noqa: F401
import griffe.expressions as expr # noqa: F401
import quartodoc.ast as qast
from plum import dispatch
from quartodoc import MdRenderer


class Renderer(MdRenderer):
style = "ibis"

@dispatch
def render(self, el: qast.ExampleCode):
return f"""```
{el.value}
```"""

0 comments on commit b504fee

Please sign in to comment.