Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
734580d
Make it possible to specify languages that prefer non-ulb source text
linearcombination Jun 18, 2026
ba96682
Improve splitting of chapters into verses
linearcombination Jun 18, 2026
1c58479
Remove reviewer's guide resource from consideration in DOC
linearcombination Jun 18, 2026
128bf04
Two variables renamed for consistency
linearcombination Jun 18, 2026
5deea9e
Move function from DOC to STET
linearcombination Jun 18, 2026
966efb1
Add new STET input docs
linearcombination Jun 18, 2026
e5f9e6a
Add makefile rule to start Docker when needed
linearcombination Jun 19, 2026
47cff1a
Style hyperlinks per PO request
linearcombination Jun 19, 2026
06c3b95
Style hyperlinks and h1's in PDF output to more closely match Docx
linearcombination Jun 19, 2026
2a865b9
Make sure docker is started before running tests
linearcombination Jun 22, 2026
e34d888
Remove duplicates
linearcombination Jun 29, 2026
24eb12b
Fix test names
linearcombination Jun 29, 2026
398047a
Fix startdocker Makefile rule to be multiplatform
linearcombination Jun 29, 2026
f19d08f
Fix makefile format issue on rule
linearcombination Jun 29, 2026
e9208e6
Skip some problematic tests that are not vital
linearcombination Jun 30, 2026
9f59360
Change accidental use of module scoped "global"
linearcombination Jun 30, 2026
0d0020b
Simplify logic for splitting of chapter into verses
linearcombination Jun 30, 2026
cafe8ce
Merge pull request #319 from linearcombination/various-updates-stet-p…
PurpleGuitar Jun 30, 2026
e7790e8
Refactor usfm fixer module
linearcombination Jun 30, 2026
d3aff8f
Fix overzealous AI refactor drift
linearcombination Jul 2, 2026
21f7cfa
Merge pull request #320 from linearcombination/improve-usfm-fix-modul…
linearcombination Jul 2, 2026
35067ea
Provide option to link to TW word definitions online. Closes #321
linearcombination Jul 2, 2026
2101297
Fix issue with regression when LINK_RATHER_THAN_INCLUDE_TW_DEFINITION…
linearcombination Jul 10, 2026
1ee21f4
Remove unused configuration constant
linearcombination Jul 10, 2026
019562a
Add italic to STET occurrence reference counting
linearcombination Jul 10, 2026
7aec71f
Merge pull request #322 from linearcombination/link-tw-defs-online-op…
PurpleGuitar Jul 10, 2026
31d6523
Merge pull request #323 from linearcombination/stet-occurrence-instan…
PurpleGuitar Jul 10, 2026
392e2df
Filter out (See: ...) forms in TW, TN, and (in the future maybe, TA)
linearcombination Jul 10, 2026
8f878e9
Handle localized regex forms of '(See: ...)'
linearcombination Jul 10, 2026
db9c525
Fix regex overreach and add unit test
linearcombination Jul 14, 2026
265b608
Fix test
linearcombination Jul 18, 2026
4b880b3
Merge pull request #324 from linearcombination/filter-out-parenthesiz…
linearcombination Jul 20, 2026
af9009b
Add feature: configurable book name treatment
linearcombination Jul 14, 2026
aab8219
Update makefile rule to start docker first
linearcombination Jul 15, 2026
616bc0b
Update makefile comment
linearcombination Jul 15, 2026
6742a70
Merge pull request #325 from linearcombination/book_name_lookup_prefs
PurpleGuitar Jul 21, 2026
ce3d803
Update STET input docs and string table
linearcombination Jul 20, 2026
d563172
Turn off epub and pdf in UI
linearcombination Jul 22, 2026
60d9ad4
Update docx template to be a4 size
linearcombination Jul 22, 2026
93a4922
Merge pull request #326 from linearcombination/stet-input-docs-update
PurpleGuitar Jul 22, 2026
5fea816
.env var is string not bool, handle correctly
linearcombination Jul 23, 2026
070b8f4
Merge pull request #328 from linearcombination/a4-docx-document-size
linearcombination Jul 23, 2026
c69e664
Merge pull request #327 from linearcombination/turn-off-epub-and-pdf-…
PurpleGuitar Jul 23, 2026
aebc023
Update a Bulgarian string
linearcombination Jul 24, 2026
3ddac21
Merge pull request #329 from linearcombination/update-bulgarian-strings
PurpleGuitar Jul 27, 2026
178c4c2
Update doctests in resource_lookup module
linearcombination Aug 19, 2026
582e8de
Add unit tests for parsing function and update doctest
linearcombination Aug 19, 2026
85b3f75
Merge pull request #330 from linearcombination/update-doctests-in-res…
PurpleGuitar Aug 20, 2026
d7862f4
Merge pull request #331 from linearcombination/update-parsing-unit-tests
PurpleGuitar Aug 20, 2026
8c6a8b2
a4 format for STET output documents
linearcombination Aug 19, 2026
cf8dcdc
Use Mm rather than Inches types
linearcombination Aug 20, 2026
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
6 changes: 0 additions & 6 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,6 @@ CHECK_ALL_BOOKS_FOR_LANGUAGE=true
# 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

