pub(crate) const CH01: &str = "# Chapter 1. Arrival
The train was late.

## The station
It was empty[^n1].
[^n1]: Almost.
";
pub(crate) const CH02: &str = "# Chapter 2. The letter
See [the station](ch01.md#the-station), or <https://example.org>.
";
#[cfg(feature = "write")]
pub(crate) const CH01_NAMED: &str = "# Chapter 1. Arrival
The train was late.
[fig-1]: #fig-1

## The station
[remark]: #remark
It was empty[^n1].
[^n1]: Almost.
";
#[cfg(all(feature = "read", feature = "write"))]
pub(crate) fn named_offset(name: &str) -> u32 {
CH01_NAMED
.find(&format!("[{name}]: #"))
.and_then(|offset| u32::try_from(offset).ok())
.unwrap_or(0)
}
#[cfg(feature = "write")]
pub(crate) const CH03: &str = "# Chapter 3. The picture
See [the figure](ch01.md#fig-1) and [the remark](ch01.md#remark).
";
#[cfg(feature = "read")]
pub(crate) fn offset_in_ch01(line: &str) -> u32 {
CH01.find(line)
.and_then(|offset| u32::try_from(offset).ok())
.unwrap_or(0)
}
pub(crate) const DIAGRAM: &str = "flowchart LR
station[The station] --> letter[The letter]
";
pub(crate) const FORMULA: &str = "v = \\frac{s}{t}";
#[cfg(feature = "write")]
pub(crate) const CH04: &str = "# Chapter 4. The way

The train kept  all the way.
";
pub(crate) const ID: &str = "urn:uuid:3f1c2a7e-8a54-4d0b-9c1e-6b2f0d9a7e11";
pub(crate) const PLAIN: &[u8] = include_bytes!("../fixtures/plain.avif");
pub(crate) const ROTATED: &[u8] = include_bytes!("../fixtures/rotated.avif");
#[cfg(all(feature = "read", feature = "write"))]
pub(crate) const CROPPED: &[u8] = include_bytes!("../fixtures/cropped.avif");
#[cfg(all(feature = "read", feature = "write"))]
pub(crate) const MIRRORED: &[u8] = include_bytes!("../fixtures/mirrored.avif");
#[cfg(feature = "read")]
pub(crate) fn station_offset() -> u32 {
offset_in_ch01("## The station")
}
#[cfg(feature = "read")]
pub(crate) fn figure_offset() -> u32 {
offset_in_ch01("![The station")
}