Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,16 @@ CHECK_ALL_BOOKS_FOR_LANGUAGE=true
# When true the system will acquire git repos via download of its
# master.zip file. When false it will clone the repo. Both approaches
# are optimized maximally by taking advantage of curl and git options.
# In practice, not all resources are available by download whereas
# they all are available by cloning, hence the value false.
DOWNLOAD_ASSETS=false

# Setting to false will cause interleave by verse layout to put each
# TW word associated with the verse in a horizontal comma delimited
# list, otherwise it will put each TW word in a list with one word per
# line.
TW_WORD_LIST_VERTICAL=false

# * http://localhost:3000 covers requests originating from the case
# where 'npm run dev' is invoked to run vite (to run svelte js frontend)
# outside Docker. This results in vite's development mode which runs on
Expand Down
44 changes: 41 additions & 3 deletions backend/doc/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import logging
from logging import config as lc
from typing import Sequence, final
from typing import Mapping, Sequence, final

import yaml
from pydantic import EmailStr, HttpUrl
Expand Down Expand Up @@ -35,17 +35,55 @@ class Settings(BaseSettings):
"usfm",
]

# This can be expanded to include any additional types (if
# there are any) that we want to be available to users. These are all
# that I found of relevance in the data API.
RESOURCE_TYPE_CODES_AND_NAMES: Mapping[str, str] = {
"ayt": "Bahasa Indonesian Bible",
"bc": "Bible Commentary",
"blv": "Portuguese Bíblia Livre",
"cuv": "新标点和合本",
"f10": "French Louis Segond 1910 Bible",
"nav": "New Arabic Version (Ketab El Hayat)",
"reg": "Regular",
"rg": "NT Survey Reviewers' Guide",
"tn": "Translation Notes",
"tn-condensed": "Condensed Translation Notes",
"tq": "Translation Questions",
"tw": "Translation Words",
# "udb": "Unlocked Dynamic Bible", # Content team doesn't want udb used TODO (just for English or ?)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe English is the only language that has a UDB resource.

"ugnt": "unfoldingWord® Greek New Testament",
"uhb": "unfoldingWord® Hebrew Bible",
"ulb": "Unlocked Literal Bible",
}

SHOW_TN_BOOK_INTRO: bool = True
# SHOW_BC_BOOK_INTRO: bool = True
# SHOW_TN_CHAPTER_INTRO: bool = True
# SHOW_TN_BOOK_INTRO_IN_VERSIFIED_CONTEXT: bool = True
# SHOW_BC_BOOK_INTRO_IN_VERSIFIED_CONTEXT: bool = True
# SHOW_TN_CHAPTER_INTRO_IN_VERSIFIED_CONTEXT: bool = True
# SHOW_BC_CHAPTER_COMMENTARY_IN_VERSIFIED_CONTEXT: bool = True
# SHOW_RG_CHAPTER_COMMENTARY_IN_VERSIFIED_CONTEXT: bool = True

CHECK_USFM: bool
USE_LOCALIZED_BOOK_NAME: bool
CHECK_ALL_BOOKS_FOR_LANGUAGE: bool

BOOK_NAME_FMT_STR: str = "<h2 class='book-name' style='text-align: center;'>{}</h2>"
TRANSLATION_WORD_VERSE_SECTION_HEADER_STR: str = "<h4>Uses:</h4>"
TRANSLATION_WORD_VERSE_REF_ITEM_FMT_STR: str = (
'<li><a href="#{}-{}-ch-{}-v-{}">{} {}:{}</a></li>'
)
UNORDERED_LIST_BEGIN_STR: str = "<ul>"
UNORDERED_LIST_END_STR: str = "</ul>"
VERSE_SPAN_FMT_STR: str = '<span class="verse">{}</span>'
BOOK_NAME_FMT_STR: str = "<h2 class='book-name'>{}</h2>"
LEFT_ALIGNED_HEADER_FMT_STR: str = "<h3 class='book-name'>{}</h3>"
END_OF_CHAPTER_HTML: str = '<div class="end-of-chapter"></div>'
HR: str = "<hr/>"
TW_WORD_LIST_VERTICAL: bool = True

DOWNLOAD_ASSETS: bool # If true then download assets, else clone assets
DOWNLOAD_ASSETS: bool = False # If true then download assets, else clone assets

def logger(self, name: str) -> logging.Logger:
"""
Expand Down
Loading