MD::details::HtmlVisitor

Search for usage in LXR

MD::details::HtmlVisitor< Trait > Class Template Reference

#include <html.h>

Inheritance diagram for MD::details::HtmlVisitor< Trait >:

Classes

struct  FootnoteRefStuff
 

Public Member Functions

 HtmlVisitor ()=default
 
 ~HtmlVisitor () override=default
 
virtual Trait::String toHtml (std::shared_ptr< Document< Trait > > doc, const typename Trait::String &hrefForRefBackImage, bool wrappedInArticle=true)
 
- Public Member Functions inherited from MD::Visitor< Trait >
 Visitor ()=default
 
virtual ~Visitor ()=default
 
void process (std::shared_ptr< Document< Trait > > d)
 

Protected Member Functions

virtual void closeStyle (const typename ItemWithOpts< Trait >::Styles &styles)
 
void onAddLineEnding () override
 
void onAnchor (Anchor< Trait > *a) override
 
void onBlockquote (Blockquote< Trait > *b) override
 
void onCode (Code< Trait > *c) override
 
void onFootnoteRef (FootnoteRef< Trait > *ref) override
 
virtual void onFootnotes (const typename Trait::String &hrefForRefBackImage)
 
void onHeading (Heading< Trait > *h) override
 
virtual void onHeading (Heading< Trait > *h, const typename Trait::String &ht)
 
void onHorizontalLine (HorizontalLine< Trait > *) override
 
void onImage (Image< Trait > *i) override
 
void onInlineCode (Code< Trait > *c) override
 
void onLineBreak (LineBreak< Trait > *) override
 
void onLink (Link< Trait > *l) override
 
void onList (List< Trait > *l) override
 
void onListItem (ListItem< Trait > *i, bool first) override
 
void onMath (Math< Trait > *m) override
 
void onParagraph (Paragraph< Trait > *p, bool wrap) override
 
void onRawHtml (RawHtml< Trait > *h) override
 
void onTable (Table< Trait > *t) override
 
void onText (Text< Trait > *t) override
 
virtual void openStyle (const typename ItemWithOpts< Trait >::Styles &styles)
 
- Protected Member Functions inherited from MD::Visitor< Trait >
virtual void onFootnote (Footnote< Trait > *f)
 
virtual void onTableCell (TableCell< Trait > *c)
 
virtual void onUserDefined (Item< Trait > *item)
 

Protected Attributes

bool m_dontIncrementFootnoteCount = false
 
Trait::template Vector< FootnoteRefStuffm_fns
 
Trait::String m_html
 
bool m_isWrappedInArticle = true
 
bool m_justCollectFootnoteRefs = false
 
- Protected Attributes inherited from MD::Visitor< Trait >
Trait::template Vector< typename Trait::String > m_anchors
 
std::shared_ptr< Document< Trait > > m_doc
 

Detailed Description

template<class Trait>
class MD::details::HtmlVisitor< Trait >

HTML visitor interface to walk through Document.

Definition at line 87 of file html.h.

Constructor & Destructor Documentation

◆ HtmlVisitor()

template<class Trait >
MD::details::HtmlVisitor< Trait >::HtmlVisitor ( )
default

◆ ~HtmlVisitor()

template<class Trait >
MD::details::HtmlVisitor< Trait >::~HtmlVisitor ( )
overridedefault

Member Function Documentation

◆ closeStyle()

template<class Trait >
virtual void MD::details::HtmlVisitor< Trait >::closeStyle ( const typename ItemWithOpts< Trait >::Styles & styles)
inlineprotectedvirtual

Insert into HTML tags for closing styles.

Definition at line 135 of file html.h.

◆ onAddLineEnding()

template<class Trait >
void MD::details::HtmlVisitor< Trait >::onAddLineEnding ( )
inlineoverrideprotectedvirtual

Handle new line in HTML.

Implements MD::Visitor< Trait >.

Definition at line 158 of file html.h.

◆ onAnchor()

