Closed hatton closed 7 months ago
This is currently a major issue for the Scripture Forge help site. Unfortunately I don't have time now to address this, but I wanted to register the fact that we will benefit once this is addressed.
@Nateowami Bloom and Paratext are both using the system as is with two different strategies for localization. If it feels like this is holding you back, it might be worth a short conversation to understand the hang-up and how these two sites are working with the tension currently.
@andrew-polk Originally I planned to have our site be built by running a script that would fetch all documents from Notion, Crowdin, and elsewhere, and build the site. None of the content would be checked in (no screenshots either).
However, I realized before too long that this was kind of impractical and would make it difficult to understand what had actually changed. So I created a new repo, and content (docs and images) are checked in.
Having the file names change every time we fetch them means new screenshots are created in the repo every time. Having the markdown change also added some challenges with updating Crowdin, since there were always changes to the files.
I can't think of a good solution that doesn't involve keeping the file names consistent.
Are the file names changing every time you run docu-notion? Or just when you change something with the image?
With our and PTX setup, we only get changes if there are changes in Notion.
If you see a change with every pull, we will need to figure out what is causing that.
Yes, they change every time, even a few minutes later. I'm running it with npx docu-notion -n $SF_HELP_NOTION_TOKEN -r $SF_HELP_NOTION_ROOT_PAGE_ID
Hm. Looks like npx is running docu-notion 0.11.0. I'll look into why, but in the meantime, try using 0.15.0.
I thought npx downloads the latest version of docu-notion and runs it. Does npx not work how I think? How do I tell it to use a particular version?
Oh, it looks like I should be using @sillsdev/docu-notion
instead of docu-notion
Ah. That would do it.
Also, apparently npx @sillsdev/docu-notion@latest
guarantees no cache issues, etc.
Default image file name template is now {page-slug}.{notion-block-id}
.
See https://github.com/sillsdev/docu-notion/releases/tag/v0.16.0.
Currently, we extract an image name from the S3 URL that Notion uses. This name "matters" if you're doing image localization.
My concern is, what if Notion changes their URL scheme in a way that either a) requires a new regex to extract it (this has happened already once) or b) changes the id entirely?
Instead, we should use the id of the block, which is likely to be at least as stable, if not more-so, and doesn't require a regext to extract. here's a typical block with unnecessary stuff removed:
This is an easy fix, however it would break existing users, so we need a way to opt in or opt out of this change.