# File lock duration when cloning and potentially removing git repos
LOCK_TIMEOUT_SECONDS=300

Expand Down
32 changes: 24 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
.PHONY: startdocker
startdocker:
@if docker info >/dev/null 2>&1; then \
echo "Docker is already running."; \
else \
echo "Starting Docker..."; \
if [ "$$(uname)" = "Darwin" ]; then \
open -a Docker; \
else \
sudo systemctl start docker; \
fi; \
echo "Waiting for Docker to fully initialize..."; \
until docker info >/dev/null 2>&1; do sleep 1; done; \
echo "Docker is ready!"; \
fi

.PHONY: checkvenv
checkvenv:
checkvenv: startdocker
# raises error if environment is not active
ifeq ("$(VIRTUAL_ENV)","")
@echo "Venv is not activated!"
Expand Down Expand Up @@ -119,7 +135,7 @@ test: clean-local-docker-output-dir
docker compose -f docker-compose.yml -f docker-compose.api-test.yml -f docker-compose.override.yml up test-runner

.PHONY: unit-tests
unit-tests:
unit-tests: startdocker
docker compose -f docker-compose.yml -f docker-compose.api-test.yml -f docker-compose.override.yml up test-runner

.PHONY: e2e-tests
Expand All @@ -133,7 +149,7 @@ e2e-docx-tests: clean-local-docker-output-dir


.PHONY: frontend-tests
frontend-tests:
frontend-tests: startdocker
# NOTE If we are experiencing some issues with the docker
# compose running of frontend tests, we can still use the
# non-Dockerized approach successfully. Doing so requires that
Expand Down Expand Up @@ -184,7 +200,7 @@ clean-mypyc-artifacts:
find . ! -path .venv -type f -name "*.c" -exec rm -- {} +

.PHONY: prune-docker-images-volumes
prune-docker-images-volumes:
prune-docker-images-volumes: checkvenv
docker system prune --volumes

# https://radon.readthedocs.io/en/latest/commandline.html
Expand Down Expand Up @@ -301,10 +317,10 @@ local-run-celery:

.PHONY: local-run-flower
local-run-flower:
celery --broker=redis:// --result-backend=redis:// flower
# This is one to run after running local-e2e-tests or any tests which
# has yielded HTML and PDFs that need to be checked for linking
# correctness.
celery --broker=redis:// --result-backend=redis:// flower

# Run after running local-e2e-tests or any tests which has yielded HTML
# and PDFs that need to be checked for linking correctness.
.PHONY: local-check-anchor-links
local-check-anchor-links: checkvenv
python tests/e2e/test_anchor_linking.py
8 changes: 7 additions & 1 deletion backend/doc/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ class Settings(BaseSettings):

DATA_API_URL: HttpUrl

LANGUAGES_WHERE_NON_ULB_PREFERRED: Sequence[str] = ["fr"]

# This is only used to see if a lang_code is in the collection
# otherwise it is a heart language. Eventually the graphql data api may
# provide gateway/heart boolean value.
Expand Down Expand Up @@ -177,7 +179,11 @@ class Settings(BaseSettings):
BOOK_NAME_FMT_STR: str = "<h2 class='book-name'>{}</h2>"
RESOURCE_TYPE_NAME_FMT_STR: str = "<h1 class='book-name'>{}</h1>"
HR: str = "<hr/>"
TW_WORD_LIST_VERTICAL: bool = False
BIEL_TW_RESOURCE_URL_FMT_STR: str = (
"<span><a href='https://bibleineverylanguage.org/resources/languages/{}?resource-type=tw'>{}</a></span>"
)
TW_RESOURCE_URL_FMT_STR: str = "<span><a href='#{}-{}'>{}</a></span>"
LINK_RATHER_THAN_INCLUDE_TW_DEFINITIONS: bool = True

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

