diff --git a/srcBOOK/.ci/build_unix-any.sh b/srcBOOK/.ci/build_unix-any.sh index 64f7677..31cd6dc 100644 --- a/srcBOOK/.ci/build_unix-any.sh +++ b/srcBOOK/.ci/build_unix-any.sh @@ -38,65 +38,71 @@ fi -# setup inportant variables -___name="${PROJECT_SKU}_${PROJECT_VERSION}_any-any" -___source="book.odt" +# setup important variables +Build_Book() { + #___input="$1" + #___name="$2" + + # build PDF + ___source="${PROJECT_PATH_ROOT}/${PROJECT_BOOK}/${1}" + ___dest="${PROJECT_PATH_ROOT}/${PROJECT_PATH_TEMP}/build-${2}" + I18N_Prepare "$___source" + FS_Is_File "$___source" + if [ $? -ne 0 ]; then + I18N_Prepare_Failed + return 1 + fi + FS_Remake_Directory "$___dest" + + + ## IMPORTANT: refer the following page for modifying parameters: + ## https://help.libreoffice.org/latest/en-US/text/shared/guide/pdf_params.html + I18N_Build "$___source" + $(LIBREOFFICE_Get) --headless --convert-to "pdf:writer_pdf_Export:{ + \"UseLosslessCompression\": true, + \"Quality\": 100, + \"SelectPdfVersion\": 0, + \"PDFUACompliance\": false, + \"UseTaggedPDF\": true, + \"ExportFormFields\": true, + \"FormsType\": 1, + \"ExportBookmarks\": true, + \"ExportPlaceholders\": true +}" --outdir "$___dest" "$___source" + ___process=$? + if [ $___process -ne 0 ]; then + I18N_Build_Failed + return 1 + fi + ## export output + ___source="${___dest}/$(FS_Get_File "$___source")" + ___source="$(FS_Extension_Replace "$___source" ".odt" ".pdf")" + ___dest="${PROJECT_PATH_ROOT}/${PROJECT_PATH_BUILD}/${2}.pdf" + FS_Is_File "$___source" + if [ $? -ne 0 ]; then + I18N_Build_Failed + return 1 + fi -# build PDF -___source="${PROJECT_PATH_ROOT}/${PROJECT_BOOK}/${___source}" -___dest="${PROJECT_PATH_ROOT}/${PROJECT_PATH_TEMP}/build-${___name}" -I18N_Prepare "$___source" -FS_Is_File "$___source" -if [ $? -ne 0 ]; then - I18N_Prepare_Failed - return 1 -fi + I18N_Export "$___dest" + FS_Remove_Silently "$___dest" + FS_Make_Housing_Directory "$___dest" + FS_Copy_File "$___source" "$___dest" + if [ $? -ne 0 ]; then + I18N_Export_Failed + return 1 + fi +} -FS_Remake_Directory "$___dest" - -## IMPORTANT: refer the following page for modifying parameters: -## https://help.libreoffice.org/latest/en-US/text/shared/guide/pdf_params.html -I18N_Build "$___source" -$(LIBREOFFICE_Get) --headless --convert-to "pdf:writer_pdf_Export:{ - \"UseLosslessCompression\": true, - \"Quality\": 100, - \"SelectPdfVersion\": 0, - \"PDFUACompliance\": false, - \"UseTaggedPDF\": true, - \"ExportFormFields\": true, - \"FormsType\": 1, - \"ExportBookmarks\": true, - \"ExportPlaceholders\": true -}" --outdir "$___dest" "$___source" -___process=$? -if [ $___process -ne 0 ]; then - I18N_Build_Failed - return 1 -fi - -## export output -___source="${___dest}/$(FS_Get_File "$___source")" -___source="$(FS_Extension_Replace "$___source" ".odt" ".pdf")" -___dest="${PROJECT_PATH_ROOT}/${PROJECT_PATH_BUILD}/${___name}.pdf" - -FS_Is_File "$___source" -if [ $? -ne 0 ]; then - I18N_Build_Failed - return 1 -fi - -I18N_Export "$___dest" -FS_Remove_Silently "$___dest" -FS_Make_Housing_Directory "$___dest" -FS_Copy_File "$___source" "$___dest" +# build books +Build_Book "en.odt" "${PROJECT_SKU}_${PROJECT_VERSION}_en_any-any" if [ $? -ne 0 ]; then - I18N_Export_Failed return 1 fi diff --git a/srcBOOK/.ci/build_windows-any.ps1 b/srcBOOK/.ci/build_windows-any.ps1 index 423cfd8..a006837 100644 --- a/srcBOOK/.ci/build_windows-any.ps1 +++ b/srcBOOK/.ci/build_windows-any.ps1 @@ -38,27 +38,29 @@ if ($___process -ne 0) { # setup important variables -$___name = "${env:PROJECT_SKU}_${env:PROJECT_VERSION}_any-any" -$___source = "book.odt" - - - - -# build PDF -$___source = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_BOOK}\${___source}" -$___dest = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_TEMP}\build-${___name}" -$null = I18N-Prepare "${___source}" -$___process = FS-Is-File "${___source}" -if ($___process -ne 0) { - $null = I18N-Prepare-Failed - return 1 -} -$null = FS-Remake-Directory "${___dest}" - -## IMPORTANT: refer the following page for modifying parameters: -## https://help.libreoffice.org/latest/en-US/text/shared/guide/pdf_params.html -$null = I18N-Build "${___source}" -$___process = OS-Exec "$(LIBREOFFICE-Get)" @" +function Build-Book { + param( + [string]$___input, + [string]$___name + ) + + + # build PDF + $___source = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_BOOK}\${___input}" + $___dest = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_TEMP}\build-${___name}" + $null = I18N-Prepare "${___source}" + $___process = FS-Is-File "${___source}" + if ($___process -ne 0) { + $null = I18N-Prepare-Failed + return 1 + } + $null = FS-Remake-Directory "${___dest}" + + + ## IMPORTANT: refer the following page for modifying parameters: + ## https://help.libreoffice.org/latest/en-US/text/shared/guide/pdf_params.html + $null = I18N-Build "${___source}" + $___process = OS-Exec "$(LIBREOFFICE-Get)" @" --headless --convert-to "pdf:writer_pdf_Export:{ "UseLosslessCompression": true, "Quality": 100, @@ -71,31 +73,39 @@ $___process = OS-Exec "$(LIBREOFFICE-Get)" @" "ExportPlaceholders": true, }" --outdir "${___dest}" "${___source}" "@ -if ($___process -ne 0) { - $null = I18N-Build-Failed - return 1 + if ($___process -ne 0) { + $null = I18N-Build-Failed + return 1 + } + + + ## export output + $___source = "${___dest}\$(FS-Get-File "${___source}")" + $___source = FS-Extension-Replace "${___source}" ".odt" ".pdf" + $___dest = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_BUILD}\${___name}.pdf" + + $___process = FS-Is-File "${___source}" + if ($___process -ne 0) { + $null = I18N-Build-Failed + return 1 + } + + $null = I18N-Export "${___dest}" + $null = FS-Remove-Silently "${___dest}" + $null = FS-Make-Housing-Directory "${___dest}" + $___process = FS-Copy-File "${___source}" "${___dest}" + if ($___process -ne 0) { + $null = I18N-Export-Failed + return 1 + } } -# export output -$___source = "${___dest}\$(FS-Get-File "${___source}")" -$___source = FS-Extension-Replace "${___source}" ".odt" ".pdf" -$___dest = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_BUILD}\${___name}.pdf" - -$___process = FS-Is-File "${___source}" -if ($___process -ne 0) { - $null = I18N-Build-Failed - return 1 -} - -$null = I18N-Export "${___dest}" -$null = FS-Remove-Silently "${___dest}" -$null = FS-Make-Housing-Directory "${___dest}" -$___process = FS-Copy-File "${___source}" "${___dest}" +# build books +$___process = Build-Book "en.odt" "${env:PROJECT_SKU}_${env:PROJECT_VERSION}_en_any-any" if ($___process -ne 0) { - $null = I18N-Export-Failed return 1 } diff --git a/srcBOOK/book.odt b/srcBOOK/00-00-00_Forewords/en.odt similarity index 82% rename from srcBOOK/book.odt rename to srcBOOK/00-00-00_Forewords/en.odt index 59320b3..2a86e79 100644 Binary files a/srcBOOK/book.odt and b/srcBOOK/00-00-00_Forewords/en.odt differ diff --git a/srcBOOK/00-01-00_Abstract/en.odt b/srcBOOK/00-01-00_Abstract/en.odt new file mode 100644 index 0000000..b43fda2 Binary files /dev/null and b/srcBOOK/00-01-00_Abstract/en.odt differ diff --git a/srcBOOK/00-02-00_Prologue/en.odt b/srcBOOK/00-02-00_Prologue/en.odt new file mode 100644 index 0000000..45a7ded Binary files /dev/null and b/srcBOOK/00-02-00_Prologue/en.odt differ diff --git a/srcBOOK/en.odt b/srcBOOK/en.odt new file mode 100644 index 0000000..5865b59 Binary files /dev/null and b/srcBOOK/en.odt differ