mirror of
https://git.pumpin.online/funkpower/catena.git
synced 2026-10-23 03:07:13 +00:00
docs: what citefind reads, and a citation graph built out of the books
The README now lists the forms it handles with an example of each, says that where the italics sit is what decides whether they are the title or the journal, and sets out what it refuses and why — scripture, Migne, a contributor's biography, a note that only thanks people, a page footer. Recipes gains "What a book leans on": one bibliography read, then the same over a shelf, counted per citing book so a work cited forty times in one bibliography still counts once. Every command was run — thirty converted books gave 14,481 references, 10,536 naming a work, in about a second. `records.md` now points at the five tools whose record shapes live in their own pages rather than in `corpus-core`. And pandoc escapes an underscore, so the rule of them that stands in for a repeated author arrives as `\_\_\_\_\_` and was not being recognised.
This commit is contained in:
@@ -322,8 +322,11 @@ static CITATION_SIGNAL: LazyLock<Regex> = LazyLock::new(|| {
|
||||
|
||||
/// A rule of dashes standing in for the author of the entry above, which is
|
||||
/// how every style avoids printing the same name forty times running.
|
||||
static REPEATED_AUTHOR: LazyLock<Regex> =
|
||||
LazyLock::new(|| Regex::new(r"^\s*(?:[—–]+|-{3,}|_{3,})").expect("a valid pattern"));
|
||||
static REPEATED_AUTHOR: LazyLock<Regex> = LazyLock::new(|| {
|
||||
// Pandoc escapes an underscore, so a rule of them arrives as
|
||||
// `\_\_\_\_\_` rather than `_____`.
|
||||
Regex::new(r"^\s*(?:[—–]+|-{3,}|(?:\\?_){3,})").expect("a valid pattern")
|
||||
});
|
||||
|
||||
/// Whether an entry defers to the one above it for its author.
|
||||
pub fn repeats_author(text: &str) -> bool {
|
||||
@@ -1688,6 +1691,16 @@ mod tests {
|
||||
assert!(several.continuation);
|
||||
assert_eq!(several.authors, ["Trentman", "Spade"]);
|
||||
|
||||
// Pandoc escapes an underscore, so a rule of them arrives escaped.
|
||||
let escaped = read(
|
||||
"\\_\\_\\_\\_\\_. *The Community of the Beloved Disciple*. New York: Paulist, 1979.",
|
||||
);
|
||||
assert_eq!(
|
||||
escaped.title.as_deref(),
|
||||
Some("The Community of the Beloved Disciple")
|
||||
);
|
||||
assert!(repeats_author(&escaped.text));
|
||||
|
||||
// One name, two years: `Spade 1975 and 1980.`
|
||||
let years = read("Spade 1975 and 1980.");
|
||||
assert!(years.continuation);
|
||||
|
||||
Reference in New Issue
Block a user