template<class Trait >
void MD::details::HtmlVisitor< Trait >::onAnchor ( Anchor< Trait > * a)
inlineoverrideprotectedvirtual

Handle anchor.

Parameters
aAnchor.

Implements MD::Visitor< Trait >.

Definition at line 449 of file html.h.

◆ onBlockquote()

template<class Trait >
void MD::details::HtmlVisitor< Trait >::onBlockquote ( Blockquote< Trait > * b)
inlineoverrideprotectedvirtual

Handle blockquote.

Parameters
bBlockquote.

Reimplemented from MD::Visitor< Trait >.

Definition at line 292 of file html.h.

◆ onCode()

template<class Trait >
void MD::details::HtmlVisitor< Trait >::onCode ( Code< Trait > * c)
inlineoverrideprotectedvirtual

Handle code block.

Parameters
cCode.

Implements MD::Visitor< Trait >.

Definition at line 252 of file html.h.

◆ onFootnoteRef()

template<class Trait >
void MD::details::HtmlVisitor< Trait >::onFootnoteRef ( FootnoteRef< Trait > * ref)
inlineoverrideprotectedvirtual

Handle footnote reference.

Parameters
refFootnote reference.

Implements MD::Visitor< Trait >.

Definition at line 558 of file html.h.

◆ onFootnotes()

template<class Trait >
virtual void MD::details::HtmlVisitor< Trait >::onFootnotes ( const typename Trait::String & hrefForRefBackImage)
inlineprotectedvirtual

Handle footnotes.

Definition at line 678 of file html.h.

◆ onHeading() [1/2]

template<class Trait >
void MD::details::HtmlVisitor< Trait >::onHeading ( Heading< Trait > * h)
inlineoverrideprotectedvirtual

Handle heading.

Parameters
hHeading.

Implements MD::Visitor< Trait >.

Definition at line 224 of file html.h.

◆ onHeading() [2/2]

template<class Trait >
virtual void MD::details::HtmlVisitor< Trait >::onHeading ( Heading< Trait > * h,
const typename Trait::String & ht )
inlineprotectedvirtual

Handle heading.

Parameters
hHeading.
htHeading tag.

Definition at line 653 of file html.h.

◆ onHorizontalLine()

template<class Trait >
void MD::details::HtmlVisitor< Trait >::onHorizontalLine ( HorizontalLine< Trait > * )
inlineoverrideprotectedvirtual

Handle horizontal line.

Implements MD::Visitor< Trait >.

Definition at line 475 of file html.h.

◆ onImage()

template<class Trait >
void MD::details::HtmlVisitor< Trait >::onImage ( Image< Trait > * i)
inlineoverrideprotectedvirtual

Handle image.

Parameters
iImage.

Implements MD::Visitor< Trait >.

Definition at line 540 of file html.h.

◆ onInlineCode()

template<class Trait >
void MD::details::HtmlVisitor< Trait >::onInlineCode ( Code< Trait > * c)
inlineoverrideprotectedvirtual

Handle inline code.

Parameters
cCode.

Implements MD::Visitor< Trait >.

Definition at line 274 of file html.h.

◆ onLineBreak()

template<class Trait >
void MD::details::HtmlVisitor< Trait >::onLineBreak ( LineBreak< Trait > * )
inlineoverrideprotectedvirtual

Handle line break.

Implements MD::Visitor< Trait >.

Definition at line 195 of file html.h.

◆ onLink()

template<class Trait >
void MD::details::HtmlVisitor< Trait >::onLink ( Link< Trait > * l)
inlineoverrideprotectedvirtual

Handle link.

Parameters
lLink.

Implements MD::Visitor< Trait >.

Definition at line 485 of file html.h.

◆ onList()

template<class Trait >
void MD::details::HtmlVisitor< Trait >::onList ( List< Trait > * l)
inlineoverrideprotectedvirtual

Handle list.

Parameters
lList.

Implements MD::Visitor< Trait >.

Definition at line 308 of file html.h.

◆ onListItem()

template<class Trait >
void MD::details::HtmlVisitor< Trait >::onListItem ( ListItem< Trait > * i,
bool first )
inlineoverrideprotectedvirtual

Handle list item.

Parameters
iList item.
firstIs this item first in the list?

Reimplemented from MD::Visitor< Trait >.

Definition at line 617 of file html.h.

◆ onMath()

template<class Trait >
void MD::details::HtmlVisitor< Trait >::onMath ( Math< Trait > * m)
inlineoverrideprotectedvirtual

Handle LaTeX math expression.

Parameters
mMath.

Implements MD::Visitor< Trait >.

Definition at line 179 of file html.h.

◆ onParagraph()

template<class Trait >
void MD::details::HtmlVisitor< Trait >::onParagraph ( Paragraph< Trait > * p,
bool wrap )
inlineoverrideprotectedvirtual

Handle paragraph.

Parameters
pParagraph.
wrapWrap this paragraph with something or no? It's useful to not wrap standalone paragraph in list item, for example.

Reimplemented from MD::Visitor< Trait >.

Definition at line 205 of file html.h.

◆ onRawHtml()

template<class Trait >
void MD::details::HtmlVisitor< Trait >::onRawHtml ( RawHtml< Trait > * h)
inlineoverrideprotectedvirtual

Handle raw HTML.

Parameters
hRaw HTML.

Implements MD::Visitor< Trait >.

Definition at line 461 of file html.h.

◆ onTable()

template<class Trait >
void MD::details::HtmlVisitor< Trait >::onTable ( Table< Trait > * t)
inlineoverrideprotectedvirtual

Handle table.

Parameters
tTable.

Implements MD::Visitor< Trait >.

Definition at line 367 of file html.h.

◆ onText()

template<class Trait >
void MD::details::HtmlVisitor< Trait >::onText ( Text< Trait > * t)
inlineoverrideprotectedvirtual

Handle text item.

Parameters
tText.

Implements MD::Visitor< Trait >.

Definition at line 165 of file html.h.

◆ openStyle()

template<class Trait >
virtual void MD::details::HtmlVisitor< Trait >::openStyle ( const typename ItemWithOpts< Trait >::Styles & styles)
inlineprotectedvirtual

Insert into HTML tags for opening styles.

Definition at line 112 of file html.h.

◆ toHtml()

template<class Trait >
virtual Trait::String MD::details::HtmlVisitor< Trait >::toHtml ( std::shared_ptr< Document< Trait > > doc,
const typename Trait::String & hrefForRefBackImage,
bool wrappedInArticle = true )
inlinevirtual

Walk through the document.

Definition at line 94 of file html.h.

Member Data Documentation

◆ m_dontIncrementFootnoteCount

template<class Trait >
bool MD::details::HtmlVisitor< Trait >::m_dontIncrementFootnoteCount = false
protected

Just process footnote references and don't increment count number.

Definition at line 743 of file html.h.

◆ m_fns

template<class Trait >
Trait::template Vector<FootnoteRefStuff> MD::details::HtmlVisitor< Trait >::m_fns
protected

Vector of processed footnotes references.

Definition at line 758 of file html.h.

◆ m_html

template<class Trait >
Trait::String MD::details::HtmlVisitor< Trait >::m_html
protected

HTML content.

Definition at line 739 of file html.h.

◆ m_isWrappedInArticle

template<class Trait >
bool MD::details::HtmlVisitor< Trait >::m_isWrappedInArticle = true
protected

Is this HTML wrapped in artcile tag?

Definition at line 745 of file html.h.

◆ m_justCollectFootnoteRefs

template<class Trait >
bool MD::details::HtmlVisitor< Trait >::m_justCollectFootnoteRefs = false
protected

Just collect footnote references?

Definition at line 741 of file html.h.


The documentation for this class was generated from the following file:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Wed Nov 6 2024 12:12:28 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.