Najczęściej zadawane pytania¶
Dlaczego nie zawijać po prostu przy 80 kolumnach?¶
Zawijanie kolumnowe powoduje przepływ całego akapitu przy zmianie jednego słowa. Recenzenci widzą cały akapit w diff-ie, co zasłania rzeczywistą zmianę. Formatowanie jedno-zdanie-na-linię sprawia, że zmiana jednego słowa daje jednolinijkowy diff.
Czy wpływa to na wygląd wyrenderowanego dokumentu?¶
No. LaTeX, Org-mode, Markdown, RST, and most prose formats treat single newlines as whitespace. Two consecutive newlines start a new paragraph. Snapper preserves paragraph breaks (blank lines) and only changes where single newlines occur within a paragraph.
Moi współpracownicy nie używają snappera.¶
Czy to spowoduje problemy?
:CUSTOMID: collaborators
Nie. Formatowanie wpływa tylko na białe znaki wewnątrz akapitów. Współpracownicy mogą edytować normalnie, a ich zmiany będą się łączyć bez konfliktów. Dla w pełni przezroczystej integracji użyj filtra git smudge/clean (zobacz przewodnik).
Why does snapper handle „Dr. Smith” correctly?¶
Snapper maintains curated abbreviation lists for English (80+), German, French, Icelandic, and Polish.
After Unicode sentence boundary detection, it merges any splits that occurred at known abbreviation periods.
Select a language with --lang de (or set lang = "de" in .snapperrc.toml).
You can also add project-specific abbreviations via extra_abbreviations in the config file.
Co z tekstem w językach innych niż angielski?¶
Snapper supports non-English text in two ways:
Rule-based abbreviation sets for German (
de), French (fr), Icelandic (is), and Polish (pl).
Select with --lang de.
The Unicode UAX #29 sentence boundary algorithm works across all languages.
Neural sentence detection via nnsplit for 9 languages (en, de, fr, no, sv, zh, tr, ru, uk).
Enable with --neural --lang de.
Models download on first use (~4MB, cached).
The rule-based approach handles most academic text well and runs about 40x faster than neural (~5ms vs ~200ms per file; see the neural-detection howto). Use neural for languages where abbreviation rules fall short (Chinese, Turkish, etc.).
Why does snapper conflict with openSUSE?¶
openSUSE snapper is a different project (Btrfs/LVM volume snapshots) that also installs a snapper binary.
This formatter’s crate name is snapper-fmt; installers ship both snapper and snapper-fmt as names for the same program.
On systems where openSUSE already owns /usr/bin/snapper, invoke snapper-fmt (or put the TurtleTech install directory first on PATH).
Czy mogę używać snappera jako biblioteki?¶
Tak. Crate (snapper-fmt) udostępnia format_text() i wszystkie wewnętrzne moduły:
use snapper_fmt::{format_text, FormatConfig};
use snapper_fmt::format::Format;
let config = FormatConfig {
format: Format::Org,
..Default::default()
};
let output = format_text(input, &config).unwrap();
Jak szybki jest snapper?¶
Snapper processes typical academic papers (10-50 pages) in under 10ms with the rule-based splitter. Neural mode adds ~200ms per file (model load + inference via tract, pure Rust ONNX). No external runtime dependencies.
Co ze znakami końca linii CRLF?¶
Snapper wykrywa konwencję znaków końca linii wejścia (LF lub CRLF) i zachowuje ją na wyjściu. Wewnętrznie przetwarzanie normalizuje do LF i konwertuje z powrotem przed zapisem.
Can I skip formatting for specific sections?¶
Yes.
Use snapper:off and snapper:on pragmas in comments:
Org:
# snapper:off/# snapper:onLaTeX:
% snapper:off/% snapper:on;% snapper:no-preambleon\inputchaptersMarkdown:
<!-- snapper:off -->/<!-- snapper:on -->RST/Plaintext:
snapper:off/snapper:onon their own line
Text between these markers passes through unchanged. Useful for poetry, aligned text, or ASCII art.
What formats does snapper support?¶
Org-mode, LaTeX, Markdown, reStructuredText, and plaintext.
Format auto-detects from the file extension (.org, .tex, .md, .rst, .txt).
Unknown extensions (.rs, .py, no extension) are refused so source files are not treated as prose.
Override with --format rst (or org, latex, markdown, plaintext).
How do I compare versions at the sentence level?¶
Use snapper sdiff to diff two files at sentence granularity:
snapper sdiff paper_v1.org paper_v2.org
Or diff against a git ref:
snapper git-diff HEAD~1 paper.org
Whitespace reflow produces zero diff. Only actual content changes appear.
Jak zgłosić błąd lub poprosić o nową funkcję?¶
Zgłoś problem na github.com/TurtleTech-ehf/snapper/issues.