Skip to main content

CodeGroup

Struct CodeGroup 

Source
pub struct CodeGroup { /* private fields */ }
Expand description

Render ::: code-group containers as tabbed code panels.

Implementations§

Source§

impl CodeGroup

Source

pub fn new() -> Self

A code-group extension with the default class names.

Source

pub fn with_options(opts: CodeGroupOptions) -> Self

A code-group extension with caller-chosen class names.

Trait Implementations§

Source§

impl CarveExtension for CodeGroup

Source§

fn name(&self) -> &'static str

Stable name used to identify the extension.
Source§

fn before_render( &self, doc: Document, _ctx: &BeforeRenderContext<'_>, ) -> Document

beforeRender transform. Receives a BeforeRenderContext carrying the render Options AND the effective Mode for the actual target format. An extension that emits its final HTML here (the carve-rs transform model for FencedRender / MathBlock) branches on ctx.mode() / ctx.is_static() and consults ctx.options.renderers. Read more
Source§

fn render_extension_carrier( &self, node: &ExtensionCarrier, ctx: &RenderContext<'_>, ) -> Option<String>

Render a block carrier left by a render-stage transform.
Source§

fn semantic_span_names(&self) -> &'static [&'static str]

Semantic span attribute names this extension adds (spec PART 9 §10). Read more
Source§

fn diagram_key(&self) -> Option<&str>

The StaticRenderers::diagram key this extension is consulted under, when it has one. None for everything that is not a fenced-render preset. Read more
Source§

fn match_inline( &self, _text: &str, _pos: usize, _ctx: &MatcherContext<'_>, ) -> Option<InlineMatch>

Match an inline construct beginning at pos in text.
Source§

fn match_block( &self, _lines: &[&str], _start: usize, _ctx: &MatcherContext<'_>, ) -> Option<BlockMatch>

Match a block construct beginning at start in lines.
Source§

fn after_parse(&self, doc: Document) -> Document

Rewrite the parsed document before render preparation.
Source§

fn render_inline_extension( &self, _node: &InlineExtension, _ctx: &RenderContext<'_>, ) -> Option<String>

Render an inline extension node as HTML, if this extension owns it.
Source§

fn carrier_anchored_at_column_zero(&self, _node: &ExtensionCarrier) -> bool

Does this extension’s carrier anchor its element at column 0 whatever the nesting, rather than at the ambient block indentation? Read more
Source§

impl Debug for CodeGroup

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for CodeGroup

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.