Doxygen
Toggle main menu visibility
Loading...
Searching...
No Matches
markdown.h
Go to the documentation of this file.
1
/******************************************************************************
2
*
3
* Copyright (C) 1997-2015 by Dimitri van Heesch.
4
*
5
* Permission to use, copy, modify, and distribute this software and its
6
* documentation under the terms of the GNU General Public License is hereby
7
* granted. No representations are made about the suitability of this software
8
* for any purpose. It is provided "as is" without express or implied warranty.
9
* See the GNU General Public License for more details.
10
*
11
* Documents produced by Doxygen are derivative works derived from the
12
* input used in their production; they are not affected by this license.
13
*
14
*/
15
16
#ifndef MARKDOWN_H
17
#define MARKDOWN_H
18
19
#include <memory>
20
#include <array>
21
22
#include "
parserintf.h
"
23
24
class
DString
;
25
class
Entry
;
26
27
/** processes string \a s and converts markdown into doxygen/html commands. */
28
//DString processMarkdown(const DString &fileName,const int lineNr,Entry *e,const DString &s);
29
DString
markdownFileNameToId
(
const
DString
&
fileName
);
30
31
/// Helper class to process markdown formatted text
32
class
Markdown
33
{
34
public
:
35
Markdown
(
const
DString
&fileName,
int
lineNr,
int
indentLevel=0);
36
~Markdown
();
37
NON_COPYABLE
(
Markdown
)
38
DString
process
(
const
DString
&input,
int
&startNewlines,
bool
fromParseInput =
false
);
39
DString
extractPageTitle
(
DString
&docs,
DString
&
id
,
int
&prepend,
bool
&isIdGenerated);
40
void
setIndentLevel
(
int
level);
41
42
private
:
43
struct
Private
;
44
std::unique_ptr<Private>
prv
;
45
using
Action_t
= std::function<int(
Private
&,std::string_view,
size_t
)>;
46
using
ActionTable_t
= std::array<Action_t,256>;
47
static
ActionTable_t
fill_table
();
48
static
ActionTable_t
actions
;
49
};
50
51
class
MarkdownOutlineParser
final :
public
OutlineParserInterface
52
{
53
public
:
54
MarkdownOutlineParser
();
55
~MarkdownOutlineParser
()
override
;
56
NON_COPYABLE
(
MarkdownOutlineParser
)
57
void
parseInput
(
const
DString
&fileName,
58
const
char
*fileBuf,
59
const
std::shared_ptr<Entry> &root,
60
ClangTUParser
*clangParser)
override
;
61
bool
needsPreprocessing
(
const
DString
&)
const override
{
return
false
; }
62
void
parsePrototype
(
const
DString
&text)
override
;
63
private
:
64
struct
Private;
65
std::unique_ptr<Private>
p
;
66
};
67
68
69
#endif
ClangTUParser
Clang parser object for a single translation unit, which consists of a source file and the directly o...
Definition
clangparser.h:25
DString
A String class for use with Doxygen wrapping std::string and adding some additional functionality off...
Definition
dstring.h:84
Entry
Represents an unstructured piece of information, about an entity found in the sources.
Definition
entry.h:115
Entry::fileName
DString fileName
file this entry was extracted from
Definition
entry.h:223
Markdown::process
DString process(const DString &input, int &startNewlines, bool fromParseInput=false)
Definition
markdown.cpp:3749
Markdown::fill_table
static ActionTable_t fill_table()
Definition
markdown.cpp:189
Markdown::~Markdown
~Markdown()
Markdown::ActionTable_t
std::array< Action_t, 256 > ActionTable_t
Definition
markdown.h:46
Markdown::prv
std::unique_ptr< Private > prv
Definition
markdown.h:44
Markdown::extractPageTitle
DString extractPageTitle(DString &docs, DString &id, int &prepend, bool &isIdGenerated)
Definition
markdown.cpp:3696
Markdown::actions
static ActionTable_t actions
Definition
markdown.h:48
Markdown::setIndentLevel
void setIndentLevel(int level)
Definition
markdown.cpp:217
Markdown::Action_t
std::function< int(Private &, std::string_view, size_t)> Action_t
Definition
markdown.h:45
Markdown::Markdown
Markdown(const DString &fileName, int lineNr, int indentLevel=0)
Definition
markdown.cpp:208
MarkdownOutlineParser::needsPreprocessing
bool needsPreprocessing(const DString &) const override
Returns true if the language identified by extension needs the C preprocessor to be run before feed t...
Definition
markdown.h:61
MarkdownOutlineParser::~MarkdownOutlineParser
~MarkdownOutlineParser() override
Definition
markdown.cpp:3824
MarkdownOutlineParser::MarkdownOutlineParser
MarkdownOutlineParser()
Definition
markdown.cpp:3820
MarkdownOutlineParser::parsePrototype
void parsePrototype(const DString &text) override
Callback function called by the comment block scanner.
Definition
markdown.cpp:3976
MarkdownOutlineParser::p
std::unique_ptr< Private > p
Definition
markdown.h:65
OutlineParserInterface
Abstract interface for outline parsers.
Definition
parserintf.h:41
NON_COPYABLE
#define NON_COPYABLE(cls)
Macro to help implementing the rule of 5 for a non-copyable & movable class.
Definition
construct.h:37
parseInput
void parseInput()
Definition
doxygen.cpp:12521
markdownFileNameToId
DString markdownFileNameToId(const DString &fileName)
processes string s and converts markdown into doxygen/html commands.
Definition
markdown.cpp:3800
parserintf.h
Markdown::Private
Definition
markdown.cpp:138
src
markdown.h
Generated by
1.19.0