Skip to content

Latest commit

 

History

History
63 lines (48 loc) · 2.58 KB

File metadata and controls

63 lines (48 loc) · 2.58 KB

GoDoc Build Status Go Report Card codecov

romanus

Golang library containing the entire Roman Catechism of the Council of Trent.

Documentation here: https://godoc.org/github.com/mborders/romanus

Structure

Each Part of the Catechism has its own Introduction plus a list of Articles. Each Article has a navigable short Title (e.g. "Baptism", "The First Commandment", "I Believe in God, the Father Almighty, Creator of Heaven and Earth") and a Heading preserving the formal all-caps heading from the original text (which includes the quoted commandment / petition scripture for Parts 3 and 4). Articles contain Sections, which contain Paragraphs.

Example Usage

// Create a new catechism instance
c := romanus.NewCatechism()

// Get Part 1
part, err := c.GetPart(1)

// Get the introduction for Part 1 (separate from its articles)
intro, err := c.GetIntroduction(1)
s, err := c.GetIntroductionSection(1, 1)
p, err := c.GetIntroductionParagraph(1, 1, 1)

// Get Part 1, Article 1 — the First Article of the Creed
a, err := c.GetArticle(1, 1)
fmt.Print(a.Title)   // "I Believe in God, the Father Almighty, Creator of Heaven and Earth"
fmt.Print(a.Heading) // "ARTICLE I : \"I BELIEVE IN GOD, THE FATHER ALMIGHTY, CREATOR OF HEAVEN AND EARTH\""

// Get Part 1, Article 1, Section 1
s, err = c.GetSection(1, 1, 1)

// Get Part 1, Article 1, Section 1, Paragraph 1
p, err = c.GetParagraph(1, 1, 1, 1)
fmt.Print(p.Text)

// Search for paragraphs
r := c.Search("I believe", 10)
fmt.Print(r[0].Part.PartNumber)
fmt.Print(r[0].Article.ArticleNumber) // nil when the hit is inside an Introduction
fmt.Print(r[0].Section.SectionNumber)
fmt.Print(r[0].Paragraph.ParagraphNumber)
fmt.Print(r[0].Paragraph.Text)
fmt.Print(r[0].String()) // "Part 4, Article 2, Section 3, Paragraph 1"

Rebuilding the source data

catechism.tar.gz is the packaged source data, normalized so each Part exposes a separate Introduction and Article numbering reflects how a reader would navigate the Roman Catechism (Article 1 of Part 1 = the First Article of the Creed, not a preface). To regenerate the tarball after a future data change, run python3 scripts/rebuild_data.py.