Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
doxverilog
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
doxverilog
Commits
6bb9ee4f
Commit
6bb9ee4f
authored
Oct 13, 2013
by
Dimitri van Heesch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow @ref to unlabeled markdown page by name, i.e. @ref mypage.md
parent
57f1a23a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
6 deletions
+23
-6
markdown.doc
doc/markdown.doc
+6
-0
docparser.cpp
src/docparser.cpp
+6
-0
markdown.cpp
src/markdown.cpp
+10
-6
markdown.h
src/markdown.h
+1
-0
No files found.
doc/markdown.doc
View file @
6bb9ee4f
...
...
@@ -445,6 +445,12 @@ when processed by doxygen:
Documentation that will appear on the main page
If a page has a label you can link to it using \ref cmdref "\@ref" as
is shown above. To refer to a markdown page without
such label you can simple use the file name of the page, e.g.
See [the other page](@ref other.md) for more info.
\subsection md_html_blocks Treatment of HTML blocks
Markdown is quite strict in the way it processes block-level HTML:
...
...
src/docparser.cpp
View file @
6bb9ee4f
...
...
@@ -52,6 +52,7 @@
#include "formula.h"
#include "config.h"
#include "growbuf.h"
#include "markdown.h"
// debug off
#define DBG(x) do {} while(0)
...
...
@@ -2417,8 +2418,13 @@ DocRef::DocRef(DocNode *parent,const QCString &target,const QCString &context) :
QCString
anchor
;
//printf("DocRef::DocRef(target=%s,context=%s)\n",target.data(),context.data());
ASSERT
(
!
target
.
isEmpty
());
SrcLangExt
lang
=
getLanguageFromFileName
(
target
);
m_relPath
=
g_relPath
;
SectionInfo
*
sec
=
Doxygen
::
sectionDict
->
find
(
target
);
if
(
sec
==
0
&&
lang
==
SrcLangExt_Markdown
)
// lookup as markdown file
{
sec
=
Doxygen
::
sectionDict
->
find
(
markdownFileNameToId
(
target
));
}
if
(
sec
)
// ref to section or anchor
{
PageDef
*
pd
=
0
;
...
...
src/markdown.cpp
View file @
6bb9ee4f
...
...
@@ -2249,6 +2249,15 @@ QCString processMarkdown(const QCString &fileName,Entry *e,const QCString &input
//---------------------------------------------------------------------------
QCString
markdownFileNameToId
(
const
QCString
&
fileName
)
{
QCString
baseFn
=
stripFromPath
(
QFileInfo
(
fileName
).
absFilePath
().
utf8
());
int
i
=
baseFn
.
findRev
(
'.'
);
if
(
i
!=-
1
)
baseFn
=
baseFn
.
left
(
i
);
QCString
baseName
=
substitute
(
substitute
(
baseFn
,
" "
,
"_"
),
"/"
,
"_"
);
return
"md_"
+
baseName
;
}
void
MarkdownFileParser
::
parseInput
(
const
char
*
fileName
,
const
char
*
fileBuf
,
Entry
*
root
,
...
...
@@ -2270,15 +2279,10 @@ void MarkdownFileParser::parseInput(const char *fileName,
QCString
docs
=
output
.
data
();
QCString
id
;
QCString
title
=
extractPageTitle
(
docs
,
id
).
stripWhiteSpace
();
//g_correctSectionLevel = !title.isEmpty();
QCString
baseFn
=
stripFromPath
(
QFileInfo
(
fileName
).
absFilePath
().
utf8
());
int
i
=
baseFn
.
findRev
(
'.'
);
if
(
i
!=-
1
)
baseFn
=
baseFn
.
left
(
i
);
QCString
titleFn
=
QFileInfo
(
fileName
).
baseName
().
utf8
();
QCString
fn
=
QFileInfo
(
fileName
).
fileName
().
utf8
();
QCString
baseName
=
substitute
(
substitute
(
baseFn
,
" "
,
"_"
),
"/"
,
"_"
);
static
QCString
mdfileAsMainPage
=
Config_getString
(
"USE_MDFILE_AS_MAINPAGE"
);
if
(
id
.
isEmpty
())
id
=
"md_"
+
baseName
;
if
(
id
.
isEmpty
())
id
=
markdownFileNameToId
(
fileName
);
if
(
title
.
isEmpty
())
title
=
titleFn
;
if
(
fn
==
mdfileAsMainPage
)
{
...
...
src/markdown.h
View file @
6bb9ee4f
...
...
@@ -23,6 +23,7 @@ class Entry;
/** processes string \a s and converts markdown into doxygen/html commands. */
QCString
processMarkdown
(
const
QCString
&
fileName
,
Entry
*
e
,
const
QCString
&
s
);
QCString
markdownFileNameToId
(
const
QCString
&
fileName
);
class
MarkdownFileParser
:
public
ParserInterface
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment