Giter Club home page Giter Club logo

gobible's People

Contributors

applehat avatar

Stargazers

 avatar  avatar

Watchers

 avatar

gobible's Issues

Refactor Book Handling

Currently, there is some logic (specifically around book name normalization) that relies on the "book number".

This is perfectly fine for the Protestant Canon, but I imagine would make it error prone if trying to use Anglican, Catholic, or Orthodox sources.

While I as a protestant have my own opinions about biblical canon, I still believe these groups on a whole are Christians and I'd like the library and overall format to better handle deuterocanonical stuff.

Footnotes, Formatting, and References

Currently the data structure for footnotes and formatting look like this:

type Verse struct {
	Number     int          `json:"number"`
	Text       string       `json:"text"`
	Footnotes  []Footnote   `json:"footnotes,omitempty"`  // optional
	Formatting []Formatting `json:"formatting,omitempty"` // optional
}

type Footnote struct {
	Marker string `json:"number"`
	Text   string `json:"text"`
	Start  int    `json:"start"`
	End    int    `json:"end"`
}

type FormattingType string

// define valid FormattingType values
const (
	FormatBold      FormattingType = "bold"
	FormatItalic    FormattingType = "italic"
	FormatUnderline FormattingType = "underline"
	FormatRedLetter FormattingType = "red-letter"
	FormatSmallCaps FormattingType = "small-caps"
)

type Formatting struct {
	Type  FormattingType `json:"type"`
	Start int            `json:"start"`
	End   int            `json:"end"`
}

For the sake of this, lets assume we are trying to store Romans 1:17 from the Legacy Standard Bible


Screenshot from https://www.biblegateway.com/passage/?search=Romans+1%3A17&version=LSB
image


In the current structure, the JSON would look something like this:

{
  "number": 17,
  "text": "For in it the righteousness of God is revealed from faith to faith; as it is written, \"But the righteous will live by faith.\"",
  "footnotes": [
     { 
       "marker": "a",
       "text": "Or _by_",
       "start": 31,
       "end": 35
       },
      { 
       "marker": "b",
       "text": "Or _But he who is righteous by faith shall live_",
       "start": 70,
       "end": 106
       }
  ],
  "formatting": [
    { 
       "type": "italic"
       "start": 10,
       "end": 13
       },
      { 
       "type": "small-caps",
       "start": 70,
       "end": 106
       }
      
  ]
}

I think my first suggested change would be to add a type to markers, (literal, alternative, commentary and maybe other) to denote the type of footnote it is, and then add another section for cross-references.


I am also open to alternative theories on how to denote which text in the string needs formatting or references applied to it. Currently start and end is the char count start and end inside the string.

Assuming we stick with the current method of denoting where the formats exist, I would not be against a few methods on the Verse struct that could help render out in HTML and Markdown the footnoting and formatting as much as is possible.

Obviously red-letters and small-caps are not a native markdown feature, so Im not sure how we handle that (but honestly whatever app consumes the text can choose to use our methods or not)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.