Skip to content

Commit

Permalink
chore: update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
darcywong00 committed Sep 10, 2023
1 parent dce60d0 commit 4e019ac
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ Parameters
-d [Directory of Toolbox text files for a single book (one chapter per file)]
-j [JSON file representing a single book - used for testing conversion to SFM]
-s [Directory of directories (each subdirectory is a separate book)]

Optional for processing rich text (rtf) files - one of:
-b [A single rtf text file (one chapter of a book)]
-bd [Directory of rtf text files for a single book (one chapter per file)]
-bs [Directory of directories (each subdirectory is a separate book)]
```

### Help
Expand Down Expand Up @@ -68,10 +73,10 @@ npx tsc
```

### Install UnRTF for .rtf Files
This is needed if the source files are .rtf Rich Text Format. Download at
This is needed if the source files are .rtf Rich Text Format, and currently only works on Linux. Download at
https://www.gnu.org/software/unrtf/#downloading

or on Linux:
or on command line:
```bash
sudo apt install unrtf
```
Expand Down
6 changes: 5 additions & 1 deletion src/backTranslation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ export function getBookAndChapter(file: string) : toolbox.fileInfoType {
* @param {boolean} debugMode - Whether to print additional logging
*/
export async function updateObj(bookObj: books.objType, file: string, currentChapter: number,
s: sfmConsole.SFMConsole, debugMode = false) {
s: sfmConsole.SFMConsole, debugMode = false) {
if (!os.type().startsWith('Linux')) {
console.error("unRtf needs to run on Linux");
process.exit(1);
}
const unRtfPath = os.type().startsWith('Linux') ? "/usr/bin" : ""; // Path for UnRtf
const unRtf = new UnRTF(unRtfPath);
const options = {
Expand Down

0 comments on commit 4e019ac

Please sign in to comment.