diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2014-08-26 18:47:31 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2014-08-26 18:47:31 (GMT) |
commit | e269181624fce15fb669e4b146a0d2156926a29c (patch) | |
tree | a5b03c450fa264c61ef105c417679cfbb03e7613 | |
parent | 70a1b6e5339eb4f6d65c09d58bcfb464f8f96bd2 (diff) | |
parent | f8ceac63bdb52cf395207258c98ff0bcba35870a (diff) | |
download | Doxygen-e269181624fce15fb669e4b146a0d2156926a29c.zip Doxygen-e269181624fce15fb669e4b146a0d2156926a29c.tar.gz Doxygen-e269181624fce15fb669e4b146a0d2156926a29c.tar.bz2 |
Merge pull request #210 from albert-github/feature/snippet_from_current_file
Create an easy possibility to take a snippet from the current file.
-rw-r--r-- | doc/commands.doc | 3 | ||||
-rw-r--r-- | src/docparser.cpp | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/doc/commands.doc b/doc/commands.doc index 73eb842..1b3f2bd 100644 --- a/doc/commands.doc +++ b/doc/commands.doc @@ -2147,7 +2147,8 @@ Commands for displaying examples \addindex \\snippet Where the \ref cmdinclude "\\include" command can be used to include a complete file as source code, this command can be used to quote only - a fragment of a source file. + a fragment of a source file. In case `this` is used as <file-name> the + current file is taken as file to take the snippet from. For example, the putting the following command in the documentation, references a snippet in file \c example.cpp residing in a subdirectory diff --git a/src/docparser.cpp b/src/docparser.cpp index 8be11c6..3110779 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -5217,6 +5217,7 @@ void DocPara::handleInclude(const QCString &cmdName,DocInclude::Type t) QCString blockId; if (t==DocInclude::Snippet) { + if (fileName == "this") fileName=g_fileName; doctokenizerYYsetStateSnippet(); tok=doctokenizerYYlex(); doctokenizerYYsetStatePara(); |