Skip to content

Snippets - Source code

::: doxy.<project>.code

This tag generates a code snippet from a file.

Parameter Description Required
file The name of the file. Yes
start The line number where the snippet starts. No
end The line number where the snippet ends. No
::: doxy.animal.code
file: bird.h
start: 4
end: 20

bird.h

 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
#include "animal.h"

namespace example {
    class Bird: public Animal {
    public:
        Bird(const std::string& name, Bird* mother = nullptr, Bird* father = nullptr);
        Bird(const Bird& other) = delete;
        Bird(Bird&& Bird) noexcept;
        ~Bird() = default;

        void swap(Bird& other) noexcept;

        void move() override;
        void make_sound() override;
        Bird& operator = (const Bird& other) = delete;
        Bird& operator = (Bird&& other) noexcept;

::: doxy.<project>.code error message

::: doxy.animal.code
    file: cat.h

MkDoxy Error: Did not find File: cat.h

Check your file name

Available files in animal project:
animal.h
animal\_interface.h
bird.h
chinchilla.h
config.h
main.cpp
exception.h
example.h
special\_bird.h
Snippet
::: doxy.animal.code
    file: cat.h
    indent_level: 4