Code Snippet

See: https://www.carbondesignsystem.com/components/code-snippet/usage/

Code snippets are strings or small blocks of reusable code that can be copied and inserted in a code file.

Overview

There are three different variants of code snippets to help cater to varied line length use cases—inline, single line, and multi-line.

class carbondesign.tags.code_snippet.CodeSnippet(*args, **kwargs)

Code Snippet component.

WANT_CHILDREN = True

Template Tag needs closing end tag.

MODES = ('inline', 'single', 'multi')

Available variants.

NODE_PROPS = ('light',)

Extended Template Tag arguments.

prepare(values, context)

Prepare values for rendering the templates.

render_multi(values, context)

Output html of the component.

render_single(values, context)

Output html of the component.

render_inline(values, context)

Output html of the component.