# rendering.ClassRenderer

The presentation of a class, with its constructor signature and member groups

Usage

[Source](https://github.com/posit-dev/great-docs/blob/main/great_docs/_apiref/_rendering/classes.py#L33-L189)

``` python
rendering.ClassRenderer(
    node,
    level=1,
    contained=False,
    page_path=None,
    display_name_format="doc",
    signature_name_format="doc",
    *,
    renderers=_default_renderers(),
    extension=_default_extension(),
    context_page_path=None,
    _purpose=_RenderingPurpose.OBJECT,
)
```

The description shows the subject, then the Usage and source row and the constructor signature, followed by the direct bases when enabled. The body shows the docstring sections followed by member groups. For a dataclass without an authored `Parameters` or `Attributes` section, the renderer generates `Parameter Attributes` and `Init Parameters` sections from the constructor parameters.

## Parameter Attributes

`node: (     APIReference     | content.DocClass     | content.DocFunction     | content.DocAttribute     | content.DocTypeAlias     | content.DocModule     | content.Page     | content.Section )`  
The node being documented

`level: int = 1`  
The heading depth of this appearance

`contained: bool = False`  
Whether this object is documented inside another object's documentation

A contained member's summary row links to its heading on the same page, and its [context](../reference/great_docs.rendering.ObjectRenderer.context.md) reports the containing page.

`page_path: str | None = None`  
The page that this object's summary row links to

API pages supply a path relative to the reference directory. `None` links within the current page, and contained members always link to a local anchor. For the containing page relative to the output directory, use `context.page_path`.

`display_name_format: DisplayNameFormat = "doc"`  
Format for the display name

`signature_name_format: DisplayNameFormat = "doc"`  
Format for the signature name

`renderers: Renderers = _default_renderers()`  
Renderer choices shared with nested objects, pages and summaries

`extension: Extension = _default_extension()`  
The extension that supplies settings and project directories

A standalone renderer uses default settings and has no project directories.

`context_page_path: str | None = None`  
The containing page's path relative to the output directory, apart from summary links

`_purpose: _RenderingPurpose = _RenderingPurpose.OBJECT`  

## Functions

| Name | Description |
|----|----|
| [\_\_post_init\_\_()](great_docs.rendering.ClassRenderer.__post_init__.md) | Narrow `doc` and [obj](../reference/rendering.RenderContext.md#great_docs._apiref._rendering._context.RenderContext.obj) to class documentation |
| [docstring_sections_content()](great_docs.rendering.ClassRenderer.docstring_sections_content.md) | The docstring sections, with generated sections for a dataclass's fields |
| [init_parameters()](great_docs.rendering.ClassRenderer.init_parameters.md) | The dataclass's signature parameters that are not attributes |
| [is_dataclass()](great_docs.rendering.ClassRenderer.is_dataclass.md) | Whether the class object is a dataclass |
| [parameter_attributes()](great_docs.rendering.ClassRenderer.parameter_attributes.md) | The dataclass's signature parameters that are also annotated attributes |
| [render_bases()](great_docs.rendering.ClassRenderer.render_bases.md) | Render direct base classes when the reference enables them |
| [render_description()](great_docs.rendering.ClassRenderer.render_description.md) | Render the class description followed by the direct base classes |
