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

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
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -2147,7 +2147,8 @@ Commands for displaying examples
 \addindex \\snippet
 \addindex \\snippet
 Where the \ref cmdinclude "\\include" command can be used to include
 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 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,
 For example, the putting the following command in the documentation,
 references a snippet in file \c example.cpp residing in a subdirectory 
 references a snippet in file \c example.cpp residing in a subdirectory 
+1 −0
Original line number Original line Diff line number Diff line
@@ -5217,6 +5217,7 @@ void DocPara::handleInclude(const QCString &cmdName,DocInclude::Type t)
  QCString blockId;
  QCString blockId;
  if (t==DocInclude::Snippet)
  if (t==DocInclude::Snippet)
  {
  {
    if (fileName == "this") fileName=g_fileName;
    doctokenizerYYsetStateSnippet();
    doctokenizerYYsetStateSnippet();
    tok=doctokenizerYYlex();
    tok=doctokenizerYYlex();
    doctokenizerYYsetStatePara();
    doctokenizerYYsetStatePara();