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)
 
virtual Trait::String headingIdToHtml (Heading< Trait > *h)
 
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)
 
virtual Trait::String prepareTextForHtml (const typename Trait::String &t)
 
virtual Trait::String tableAlignmentToHtml (typename Table< Trait >::Alignment a)
 
- 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 30 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 78 of file html.h.

◆ headingIdToHtml()

template<class Trait >
virtual Trait::String MD::details::HtmlVisitor< Trait >::headingIdToHtml ( Heading< Trait > * h)
inlineprotectedvirtual
Returns
HTML content for heading's ID.

Definition at line 681 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 101 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 392 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 235 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 195 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 501 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 621 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 167 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 596 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 418 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 483 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 217 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 138 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 428 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 251 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 560 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 122 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 148 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 404 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 310 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 108 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 55 of file html.h.

◆ prepareTextForHtml()

template<class Trait >
virtual Trait::String MD::details::HtmlVisitor< Trait >::prepareTextForHtml ( const typename Trait::String & t)
inlineprotectedvirtual

Prepare text to insert into HTML content.

Definition at line 699 of file html.h.

◆ tableAlignmentToHtml()

template<class Trait >
virtual Trait::String MD::details::HtmlVisitor< Trait >::tableAlignmentToHtml ( typename Table< Trait >::Alignment a)
inlineprotectedvirtual
Returns
HTML content for table alignment.

Definition at line 710 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 37 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 740 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 755 of file html.h.

◆ m_html

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

HTML content.

Definition at line 736 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 742 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 738 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 Sat Dec 21 2024 17:04:36 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.