Sleppa svæðum með forskriftum

Yfirlit

Stundum þarftu að koma í veg fyrir að snapper endursníði tiltekin svæði: handsnið ljóð, jafnaðan texta, vandlega uppsettar töflur í texta eða hvaða texta sem er þar sem linuskipti bera merkingu.

Use snapper:off and snapper:on pragmas to mark regions that should pass through unchanged. LaTeX chapter files included with \input can add % snapper:no-preamble so snapper treats the file as body instead of waiting for \begin{document}.

Málskipan eftir sniði

Org-mode

Some prose that gets reformatted normally.

# snapper:off
This text will not
be reformatted. Line breaks
are preserved exactly.
# snapper:on

More prose that gets reformatted.

LaTeX

Some prose that gets reformatted normally.

% snapper:off
This text will not
be reformatted.
% snapper:on

More prose that gets reformatted.

A \input chapter with no \begin{document} is body by default. Use % snapper:no-preamble when the file also has \documentclass or you want the flag written down:

% snapper:no-preamble
This sentence is a test. This sentence is also a test.

Markdown

Some prose that gets reformatted normally.

<!-- snapper:off -->
This text will not
be reformatted.
<!-- snapper:on -->

More prose that gets reformatted.

reStructuredText

A bare line (the same payload as plaintext). A .. comment is not stripped, so .. snapper:off is not a pragma.

Some prose that gets reformatted normally.

snapper:off
This text will not
be reformatted.
snapper:on

More prose that gets reformatted.

Hreinn texti

Some prose that gets reformatted normally.

snapper:off
This text will not
be reformatted.
snapper:on

More prose that gets reformatted.

Notkunardæmi

  • Ljóð eða vísuorð með ásetningarlegum linuskiptum

  • ASCII-list eða skýringarmyndir í athugasemdum

  • Vandlega jafnaðir tilvísanalistar

  • Leyfishausa með sérstakri sniðmótun

  • Texti sem á að samsvara ytri heimild nákvæmlega

Hreiðrun

Forskriftir hreiðrast ekki. snapper:off slekkur á sniðmótun þar til næsta snapper:on. Ef skráin endar án snapper:on fer afgangur skráarinnar í gegn óbreyttur.

Samspil við aðra eiginleika

Forskriftir hafa forgang umfram alla aðra þáttun. Innan slökkt-svæðis fer engin setningaskipting, engin sniðmeðvituð þáttun og engin meðhöndlun skammstafana fram. Forskriftaathugasemdarlínurnar sjálfar fara alltaf í gegn sem bygging.

The pandoc path keeps snapper:off / snapper:on in the written output (the reader would otherwise delete them). Off-region text is shielded so it is not reflowed. Pass --native to force today’s line parsers.