Documentation
¶
Overview ¶
Package tc2rc converts translationCore (tc) repositories to Resource Container (RC) format.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WriteReport ¶
WriteReport writes the conversion report as JSON to path.
Types ¶
type Options ¶
type Options struct {
// RepoName overrides the repo name used to locate the exported USFM file
// (<RepoName>.usfm). If empty, the basename of the input directory is used.
RepoName string
}
Options configures a translationCore to RC conversion.
type Report ¶
type Report struct {
// Source is the input translationCore directory.
Source string `json:"source"`
// Output is the output RC directory.
Output string `json:"output"`
// Book is the lowercase book code converted (e.g. "jon").
Book string `json:"book"`
// TCVersion is the manifest tc_version.
TCVersion int `json:"tc_version"`
// USFM is the source .usfm filename selected from the tc repo.
USFM string `json:"usfm"`
// OK is true when a usable RC repository was written.
OK bool `json:"ok"`
// Error is set when OK is false.
Error string `json:"error,omitempty"`
// Warnings are non-fatal issues encountered during conversion.
Warnings []string `json:"warnings,omitempty"`
}
Report is the fail-safe conversion record for one tc → RC conversion. Check OK to determine whether a usable RC repo was produced.
func Convert ¶
Convert converts one translationCore repository at inDir into an RC repository at outDir.
It never panics. Failures are recorded on the returned Report (OK == false). Warnings are non-fatal. On hard conversion failure the incomplete outDir is removed.
The resulting RC (subject "Aligned Bible", one book per repo) is suitable for conversion to Scripture Burrito via github.com/unfoldingWord/go-rc2sb.
type Result ¶
type Result struct {
// Book is the lowercase book code converted.
Book string
// TCVersion is the manifest tc_version.
TCVersion int
// InDir is the input translationCore directory.
InDir string
// OutDir is the output RC directory.
OutDir string
// Warnings is the list of non-fatal conversion warnings.
Warnings []string
}
Result holds summary information about a completed conversion. It mirrors go-rc2sb's Result shape for library consumers.
func ResultFromReport ¶
ResultFromReport builds a Result summary from a completed Report.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package books provides Bible book code data used when building RC manifests and USFM/TSV content from translationCore projects.
|
Package books provides Bible book code data used when building RC manifests and USFM/TSV content from translationCore projects. |
|
cmd
|
|
|
tc2rc
command
Command tc2rc converts a translationCore repository to a Resource Container (RC).
|
Command tc2rc converts a translationCore repository to a Resource Container (RC). |
|
Package rc provides Resource Container 0.2 manifest types and helpers.
|
Package rc provides Resource Container 0.2 manifest types and helpers. |
|
Package tc parses and normalizes translationCore manifest.json files.
|
Package tc parses and normalizes translationCore manifest.json files. |