Expand Down
10 changes: 6 additions & 4 deletions backend/doc/domain/assembly_strategies/assemble_by_book.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
TWBook,
USFMBook,
)
from doc.domain.parsing import handle_split_chapter_into_verses
from doc.domain.parsing import split_chapter_into_verses_with_formatting
from doc.reviewers_guide.model import RGBook

logger = settings.logger(__name__)
Expand Down Expand Up @@ -475,7 +475,7 @@ def assemble_usfm_by_verse_book_at_a_time(
chapter_num,
chapter,
) in usfm_book.chapters.items():
chapter.verses = handle_split_chapter_into_verses(usfm_book, chapter)
chapter.verses = split_chapter_into_verses_with_formatting(chapter)
chapter_intros = get_chapter_intros(
tn_book,
tnc_book,
Expand Down Expand Up @@ -531,8 +531,10 @@ def assemble_usfm_by_verse_book_at_a_time(
# ulb, f10, show the second USFM content here
if usfm_book2:
usfm_book2_chapter = usfm_book2.chapters[chapter_num]
usfm_book2_chapter.verses = handle_split_chapter_into_verses(
usfm_book2, usfm_book2_chapter
usfm_book2_chapter.verses = (
split_chapter_into_verses_with_formatting(
usfm_book2_chapter
)
)
if (
usfm_book2_chapter.verses
Expand Down
11 changes: 5 additions & 6 deletions backend/doc/domain/assembly_strategies/assemble_by_chapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@
TWBook,
USFMBook,
)
from doc.domain.parsing import handle_split_chapter_into_verses
from doc.domain.parsing import split_chapter_into_verses_with_formatting
from doc.reviewers_guide.model import RGBook


logger = settings.logger(__name__)


Expand Down Expand Up @@ -625,13 +624,13 @@ def assemble_usfm_by_verse_chapter_at_a_time(
primary_verses = None
secondary_verses = None
if usfm_book and usfm_chapter:
usfm_chapter.verses = handle_split_chapter_into_verses(
usfm_book, usfm_chapter
usfm_chapter.verses = split_chapter_into_verses_with_formatting(
usfm_chapter
)
primary_verses = usfm_chapter.verses
if usfm_book2 and usfm_book2_chapter:
usfm_book2_chapter.verses = handle_split_chapter_into_verses(
usfm_book2, usfm_book2_chapter
usfm_book2_chapter.verses = split_chapter_into_verses_with_formatting(
usfm_book2_chapter
)
secondary_verses = usfm_book2_chapter.verses
if usfm_book and primary_verses:
Expand Down
17 changes: 16 additions & 1 deletion backend/doc/domain/document_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
from doc.utils.docx_util import (
add_internal_docx_links,
generate_docx_toc,
override_and_clean_hyperlinks,
style_superscripts,
)
from doc.utils.file_utils import (
Expand Down Expand Up @@ -558,6 +559,7 @@ def assemble_content(
tw_books: Sequence[TWBook],
bc_books: Sequence[BCBook],
rg_books: Sequence[RGBook],
link_rather_than_include_tw_definitions: bool = settings.LINK_RATHER_THAN_INCLUDE_TW_DEFINITIONS,
) -> list[DocumentPart]:
"""
Assemble and return the content from all requested resources according to the
Expand Down Expand Up @@ -651,7 +653,11 @@ def assemble_content(
)
t1 = time.time()
logger.info("Time for interleaving document: %s", t1 - t0)
if tw_books and not document_request.layout_for_print:
if (
tw_books
and not link_rather_than_include_tw_definitions
and not document_request.layout_for_print
):
t0 = time.time()
# Add the translation words definition section for each language requested.
unique_tw_books = filter_unique_by_lang_code(tw_books)
Expand Down Expand Up @@ -778,6 +784,15 @@ def compose_docx_document(
if part.add_page_break:
add_page_break(doc)
style_superscripts(doc, lift_half_points=2, color=None)
# html4doc defeats normal use of hyperlink inline styling in Word
# via a customized (otherwise standard) Hyperlink style, but
# this handles it by doing a pass over the document after the fact
# and forcing hyperlinks to render using a specific style we
# created to match the PO's desired look.
# PlainHyperlinkChar is a character style we created in
# template.docx, but its actual style ID is PlainHyperlinkChar0
# under the hood.
override_and_clean_hyperlinks(doc, "PlainHyperlinkChar0")
t1 = time.time()
logger.info("Time for converting HTML to Docx: %.2f seconds", t1 - t0)
return doc
Expand Down
Loading
Loading