Code Snippets

Code sections allow example code etc to be placed unprocessed within the documentation.

There should not be a line below this text.

There should be a line below this text.

                  ----------------------------
Summary
Code SnippetsCode sections allow example code etc to be placed unprocessed within the documentation.
Marked regionsStart section using regions marked within ([start] code) ..
Line prefixesCode sections using line prefixes (>), (|) or (:) as the first non whitespace character shall be treated in the same fashion as (code)/(end) code snippets, examples.
Quote regionsSimilar to nature code sections are quote regions in that they retain there line breaks, yet have an alternative stype applied.

Marked regions

First form

Start section using regions marked within ([start] code) ..  (end [code]).

  • example
Code snippet one ... (start code)/(end)
  • source
(start code)

       Code snippet one ... (start code)/(end)

(end)

Second form

  • example
Code snippet two ... (code)/(end)
  • source
(code)

       Code snippet two ... (code)/(end)

(end)

Third form

  • example
Code snippet three ... (code)/(end code)
  • source
(code)

       Code snippet three ... (code)/(end)

(end code)

Line prefixes

Code sections using line prefixes (>), (|) or (:) as the first non whitespace character shall be treated in the same fashion as (code)/(end) code snippets, examples.

First form

  • example
Code snippet four ...
  • source
>       Code snippet four ...

Secord form

  • example
Code snippet five ...
  • source
|       Code snippet five ...

Third form

  • example
Code snippet six ...
  • source
:       Code snippet six ...

Quote regions

Similar to nature code sections are quote regions in that they retain there line breaks, yet have an alternative stype applied.

There primary use is within Admonitions, allowing example text not to be formatted.

(quote)
       This should be two lines ...
               and the second
(end)
        This should be two *lines* ...
and the second

To send feedback on this topic email: natural.nosp@m.docsplus@gmai.nosp@m.l.com

© Some Rights Reserved. see License

Admonition’s allow hilited reminders and notes.
ND+ is licensed under the GPL-2.0, the same terms and conditions as Natural Docs 1.4.