Commit e2691816 authored by Dimitri van Heesch's avatar Dimitri van Heesch

Merge pull request #210 from albert-github/feature/snippet_from_current_file

Create an easy possibility to take a snippet from the current file.
parents 70a1b6e5 f8ceac63
......@@ -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
......
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment