pub enum Selector {
Show 32 variants
Blockquote,
Footnote,
List(Option<usize>, Option<bool>),
Toml,
Yaml,
Break,
InlineCode,
InlineMath,
Delete,
Emphasis,
FootnoteRef,
Html,
Image,
ImageRef,
MdxJsxTextElement,
Link,
LinkRef,
Strong,
Code,
Math,
Heading(Option<u8>),
Table(Option<usize>, Option<usize>),
TableAlign,
Text,
HorizontalRule,
Definition,
MdxFlowExpression,
MdxTextExpression,
MdxJsEsm,
MdxJsxFlowElement,
Recursive,
Attr(AttrKind),
}Expand description
A selector for matching specific types of markdown nodes.
Selectors are used to query and filter markdown documents, similar to CSS selectors for HTML. Each variant matches a specific type of markdown element.
Variants§
Blockquote
Matches blockquote elements (e.g., > quoted text).
Footnote
Matches footnote definitions.
List(Option<usize>, Option<bool>)
Matches list elements.
The first Option<usize> specifies an item index, the second Option<bool> indicates ordered/unordered.
Toml
Matches TOML frontmatter blocks.
Yaml
Matches YAML frontmatter blocks.
Break
Matches line break elements.
InlineCode
Matches inline code elements (e.g., `code`).
InlineMath
Matches inline math elements (e.g., $math$).
Delete
Matches strikethrough/delete elements (e.g., ~~text~~).
Emphasis
Matches emphasis elements (e.g., *text* or _text_).
FootnoteRef
Matches footnote references (e.g., [^1]).
Html
Matches raw HTML elements.
Image
Matches image elements (e.g., ).
ImageRef
Matches image reference elements (e.g., ![alt][ref]).
MdxJsxTextElement
Matches MDX JSX text elements.
Link
Matches link elements (e.g., [text](url)).
LinkRef
Matches link reference elements (e.g., [text][ref]).
Strong
Matches strong/bold elements (e.g., **text**).
Code
Matches code block elements.
Math
Matches math block elements (e.g., $$math$$).
Heading(Option<u8>)
Matches heading elements.
The Option<u8> specifies the heading level (1-6). If None, matches any heading level.
Table(Option<usize>, Option<usize>)
Matches table elements.
The first Option<usize> specifies row index, the second specifies column index.
TableAlign
Matches table alignment elements.
Text
Matches text nodes.
HorizontalRule
Matches horizontal rule elements (e.g., ---, ***, ___).
Definition
Matches link/image definition elements.
MdxFlowExpression
Matches MDX flow expression elements.
MdxTextExpression
Matches MDX text expression elements.
MdxJsEsm
Matches MDX ES module import/export elements.
MdxJsxFlowElement
Matches MDX JSX flow elements.
Recursive
Matches recursively all child nodes.
Attr(AttrKind)
Matches a specific attribute of a markdown node.
Implementations§
Trait Implementations§
Source§impl PartialOrd for Selector
impl PartialOrd for Selector
impl Eq for Selector
impl StructuralPartialEq for Selector
Auto Trait Implementations§
impl Freeze for Selector
impl RefUnwindSafe for Selector
impl Send for Selector
impl Sync for Selector
impl Unpin for Selector
impl UnsafeUnpin for Selector
impl UnwindSafe for Selector
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more