From 5551859ac9621b9c0496d1b8536acc73b00f279b Mon Sep 17 00:00:00 2001 From: webmaster442 Date: Mon, 25 May 2026 12:20:17 +0200 Subject: [PATCH 01/15] Aset meanagement rework --- Assets/.gitignore | 2 + Assets/dictionaries/af_ZA.aff | 1485 --------------------------- Assets/dictionaries/af_ZA.dic | 1485 --------------------------- Assets/dictionaries/de_DE_frami.aff | 1485 --------------------------- Assets/dictionaries/de_DE_frami.dic | 1485 --------------------------- Assets/dictionaries/en_GB.aff | 1485 --------------------------- Assets/dictionaries/en_GB.dic | 1485 --------------------------- Assets/dictionaries/en_US.aff | 1485 --------------------------- Assets/dictionaries/en_US.dic | 1485 --------------------------- Assets/dictionaries/es_ES.aff | 1485 --------------------------- Assets/dictionaries/es_ES.dic | 1485 --------------------------- Assets/dictionaries/hr_HR.aff | 1485 --------------------------- Assets/dictionaries/hr_HR.dic | 1485 --------------------------- Assets/dictionaries/hu_HU.aff | 1485 --------------------------- Assets/dictionaries/hu_HU.dic | 1485 --------------------------- Assets/dictionaries/it_IT.aff | 1485 --------------------------- Assets/dictionaries/it_IT.dic | 1485 --------------------------- Assets/dictionaries/nl_NL.aff | 1485 --------------------------- Assets/dictionaries/nl_NL.dic | 1485 --------------------------- Assets/download-dictionaries.ps1 | 24 - download-assets.ps1 | 54 + publish.ps1 | 32 +- 22 files changed, 77 insertions(+), 26765 deletions(-) create mode 100644 Assets/.gitignore delete mode 100644 Assets/dictionaries/af_ZA.aff delete mode 100644 Assets/dictionaries/af_ZA.dic delete mode 100644 Assets/dictionaries/de_DE_frami.aff delete mode 100644 Assets/dictionaries/de_DE_frami.dic delete mode 100644 Assets/dictionaries/en_GB.aff delete mode 100644 Assets/dictionaries/en_GB.dic delete mode 100644 Assets/dictionaries/en_US.aff delete mode 100644 Assets/dictionaries/en_US.dic delete mode 100644 Assets/dictionaries/es_ES.aff delete mode 100644 Assets/dictionaries/es_ES.dic delete mode 100644 Assets/dictionaries/hr_HR.aff delete mode 100644 Assets/dictionaries/hr_HR.dic delete mode 100644 Assets/dictionaries/hu_HU.aff delete mode 100644 Assets/dictionaries/hu_HU.dic delete mode 100644 Assets/dictionaries/it_IT.aff delete mode 100644 Assets/dictionaries/it_IT.dic delete mode 100644 Assets/dictionaries/nl_NL.aff delete mode 100644 Assets/dictionaries/nl_NL.dic delete mode 100644 Assets/download-dictionaries.ps1 create mode 100644 download-assets.ps1 diff --git a/Assets/.gitignore b/Assets/.gitignore new file mode 100644 index 00000000..59e49f97 --- /dev/null +++ b/Assets/.gitignore @@ -0,0 +1,2 @@ +tools/* +dictionaries/* diff --git a/Assets/dictionaries/af_ZA.aff b/Assets/dictionaries/af_ZA.aff deleted file mode 100644 index 0759c265..00000000 --- a/Assets/dictionaries/af_ZA.aff +++ /dev/null @@ -1,1485 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - dictionaries/af_ZA/af_ZA.aff at master · LibreOffice/dictionaries · GitHub - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - -
- Skip to content - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - -
- -
- - - - - - - - -
- - - - - -
- - - - - - - - - -
-
-
- - - - - - - - - - - - - -
- -
- -
- -
- - - - / - - dictionaries - - - Public -
- - -
- -
- - -
-
- -
-
- - - - -
- - - - - -
- - - - - - - - - - - - - - - - - - -
-
- - - - -
- -
- -
-
- -
- -
-

Footer

- - - - -
-
- - - - - © 2026 GitHub, Inc. - -
- - -
-
- - - - - - - - - - - - - - - - - - - - -
-
-
- - - diff --git a/Assets/dictionaries/af_ZA.dic b/Assets/dictionaries/af_ZA.dic deleted file mode 100644 index c7c58134..00000000 --- a/Assets/dictionaries/af_ZA.dic +++ /dev/null @@ -1,1485 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - dictionaries/af_ZA/af_ZA.dic at master · LibreOffice/dictionaries · GitHub - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - -
- Skip to content - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - -
- -
- - - - - - - - -
- - - - - -
- - - - - - - - - -
-
-
- - - - - - - - - - - - - -
- -
- -
- -
- - - - / - - dictionaries - - - Public -
- - -
- -
- - -
-
- -
-
- - - - -
- - - - - -
- - - - - - - - - - - - - - - - - - -
-
- - - - -
- -
- -
-
- -
- -
-

Footer

- - - - -
-
- - - - - © 2026 GitHub, Inc. - -
- - -
-
- - - - - - - - - - - - - - - - - - - - -
-
-
- - - diff --git a/Assets/dictionaries/de_DE_frami.aff b/Assets/dictionaries/de_DE_frami.aff deleted file mode 100644 index 528e2f7e..00000000 --- a/Assets/dictionaries/de_DE_frami.aff +++ /dev/null @@ -1,1485 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - dictionaries/de/de_DE_frami.aff at master · LibreOffice/dictionaries · GitHub - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - -
- Skip to content - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - -
- -
- - - - - - - - -
- - - - - -
- - - - - - - - - -
-
-
- - - - - - - - - - - - - -
- -
- -
- -
- - - - / - - dictionaries - - - Public -
- - -
- -
- - -
-
- -
-
- - - - -
- - - - - -
- - - - - - - - - - - - - - - - - - -
-
- - - - -
- -
- -
-
- -
- -
-

Footer

- - - - -
-
- - - - - © 2026 GitHub, Inc. - -
- - -
-
- - - - - - - - - - - - - - - - - - - - -
-
-
- - - diff --git a/Assets/dictionaries/de_DE_frami.dic b/Assets/dictionaries/de_DE_frami.dic deleted file mode 100644 index 6bc205d2..00000000 --- a/Assets/dictionaries/de_DE_frami.dic +++ /dev/null @@ -1,1485 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - dictionaries/de/de_DE_frami.dic at master · LibreOffice/dictionaries · GitHub - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - -
- Skip to content - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - -
- -
- - - - - - - - -
- - - - - -
- - - - - - - - - -
-
-
- - - - - - - - - - - - - -
- -
- -
- -
- - - - / - - dictionaries - - - Public -
- - -
- -
- - -
-
- -
-
- - - - -
- - - - - -
- - - - - - - - - - - - - - - - - - -
-
- - - - -
- -
- -
-
- -
- -
-

Footer

- - - - -
-
- - - - - © 2026 GitHub, Inc. - -
- - -
-
- - - - - - - - - - - - - - - - - - - - -
-
-
- - - diff --git a/Assets/dictionaries/en_GB.aff b/Assets/dictionaries/en_GB.aff deleted file mode 100644 index 2e825980..00000000 --- a/Assets/dictionaries/en_GB.aff +++ /dev/null @@ -1,1485 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - dictionaries/en/en_GB.aff at master · LibreOffice/dictionaries · GitHub - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - -
- Skip to content - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - -
- -
- - - - - - - - -
- - - - - -
- - - - - - - - - -
-
-
- - - - - - - - - - - - - -
- -
- -
- -
- - - - / - - dictionaries - - - Public -
- - -
- -
- - -
-
- -
-
- - - - -
- - - - - -
- - - - - - - - - - - - - - - - - - -
-
- - - - -
- -
- -
-
- -
- -
-

Footer

- - - - -
-
- - - - - © 2026 GitHub, Inc. - -
- - -
-
- - - - - - - - - - - - - - - - - - - - -
-
-
- - - diff --git a/Assets/dictionaries/en_GB.dic b/Assets/dictionaries/en_GB.dic deleted file mode 100644 index f99aa9f3..00000000 --- a/Assets/dictionaries/en_GB.dic +++ /dev/null @@ -1,1485 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - dictionaries/en/en_GB.dic at master · LibreOffice/dictionaries · GitHub - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - -
- Skip to content - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - -
- -
- - - - - - - - -
- - - - - -
- - - - - - - - - -
-
-
- - - - - - - - - - - - - -
- -
- -
- -
- - - - / - - dictionaries - - - Public -
- - -
- -
- - -
-
- -
-
- - - - -
- - - - - -
- - - - - - - - - - - - - - - - - - -
-
- - - - -
- -
- -
-
- -
- -
-

Footer

- - - - -
-
- - - - - © 2026 GitHub, Inc. - -
- - -
-
- - - - - - - - - - - - - - - - - - - - -
-
-
- - - diff --git a/Assets/dictionaries/en_US.aff b/Assets/dictionaries/en_US.aff deleted file mode 100644 index f7d5f826..00000000 --- a/Assets/dictionaries/en_US.aff +++ /dev/null @@ -1,1485 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - dictionaries/en/en_US.aff at master · LibreOffice/dictionaries · GitHub - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - -
- Skip to content - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - -
- -
- - - - - - - - -
- - - - - -
- - - - - - - - - -
-
-
- - - - - - - - - - - - - -
- -
- -
- -
- - - - / - - dictionaries - - - Public -
- - -
- -
- - -
-
- -
-
- - - - -
- - - - - -
- - - - - - - - - - - - - - - - - - -
-
- - - - -
- -
- -
-
- -
- -
-

Footer

- - - - -
-
- - - - - © 2026 GitHub, Inc. - -
- - -
-
- - - - - - - - - - - - - - - - - - - - -
-
-
- - - diff --git a/Assets/dictionaries/en_US.dic b/Assets/dictionaries/en_US.dic deleted file mode 100644 index 2a2d405d..00000000 --- a/Assets/dictionaries/en_US.dic +++ /dev/null @@ -1,1485 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - dictionaries/en/en_US.dic at master · LibreOffice/dictionaries · GitHub - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - -
- Skip to content - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - -
- -
- - - - - - - - -
- - - - - -
- - - - - - - - - -
-
-
- - - - - - - - - - - - - -
- -
- -
- -
- - - - / - - dictionaries - - - Public -
- - -
- -
- - -
-
- -
-
- - - - -
- - - - - -
- - - - - - - - - - - - - - - - - - -
-
- - - - -
- -
- -
-
- -
- -
-

Footer

- - - - -
-
- - - - - © 2026 GitHub, Inc. - -
- - -
-
- - - - - - - - - - - - - - - - - - - - -
-
-
- - - diff --git a/Assets/dictionaries/es_ES.aff b/Assets/dictionaries/es_ES.aff deleted file mode 100644 index 6eebee96..00000000 --- a/Assets/dictionaries/es_ES.aff +++ /dev/null @@ -1,1485 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - dictionaries/es/es_ES.aff at master · LibreOffice/dictionaries · GitHub - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - -
- Skip to content - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - -
- -
- - - - - - - - -
- - - - - -
- - - - - - - - - -
-
-
- - - - - - - - - - - - - -
- -
- -
- -
- - - - / - - dictionaries - - - Public -
- - -
- -
- - -
-
- -
-
- - - - -
- - - - - -
- - - - - - - - - - - - - - - - - - -
-
- - - - -
- -
- -
-
- -
- -
-

Footer

- - - - -
-
- - - - - © 2026 GitHub, Inc. - -
- - -
-
- - - - - - - - - - - - - - - - - - - - -
-
-
- - - diff --git a/Assets/dictionaries/es_ES.dic b/Assets/dictionaries/es_ES.dic deleted file mode 100644 index a1858be5..00000000 --- a/Assets/dictionaries/es_ES.dic +++ /dev/null @@ -1,1485 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - dictionaries/es/es_ES.dic at master · LibreOffice/dictionaries · GitHub - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - -
- Skip to content - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - -
- -
- - - - - - - - -
- - - - - -
- - - - - - - - - -
-
-
- - - - - - - - - - - - - -
- -
- -
- -
- - - - / - - dictionaries - - - Public -
- - -
- -
- - -
-
- -
-
- - - - -
- - - - - -
- - - - - - - - - - - - - - - - - - -
-
- - - - -
- -
- -
-
- -
- -
-

Footer

- - - - -
-
- - - - - © 2026 GitHub, Inc. - -
- - -
-
- - - - - - - - - - - - - - - - - - - - -
-
-
- - - diff --git a/Assets/dictionaries/hr_HR.aff b/Assets/dictionaries/hr_HR.aff deleted file mode 100644 index e3511130..00000000 --- a/Assets/dictionaries/hr_HR.aff +++ /dev/null @@ -1,1485 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - dictionaries/hr_HR/hr_HR.aff at master · LibreOffice/dictionaries · GitHub - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - -
- Skip to content - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - -
- -
- - - - - - - - -
- - - - - -
- - - - - - - - - -
-
-
- - - - - - - - - - - - - -
- -
- -
- -
- - - - / - - dictionaries - - - Public -
- - -
- -
- - -
-
- -
-
- - - - -
- - - - - -
- - - - - - - - - - - - - - - - - - -
-
- - - - -
- -
- -
-
- -
- -
-

Footer

- - - - -
-
- - - - - © 2026 GitHub, Inc. - -
- - -
-
- - - - - - - - - - - - - - - - - - - - -
-
-
- - - diff --git a/Assets/dictionaries/hr_HR.dic b/Assets/dictionaries/hr_HR.dic deleted file mode 100644 index 797f4a63..00000000 --- a/Assets/dictionaries/hr_HR.dic +++ /dev/null @@ -1,1485 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - dictionaries/hr_HR/hr_HR.dic at master · LibreOffice/dictionaries · GitHub - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - -
- Skip to content - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - -
- -
- - - - - - - - -
- - - - - -
- - - - - - - - - -
-
-
- - - - - - - - - - - - - -
- -
- -
- -
- - - - / - - dictionaries - - - Public -
- - -
- -
- - -
-
- -
-
- - - - -
- - - - - -
- - - - - - - - - - - - - - - - - - -
-
- - - - -
- -
- -
-
- -
- -
-

Footer

- - - - -
-
- - - - - © 2026 GitHub, Inc. - -
- - -
-
- - - - - - - - - - - - - - - - - - - - -
-
-
- - - diff --git a/Assets/dictionaries/hu_HU.aff b/Assets/dictionaries/hu_HU.aff deleted file mode 100644 index cb831357..00000000 --- a/Assets/dictionaries/hu_HU.aff +++ /dev/null @@ -1,1485 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - dictionaries/hu_HU/hu_HU.aff at master · LibreOffice/dictionaries · GitHub - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - -
- Skip to content - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - -
- -
- - - - - - - - -
- - - - - -
- - - - - - - - - -
-
-
- - - - - - - - - - - - - -
- -
- -
- -
- - - - / - - dictionaries - - - Public -
- - -
- -
- - -
-
- -
-
- - - - -
- - - - - -
- - - - - - - - - - - - - - - - - - -
-
- - - - -
- -
- -
-
- -
- -
-

Footer

- - - - -
-
- - - - - © 2026 GitHub, Inc. - -
- - -
-
- - - - - - - - - - - - - - - - - - - - -
-
-
- - - diff --git a/Assets/dictionaries/hu_HU.dic b/Assets/dictionaries/hu_HU.dic deleted file mode 100644 index 7692e93a..00000000 --- a/Assets/dictionaries/hu_HU.dic +++ /dev/null @@ -1,1485 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - dictionaries/hu_HU/hu_HU.dic at master · LibreOffice/dictionaries · GitHub - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - -
- Skip to content - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - -
- -
- - - - - - - - -
- - - - - -
- - - - - - - - - -
-
-
- - - - - - - - - - - - - -
- -
- -
- -
- - - - / - - dictionaries - - - Public -
- - -
- -
- - -
-
- -
-
- - - - -
- - - - - -
- - - - - - - - - - - - - - - - - - -
-
- - - - -
- -
- -
-
- -
- -
-

Footer

- - - - -
-
- - - - - © 2026 GitHub, Inc. - -
- - -
-
- - - - - - - - - - - - - - - - - - - - -
-
-
- - - diff --git a/Assets/dictionaries/it_IT.aff b/Assets/dictionaries/it_IT.aff deleted file mode 100644 index c44a6359..00000000 --- a/Assets/dictionaries/it_IT.aff +++ /dev/null @@ -1,1485 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - dictionaries/it_IT/it_IT.aff at master · LibreOffice/dictionaries · GitHub - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - -
- Skip to content - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - -
- -
- - - - - - - - -
- - - - - -
- - - - - - - - - -
-
-
- - - - - - - - - - - - - -
- -
- -
- -
- - - - / - - dictionaries - - - Public -
- - -
- -
- - -
-
- -
-
- - - - -
- - - - - -
- - - - - - - - - - - - - - - - - - -
-
- - - - -
- -
- -
-
- -
- -
-

Footer

- - - - -
-
- - - - - © 2026 GitHub, Inc. - -
- - -
-
- - - - - - - - - - - - - - - - - - - - -
-
-
- - - diff --git a/Assets/dictionaries/it_IT.dic b/Assets/dictionaries/it_IT.dic deleted file mode 100644 index 53d44c25..00000000 --- a/Assets/dictionaries/it_IT.dic +++ /dev/null @@ -1,1485 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - dictionaries/it_IT/it_IT.dic at master · LibreOffice/dictionaries · GitHub - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - -
- Skip to content - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - -
- -
- - - - - - - - -
- - - - - -
- - - - - - - - - -
-
-
- - - - - - - - - - - - - -
- -
- -
- -
- - - - / - - dictionaries - - - Public -
- - -
- -
- - -
-
- -
-
- - - - -
- - - - - -
- - - - - - - - - - - - - - - - - - -
-
- - - - -
- -
- -
-
- -
- -
-

Footer

- - - - -
-
- - - - - © 2026 GitHub, Inc. - -
- - -
-
- - - - - - - - - - - - - - - - - - - - -
-
-
- - - diff --git a/Assets/dictionaries/nl_NL.aff b/Assets/dictionaries/nl_NL.aff deleted file mode 100644 index e64fb30d..00000000 --- a/Assets/dictionaries/nl_NL.aff +++ /dev/null @@ -1,1485 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - dictionaries/nl_NL/nl_NL.aff at master · LibreOffice/dictionaries · GitHub - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - -
- Skip to content - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - -
- -
- - - - - - - - -
- - - - - -
- - - - - - - - - -
-
-
- - - - - - - - - - - - - -
- -
- -
- -
- - - - / - - dictionaries - - - Public -
- - -
- -
- - -
-
- -
-
- - - - -
- - - - - -
- - - - - - - - - - - - - - - - - - -
-
- - - - -
- -
- -
-
- -
- -
-

Footer

- - - - -
-
- - - - - © 2026 GitHub, Inc. - -
- - -
-
- - - - - - - - - - - - - - - - - - - - -
-
-
- - - diff --git a/Assets/dictionaries/nl_NL.dic b/Assets/dictionaries/nl_NL.dic deleted file mode 100644 index 6d5d5272..00000000 --- a/Assets/dictionaries/nl_NL.dic +++ /dev/null @@ -1,1485 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - dictionaries/nl_NL/nl_NL.dic at master · LibreOffice/dictionaries · GitHub - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - -
- Skip to content - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - -
- -
- - - - - - - - -
- - - - - -
- - - - - - - - - -
-
-
- - - - - - - - - - - - - -
- -
- -
- -
- - - - / - - dictionaries - - - Public -
- - -
- -
- - -
-
- -
-
- - - - -
- - - - - -
- - - - - - - - - - - - - - - - - - -
-
- - - - -
- -
- -
-
- -
- -
-

Footer

- - - - -
-
- - - - - © 2026 GitHub, Inc. - -
- - -
-
- - - - - - - - - - - - - - - - - - - - -
-
-
- - - diff --git a/Assets/download-dictionaries.ps1 b/Assets/download-dictionaries.ps1 deleted file mode 100644 index e275c4a7..00000000 --- a/Assets/download-dictionaries.ps1 +++ /dev/null @@ -1,24 +0,0 @@ -$dictionariesPath = ".\dictionaries" -if (-not (Test-Path $dictionariesPath)) { - New-Item -ItemType Directory -Path $dictionariesPath | Out-Null -} - -cd $dictionariesPath -curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/en/en_GB.aff" -curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/en/en_GB.dic" -curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/en/en_US.aff" -curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/en/en_US.dic" -curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/hu_HU/hu_HU.aff" -curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/hu_HU/hu_HU.dic" -curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/hr_HR/hr_HR.aff" -curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/hr_HR/hr_HR.dic" -curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/it_IT/it_IT.aff" -curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/it_IT/it_IT.dic" -curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/nl_NL/nl_NL.aff" -curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/nl_NL/nl_NL.dic" -curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/de/de_DE_frami.aff" -curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/de/de_DE_frami.dic" -curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/es/es_ES.aff" -curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/es/es_ES.dic" -cd .. - diff --git a/download-assets.ps1 b/download-assets.ps1 new file mode 100644 index 00000000..2b7d257c --- /dev/null +++ b/download-assets.ps1 @@ -0,0 +1,54 @@ +$startdir = Get-Location +$dictionariesPath = ".\Assets\dictionaries" +$toolsPath = ".\Assets\tools" + +if (-not (Test-Path $dictionariesPath)) { + New-Item -ItemType Directory -Path $dictionariesPath | Out-Null +} + +if (-not (Test-Path $toolsPath)) { + New-Item -ItemType Directory -Path $toolsPath | Out-Null +} + +Set-Location $dictionariesPath +curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/en/en_GB.aff" +curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/en/en_GB.dic" +curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/en/en_US.aff" +curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/en/en_US.dic" +curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/hu_HU/hu_HU.aff" +curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/hu_HU/hu_HU.dic" +curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/hr_HR/hr_HR.aff" +curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/hr_HR/hr_HR.dic" +curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/it_IT/it_IT.aff" +curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/it_IT/it_IT.dic" +curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/nl_NL/nl_NL.aff" +curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/nl_NL/nl_NL.dic" +curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/de/de_DE_frami.aff" +curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/de/de_DE_frami.dic" +curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/es/es_ES.aff" +curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/es/es_ES.dic" +Set-Location $startdir + +Set-Location $toolsPath +curl.exe -L -O "https://github.com/erweixin/RaTeX/releases/download/v0.1.9/ratex-cli-v0.1.9-x86_64-pc-windows-msvc.zip" +curl.exe -L -O "https://github.com/erweixin/RaTeX/releases/download/v0.1.9/ratex-cli-v0.1.9-x86_64-unknown-linux-musl.tar.gz" +curl.exe -L -O "https://github.com/1jehuang/mermaid-rs-renderer/releases/download/v0.2.2/mmdr-x86_64-pc-windows-msvc.zip" +curl.exe -L -O "https://github.com/1jehuang/mermaid-rs-renderer/releases/download/v0.2.2/mmdr-x86_64-unknown-linux-gnu.tar.gz" + +Expand-Archive .\mmdr-x86_64-pc-windows-msvc.zip -DestinationPath . +Remove-Item .\mmdr-x86_64-pc-windows-msvc.zip + +tar -xzf .\mmdr-x86_64-unknown-linux-gnu.tar.gz -C . +Remove-Item .\mmdr-x86_64-unknown-linux-gnu.tar.gz + +Expand-Archive .\ratex-cli-v0.1.9-x86_64-pc-windows-msvc.zip -DestinationPath . +Move-Item .\ratex-cli-v0.1.9-x86_64-pc-windows-msvc\render-svg.exe .\ratex-svg.exe +Remove-Item .\ratex-cli-v0.1.9-x86_64-pc-windows-msvc.zip +Remove-Item .\ratex-cli-v0.1.9-x86_64-pc-windows-msvc -Recurse -Force + +tar -xzf .\ratex-cli-v0.1.9-x86_64-unknown-linux-musl.tar.gz -C . +Move-Item .\ratex-cli-v0.1.9-x86_64-unknown-linux-musl\render-svg .\ratex-svg +Remove-Item .\ratex-cli-v0.1.9-x86_64-unknown-linux-musl.tar.gz +Remove-Item .\ratex-cli-v0.1.9-x86_64-unknown-linux-musl -Recurse -Force + +Set-Location $startdir \ No newline at end of file diff --git a/publish.ps1 b/publish.ps1 index 4751d593..1698df2e 100644 --- a/publish.ps1 +++ b/publish.ps1 @@ -1,20 +1,25 @@ Clear-Host -function Invoke-Publish { - param( - [bool] $SelfContained, - [string] $WindowsArchiveName, - [string] $LinuxArchiveName - ) - +function New-Folders { if (Test-Path "bin\publish\windows") { Remove-Item "bin\publish\windows*" -Recurse -Force } if (Test-Path "bin\publish\linux") { - Remove-Item "bin\publish\windows*" -Recurse -Force + Remove-Item "bin\publish\linux*" -Recurse -Force } + New-Item -Path "bin\publish\windows" -ItemType Directory -Force + New-Item -Path "bin\publish\linux" -ItemType Directory -Force +} + +function Invoke-Publish { + param( + [bool] $SelfContained, + [string] $WindowsArchiveName, + [string] $LinuxArchiveName + ) + # publish windows & linux if ($SelfContained) { dotnet publish -c release -o "bin\publish\windows\bin" --self-contained true -r win-x64 -p PublishReadyToRun BookGen.slnx @@ -58,20 +63,25 @@ function Invoke-Publish { # zip if ($SelfContained) { Compress-Archive -Path "bin\publish\windows\*" -DestinationPath "bin\publish\$WindowsArchiveName" -Force - clear + Clear-Host tar -czvf "bin\publish\$LinuxArchiveName" -C "bin\publish\linux" . } else { Compress-Archive -Path "bin\publish\windows\*" -DestinationPath "bin\publish\$WindowsArchiveName" -Force - clear + Clear-Host tar -czvf "bin\publish\$LinuxArchiveName" -C "bin\publish\linux" . } } +New-Folders + +Get-Tools + # Framework-dependent build and archives Invoke-Publish -SelfContained $false -WindowsArchiveName "BookGen-windows.zip" -LinuxArchiveName "BookGen-linux.tar.gz" # Self-contained build and archives Invoke-Publish -SelfContained $true -WindowsArchiveName "BookGen-windows-selefcontained.zip" -LinuxArchiveName "BookGen-linux-selefcontained.tar.gz" -.\PublishFiles\mkisofs.exe -V BookGen -o .\bin\publish\bookgen-windows.iso -udf .\bin\publish\windows \ No newline at end of file +.\PublishFiles\mkisofs.exe -V BookGen -o .\bin\publish\bookgen-windows.iso -udf .\bin\publish\windows + From c0cca2ae28515e361e16334877b7fafb9ccd29a6 Mon Sep 17 00:00:00 2001 From: webmaster442 Date: Mon, 25 May 2026 13:06:57 +0200 Subject: [PATCH 02/15] Work on new Render interop --- .../BookGen.Contents/BookGen.Contents.csproj | 18 +++ .../{JsInterop => }/JavascriptBuilder.cs | 2 +- .../Markdown/RenderInterop/IRenderInterop.cs | 12 ++ .../RenderInterop/JavascriptEngine.cs | 58 +++++++++ .../Markdown/RenderInterop/RenderInterop.cs | 119 ++++++++++++++++++ 5 files changed, 208 insertions(+), 1 deletion(-) rename Source/Bookgen.Lib/{JsInterop => }/JavascriptBuilder.cs (97%) create mode 100644 Source/Bookgen.Lib/Markdown/RenderInterop/IRenderInterop.cs create mode 100644 Source/Bookgen.Lib/Markdown/RenderInterop/JavascriptEngine.cs create mode 100644 Source/Bookgen.Lib/Markdown/RenderInterop/RenderInterop.cs diff --git a/Source/BookGen.Contents/BookGen.Contents.csproj b/Source/BookGen.Contents/BookGen.Contents.csproj index 28bddcf7..451230e8 100644 --- a/Source/BookGen.Contents/BookGen.Contents.csproj +++ b/Source/BookGen.Contents/BookGen.Contents.csproj @@ -26,6 +26,24 @@ + + + PreserveNewest + + + PreserveNewest + + + + + + PreserveNewest + + + PreserveNewest + + + $([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)\..\..\Assets\BundledAssets')) diff --git a/Source/Bookgen.Lib/JsInterop/JavascriptBuilder.cs b/Source/Bookgen.Lib/JavascriptBuilder.cs similarity index 97% rename from Source/Bookgen.Lib/JsInterop/JavascriptBuilder.cs rename to Source/Bookgen.Lib/JavascriptBuilder.cs index 2863011b..c4a1cbc4 100644 --- a/Source/Bookgen.Lib/JsInterop/JavascriptBuilder.cs +++ b/Source/Bookgen.Lib/JavascriptBuilder.cs @@ -5,7 +5,7 @@ using System.Text; -namespace Bookgen.Lib.JsInterop; +namespace Bookgen.Lib; public sealed class JavascriptBuilder { diff --git a/Source/Bookgen.Lib/Markdown/RenderInterop/IRenderInterop.cs b/Source/Bookgen.Lib/Markdown/RenderInterop/IRenderInterop.cs new file mode 100644 index 00000000..fb54372d --- /dev/null +++ b/Source/Bookgen.Lib/Markdown/RenderInterop/IRenderInterop.cs @@ -0,0 +1,12 @@ +using Bookgen.Lib.Domain.IO.Configuration; +using Bookgen.Lib.ImageService; + +namespace Bookgen.Lib.Markdown.RenderInterop; + +internal interface IRenderInterop : IDisposable +{ + ImageResult RenderNomnoml(string nomnomlCode, ImageConfig imageConfig); + ImageResult RenderLatex(string latex, ImageConfig imageConfig); + ImageResult RenderQrCode(string url, ImageConfig imageConfig); + string PrismSyntaxHighlight(string code, string language); +} diff --git a/Source/Bookgen.Lib/Markdown/RenderInterop/JavascriptEngine.cs b/Source/Bookgen.Lib/Markdown/RenderInterop/JavascriptEngine.cs new file mode 100644 index 00000000..c87d7e1f --- /dev/null +++ b/Source/Bookgen.Lib/Markdown/RenderInterop/JavascriptEngine.cs @@ -0,0 +1,58 @@ +using System; +using System.Collections.Generic; +using System.Text; + +using Microsoft.ClearScript; +using Microsoft.ClearScript.JavaScript; +using Microsoft.ClearScript.V8; + +namespace Bookgen.Lib.Markdown.RenderInterop; + +internal sealed class JavascriptEngine : IDisposable +{ + private readonly V8ScriptEngine _engine; + private bool _disposed; + + public JavascriptEngine() + { + _engine = new V8ScriptEngine(); + } + + public void Dispose() + { + _engine.Dispose(); + _disposed = true; + } + + public dynamic Script => _engine.Script; + + public void Execute(string code) + { + ObjectDisposedException.ThrowIf(_disposed, nameof(_engine)); + + _engine.Execute(code); + } + + public object Evaluate(string code) + { + ObjectDisposedException.ThrowIf(_disposed, nameof(_engine)); + + return _engine.Evaluate(code); + } + + public string ExecuteAndGetResult(string code) + { + ObjectDisposedException.ThrowIf(_disposed, nameof(_engine)); + + object? result = _engine.Evaluate(code); + + if (result is ScriptObject) //if the result is a promise, we need to wait for it + { + var tsk = result.ToTask(); + result = tsk.GetAwaiter().GetResult(); + } + + return result as string + ?? throw new InvalidOperationException($"Expected result to be a string but was: {result.GetType()}"); + } +} diff --git a/Source/Bookgen.Lib/Markdown/RenderInterop/RenderInterop.cs b/Source/Bookgen.Lib/Markdown/RenderInterop/RenderInterop.cs new file mode 100644 index 00000000..ec10df98 --- /dev/null +++ b/Source/Bookgen.Lib/Markdown/RenderInterop/RenderInterop.cs @@ -0,0 +1,119 @@ +using System.Diagnostics; + +using Bookgen.Lib.Domain.IO.Configuration; +using Bookgen.Lib.ImageService; + +using BookGen.Vfs; + +using SkiaSharp; + +namespace Bookgen.Lib.Markdown.RenderInterop; + +internal sealed class RenderInterop : IRenderInterop +{ + private readonly IAssetSource _assetSource; + private readonly JavascriptEngine _javascriptEngine; + private readonly HashSet _loadedScripts; + private bool _disposed; + + public RenderInterop(IAssetSource assetSource) + { + _assetSource = assetSource; + _javascriptEngine = new JavascriptEngine(); + _loadedScripts = new HashSet(); + } + + public void Dispose() + { + _javascriptEngine.Dispose(); + _disposed = true; + } + + private void LoadScriptIfNotLoaded(string scriptFile) + { + if (_loadedScripts.Contains(scriptFile)) + { + return; + } + + string script = _assetSource.GetAsset(scriptFile); + _javascriptEngine.Execute(script); + _loadedScripts.Add(scriptFile); + } + + private static ImageType GetImateType(SvgRecodeOption recodeOption) + { + return recodeOption switch + { + SvgRecodeOption.AsPng => ImageType.Png, + SvgRecodeOption.AsWebp => ImageType.Webp, + SvgRecodeOption.Passtrough => ImageType.Svg, + _ => throw new UnreachableException(), + }; + } + + private static ImageResult EncodeSvg(string svgData, ImageConfig imageConfig) + { + if (imageConfig.SvgRecode == SvgRecodeOption.Passtrough) + { + return new ImageResult + { + Data = svgData, + ImageType = ImageType.Svg, + OriginalName = string.Empty, + }; + } + + + + using SKData rendered = ImageUtils.RenderSvg(svgData, + imageConfig.ResizeWith, + imageConfig.ResizeHeight, + imageConfig.SvgRecode); + + return new ImageResult + { + Data = Convert.ToBase64String(rendered.AsSpan()), + ImageType = GetImateType(imageConfig.SvgRecode), + OriginalName = string.Empty + }; + } + + + public string PrismSyntaxHighlight(string code, string language) + { + ObjectDisposedException.ThrowIf(_disposed, nameof(RenderInterop)); + LoadScriptIfNotLoaded(BundledAssets.PrismJs); + + _javascriptEngine.Script.code = code; + return _javascriptEngine.ExecuteAndGetResult($"Prism.highlight(code, Prism.languages.{language}, '{language}');"); + } + + public ImageResult RenderLatex(string latex, ImageConfig imageConfig) + { + ObjectDisposedException.ThrowIf(_disposed, nameof(RenderInterop)); + + throw new NotImplementedException(); + } + + public ImageResult RenderNomnoml(string nomnomlCode, ImageConfig imageConfig) + { + ObjectDisposedException.ThrowIf(_disposed, nameof(RenderInterop)); + LoadScriptIfNotLoaded(BundledAssets.GraphreJs); + LoadScriptIfNotLoaded(BundledAssets.NomnomlJs); + + _javascriptEngine.Script.nomnomlCode = nomnomlCode; + string svg = _javascriptEngine.ExecuteAndGetResult("nomnoml.renderSvg(nomnomlCode)"); + return EncodeSvg(svg, imageConfig); + } + + public ImageResult RenderQrCode(string url, ImageConfig imageConfig) + { + ObjectDisposedException.ThrowIf(_disposed, nameof(RenderInterop)); + LoadScriptIfNotLoaded(BundledAssets.QrCodeJs); + + string cmd = $"new QRCode({{content: \"{url}\", padding: 2, color: \"#000000\"}}).svg();"; + string svg = _javascriptEngine.ExecuteAndGetResult(cmd); + return EncodeSvg(svg, imageConfig); + } +} From 05014ebfa467a9f131abbe8857450bb2b1a124c8 Mon Sep 17 00:00:00 2001 From: webmaster442 Date: Mon, 25 May 2026 13:12:49 +0200 Subject: [PATCH 03/15] Work in progress process interop --- .../Markdown/RenderInterop/ProcessInterop.cs | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 Source/Bookgen.Lib/Markdown/RenderInterop/ProcessInterop.cs diff --git a/Source/Bookgen.Lib/Markdown/RenderInterop/ProcessInterop.cs b/Source/Bookgen.Lib/Markdown/RenderInterop/ProcessInterop.cs new file mode 100644 index 00000000..d858d240 --- /dev/null +++ b/Source/Bookgen.Lib/Markdown/RenderInterop/ProcessInterop.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Text; + +namespace Bookgen.Lib.Markdown.RenderInterop; + +internal static class ProcessInterop +{ + private static string GetBinary(string name) + { + return OperatingSystem.IsWindows() + ? Path.Combine(AppContext.BaseDirectory, $"{name}.exe") + : Path.Combine(AppContext.BaseDirectory, name); + } + + public static string RunRatex(string input) + { + throw new NotImplementedException(); + } +} From efc7750bf0da0c8fae26952b36db5c1179add401 Mon Sep 17 00:00:00 2001 From: webmaster442 Date: Sun, 31 May 2026 14:29:50 +0200 Subject: [PATCH 04/15] Work on new Interop System --- BookGen.slnx | 1 + .../RenderInterop/JavascriptEngine.cs | 8 +- .../Markdown/RenderInterop/ProcessInterop.cs | 28 ++++- download-assets.ps1 | 108 +++++++++++------- 4 files changed, 96 insertions(+), 49 deletions(-) diff --git a/BookGen.slnx b/BookGen.slnx index ffac8e30..9933f406 100644 --- a/BookGen.slnx +++ b/BookGen.slnx @@ -6,6 +6,7 @@ + diff --git a/Source/Bookgen.Lib/Markdown/RenderInterop/JavascriptEngine.cs b/Source/Bookgen.Lib/Markdown/RenderInterop/JavascriptEngine.cs index c87d7e1f..16d2a259 100644 --- a/Source/Bookgen.Lib/Markdown/RenderInterop/JavascriptEngine.cs +++ b/Source/Bookgen.Lib/Markdown/RenderInterop/JavascriptEngine.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; - -using Microsoft.ClearScript; +using Microsoft.ClearScript; using Microsoft.ClearScript.JavaScript; using Microsoft.ClearScript.V8; @@ -16,7 +12,7 @@ internal sealed class JavascriptEngine : IDisposable public JavascriptEngine() { _engine = new V8ScriptEngine(); - } + } public void Dispose() { diff --git a/Source/Bookgen.Lib/Markdown/RenderInterop/ProcessInterop.cs b/Source/Bookgen.Lib/Markdown/RenderInterop/ProcessInterop.cs index d858d240..a7cae370 100644 --- a/Source/Bookgen.Lib/Markdown/RenderInterop/ProcessInterop.cs +++ b/Source/Bookgen.Lib/Markdown/RenderInterop/ProcessInterop.cs @@ -16,6 +16,32 @@ private static string GetBinary(string name) public static string RunRatex(string input) { - throw new NotImplementedException(); + var process = new Process + { + StartInfo = new ProcessStartInfo + { + FileName = GetBinary("ratex-svg"), + Arguments = "--stdout", + RedirectStandardInput = true, + RedirectStandardOutput = true, + RedirectStandardError = true, + UseShellExecute = false, + CreateNoWindow = true + } + }; + + process.Start(); + process.StandardInput.Write(input); + process.StandardInput.Close(); + string outout = process.StandardOutput.ReadToEnd(); + + process.WaitForExit(); + + if (process.ExitCode != 0) + { + throw new InvalidOperationException($"Ratex process exited with code {process.ExitCode}"); + } + + return outout; } } diff --git a/download-assets.ps1 b/download-assets.ps1 index 2b7d257c..52de47d1 100644 --- a/download-assets.ps1 +++ b/download-assets.ps1 @@ -1,3 +1,57 @@ +param( + [Parameter(Position = 0)] + [ValidateSet('tools', 'dictionaries')] + [string]$Target +) + +function download-dictionaries { + Set-Location $dictionariesPath + curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/en/en_GB.aff" + curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/en/en_GB.dic" + curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/en/en_US.aff" + curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/en/en_US.dic" + curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/hu_HU/hu_HU.aff" + curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/hu_HU/hu_HU.dic" + curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/hr_HR/hr_HR.aff" + curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/hr_HR/hr_HR.dic" + curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/it_IT/it_IT.aff" + curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/it_IT/it_IT.dic" + curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/nl_NL/nl_NL.aff" + curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/nl_NL/nl_NL.dic" + curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/de/de_DE_frami.aff" + curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/de/de_DE_frami.dic" + curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/es/es_ES.aff" + curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/es/es_ES.dic" + Set-Location $startdir +} + +function download-tools { + Set-Location $toolsPath + curl.exe -L -O "https://github.com/erweixin/RaTeX/releases/download/v0.1.10/ratex-cli-v0.1.10-x86_64-pc-windows-msvc.zip" + curl.exe -L -O "https://github.com/erweixin/RaTeX/releases/download/v0.1.10/ratex-cli-v0.1.10-aarch64-unknown-linux-musl.tar.gz" + curl.exe -L -O "https://github.com/1jehuang/mermaid-rs-renderer/releases/download/v0.2.2/mmdr-x86_64-pc-windows-msvc.zip" + curl.exe -L -O "https://github.com/1jehuang/mermaid-rs-renderer/releases/download/v0.2.2/mmdr-x86_64-unknown-linux-gnu.tar.gz" + + # mmdr + Expand-Archive .\mmdr-x86_64-pc-windows-msvc.zip -Force -DestinationPath . + Remove-Item .\mmdr-x86_64-pc-windows-msvc.zip + tar -xzf .\mmdr-x86_64-unknown-linux-gnu.tar.gz -C . + Remove-Item .\mmdr-x86_64-unknown-linux-gnu.tar.gz + + # RaTeX + Expand-Archive .\ratex-cli-v0.1.10-x86_64-pc-windows-msvc.zip -Force -DestinationPath . + Move-Item -Force .\ratex-cli-v0.1.10-x86_64-pc-windows-msvc\render-svg.exe .\ratex-svg.exe + Remove-Item .\ratex-cli-v0.1.10-x86_64-pc-windows-msvc.zip + Remove-Item .\ratex-cli-v0.1.10-x86_64-pc-windows-msvc -Recurse -Force + + tar -xzf .\ratex-cli-v0.1.10-aarch64-unknown-linux-musl.tar.gz -C . + Move-Item -Force .\ratex-cli-v0.1.10-aarch64-unknown-linux-musl\render-svg .\ratex-svg + Remove-Item .\ratex-cli-v0.1.10-aarch64-unknown-linux-musl.tar.gz + Remove-Item .\ratex-cli-v0.1.10-aarch64-unknown-linux-musl -Recurse -Force + + Set-Location $startdir +} + $startdir = Get-Location $dictionariesPath = ".\Assets\dictionaries" $toolsPath = ".\Assets\tools" @@ -10,45 +64,15 @@ if (-not (Test-Path $toolsPath)) { New-Item -ItemType Directory -Path $toolsPath | Out-Null } -Set-Location $dictionariesPath -curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/en/en_GB.aff" -curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/en/en_GB.dic" -curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/en/en_US.aff" -curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/en/en_US.dic" -curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/hu_HU/hu_HU.aff" -curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/hu_HU/hu_HU.dic" -curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/hr_HR/hr_HR.aff" -curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/hr_HR/hr_HR.dic" -curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/it_IT/it_IT.aff" -curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/it_IT/it_IT.dic" -curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/nl_NL/nl_NL.aff" -curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/nl_NL/nl_NL.dic" -curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/de/de_DE_frami.aff" -curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/de/de_DE_frami.dic" -curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/es/es_ES.aff" -curl.exe -L -O "https://github.com/LibreOffice/dictionaries/blob/master/es/es_ES.dic" -Set-Location $startdir - -Set-Location $toolsPath -curl.exe -L -O "https://github.com/erweixin/RaTeX/releases/download/v0.1.9/ratex-cli-v0.1.9-x86_64-pc-windows-msvc.zip" -curl.exe -L -O "https://github.com/erweixin/RaTeX/releases/download/v0.1.9/ratex-cli-v0.1.9-x86_64-unknown-linux-musl.tar.gz" -curl.exe -L -O "https://github.com/1jehuang/mermaid-rs-renderer/releases/download/v0.2.2/mmdr-x86_64-pc-windows-msvc.zip" -curl.exe -L -O "https://github.com/1jehuang/mermaid-rs-renderer/releases/download/v0.2.2/mmdr-x86_64-unknown-linux-gnu.tar.gz" - -Expand-Archive .\mmdr-x86_64-pc-windows-msvc.zip -DestinationPath . -Remove-Item .\mmdr-x86_64-pc-windows-msvc.zip - -tar -xzf .\mmdr-x86_64-unknown-linux-gnu.tar.gz -C . -Remove-Item .\mmdr-x86_64-unknown-linux-gnu.tar.gz - -Expand-Archive .\ratex-cli-v0.1.9-x86_64-pc-windows-msvc.zip -DestinationPath . -Move-Item .\ratex-cli-v0.1.9-x86_64-pc-windows-msvc\render-svg.exe .\ratex-svg.exe -Remove-Item .\ratex-cli-v0.1.9-x86_64-pc-windows-msvc.zip -Remove-Item .\ratex-cli-v0.1.9-x86_64-pc-windows-msvc -Recurse -Force - -tar -xzf .\ratex-cli-v0.1.9-x86_64-unknown-linux-musl.tar.gz -C . -Move-Item .\ratex-cli-v0.1.9-x86_64-unknown-linux-musl\render-svg .\ratex-svg -Remove-Item .\ratex-cli-v0.1.9-x86_64-unknown-linux-musl.tar.gz -Remove-Item .\ratex-cli-v0.1.9-x86_64-unknown-linux-musl -Recurse -Force - -Set-Location $startdir \ No newline at end of file +# Main execution logic +if ([string]::IsNullOrEmpty($Target)) { + # No arguments - run both functions + download-dictionaries + download-tools +} +elseif ($Target -eq 'tools') { + download-tools +} +elseif ($Target -eq 'dictionaries') { + download-dictionaries +} From c91a4783feee9434e0e83a1eb05e759540b78612 Mon Sep 17 00:00:00 2001 From: webmaster442 Date: Sun, 31 May 2026 19:55:35 +0200 Subject: [PATCH 05/15] Work on render interop --- .gitattributes | 4 +- .github/workflows/dotnet.yml | 7 ++ .../Markdown/RenderInterop/ProcessInterop.cs | 14 +--- .../Markdown/RenderInterop/RenderInterop.cs | 3 +- Test/Bookgen.Tests/Lib/UT_RenderInterop.cs | 76 +++++++++++++++++++ download-assets-pipeline.sh | 6 ++ 6 files changed, 98 insertions(+), 12 deletions(-) create mode 100644 Test/Bookgen.Tests/Lib/UT_RenderInterop.cs create mode 100644 download-assets-pipeline.sh diff --git a/.gitattributes b/.gitattributes index 82318a9a..dcfe9ac2 100644 --- a/.gitattributes +++ b/.gitattributes @@ -11,6 +11,9 @@ Assets/BundledAssets/* linguist-vendored Assets/dictionaries/* linguist-vendored +# Line endings +*.sh text eol=lf +*.sln text eol=crlf # # The above will handle all files NOT found below # @@ -18,7 +21,6 @@ Assets/dictionaries/* linguist-vendored *.cs text diff=csharp *.cshtml text diff=html *.csx text diff=csharp -*.sln text eol=crlf # Content below from: https://github.com/gitattributes/gitattributes/blob/master/Common.gitattributes diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 0f4cf8e1..ddea7512 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -7,6 +7,7 @@ on: branches: [ master ] jobs: + build: runs-on: ubuntu-latest @@ -23,9 +24,15 @@ jobs: dotnet-version: 10.0.x dotnet-quality: 'ga' #dotnet-quality: 'preview' + + - name: get render dependencies + run: download-assets-pipeline.sh + - name: Restore dependencies run: dotnet restore + - name: Build run: dotnet build --no-restore + - name: Test run: dotnet test --no-build --verbosity normal diff --git a/Source/Bookgen.Lib/Markdown/RenderInterop/ProcessInterop.cs b/Source/Bookgen.Lib/Markdown/RenderInterop/ProcessInterop.cs index a7cae370..0932ab3a 100644 --- a/Source/Bookgen.Lib/Markdown/RenderInterop/ProcessInterop.cs +++ b/Source/Bookgen.Lib/Markdown/RenderInterop/ProcessInterop.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Text; +using System.Diagnostics; namespace Bookgen.Lib.Markdown.RenderInterop; @@ -37,11 +34,8 @@ public static string RunRatex(string input) process.WaitForExit(); - if (process.ExitCode != 0) - { - throw new InvalidOperationException($"Ratex process exited with code {process.ExitCode}"); - } - - return outout; + return process.ExitCode != 0 + ? throw new InvalidOperationException($"Ratex process exited with code {process.ExitCode}") + : outout; } } diff --git a/Source/Bookgen.Lib/Markdown/RenderInterop/RenderInterop.cs b/Source/Bookgen.Lib/Markdown/RenderInterop/RenderInterop.cs index ec10df98..3db33b48 100644 --- a/Source/Bookgen.Lib/Markdown/RenderInterop/RenderInterop.cs +++ b/Source/Bookgen.Lib/Markdown/RenderInterop/RenderInterop.cs @@ -93,7 +93,8 @@ public ImageResult RenderLatex(string latex, ImageConfig imageConfig) { ObjectDisposedException.ThrowIf(_disposed, nameof(RenderInterop)); - throw new NotImplementedException(); + return EncodeSvg(ProcessInterop.RunRatex(latex), imageConfig); + } public ImageResult RenderNomnoml(string nomnomlCode, ImageConfig imageConfig) diff --git a/Test/Bookgen.Tests/Lib/UT_RenderInterop.cs b/Test/Bookgen.Tests/Lib/UT_RenderInterop.cs new file mode 100644 index 00000000..2c82de96 --- /dev/null +++ b/Test/Bookgen.Tests/Lib/UT_RenderInterop.cs @@ -0,0 +1,76 @@ +using Bookgen.Lib.Domain.IO.Configuration; +using Bookgen.Lib.ImageService; +using Bookgen.Lib.Markdown.RenderInterop; + +namespace Bookgen.Tests.Lib; + +[TestFixture] +internal class UT_RenderInterop +{ + private RenderInterop _sut; + private ImageConfig _config; + private TestEnvironment _environment; + + [SetUp] + public void Setup() + { + _environment = new TestEnvironment(); + _config = new ImageConfig + { + SvgRecode = SvgRecodeOption.Passtrough, + }; + _sut = new RenderInterop(_environment); + } + + [TearDown] + public void TearDown() + { + _sut.Dispose(); + _environment.Dispose(); + } + + [Test] + public void EnsureThat_RenderLatex_ReturnsCorrectSvg() + { + ImageResult svg = _sut.RenderLatex("\\frac{1}{2} + \\sqrt{x}", _config); + + using (Assert.EnterMultipleScope()) + { + Assert.That(svg.ImageType, Is.EqualTo(ImageType.Svg)); + Assert.That(svg.Data, Does.StartWith("\n")); + } + } + + [Test] + public void EnsureThat_Render_Nomnoml_ReturnsCorrectSvg() + { + ImageResult svg = _sut.RenderNomnoml("[Test]", _config); + using (Assert.EnterMultipleScope()) + { + Assert.That(svg.ImageType, Is.EqualTo(ImageType.Svg)); + Assert.That(svg.Data, Does.StartWith("")); + } + } + + [Test] + public void EnsureThat_RenderQrCode_ReturnsCorrectSvg() + { + ImageResult svg = _sut.RenderQrCode("https://example.com", _config); + + using (Assert.EnterMultipleScope()) + { + Assert.That(svg.ImageType, Is.EqualTo(ImageType.Svg)); + Assert.That(svg.Data, Does.EndWith("")); + } + } + + [Test] + public void EnsureThat_PrisimSyntaxHighlight_ReturnsCorrectHtml() + { + string html = _sut.PrismSyntaxHighlight("Console.WriteLine(\"Hello, World!\");", "csharp"); + string expected = "Console.WriteLine(\"Hello, World!\");"; + Assert.That(html, Is.EqualTo(expected)); + } +} diff --git a/download-assets-pipeline.sh b/download-assets-pipeline.sh new file mode 100644 index 00000000..65820d1e --- /dev/null +++ b/download-assets-pipeline.sh @@ -0,0 +1,6 @@ +#!/bin/sh +mkdir -p "./Assets\tools" +cd "./Assets/tools" +curl.exe -L -O "https://github.com/erweixin/RaTeX/releases/download/v0.1.10/ratex-cli-v0.1.10-aarch64-unknown-linux-musl.tar.gz" +tar -xzf ./ratex-cli-v0.1.10-aarch64-unknown-linux-musl.tar.gz -C +mv ./ratex-cli-v0.1.10-aarch64-unknown-linux-musl/render-svg ./ratex-svg \ No newline at end of file From 517aee488edb1f694750aed6a710481c93d48578 Mon Sep 17 00:00:00 2001 From: webmaster442 Date: Sun, 31 May 2026 19:57:26 +0200 Subject: [PATCH 06/15] Pipeline fix --- .github/workflows/dotnet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index ddea7512..75faaaa5 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -26,7 +26,7 @@ jobs: #dotnet-quality: 'preview' - name: get render dependencies - run: download-assets-pipeline.sh + run: ./download-assets-pipeline.sh - name: Restore dependencies run: dotnet restore From c81e23faf9d132770181df931295934755b8bb18 Mon Sep 17 00:00:00 2001 From: webmaster442 Date: Sun, 31 May 2026 19:57:26 +0200 Subject: [PATCH 07/15] Pipeline fix --- .github/workflows/dotnet.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index ddea7512..acb0d6c3 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -26,7 +26,7 @@ jobs: #dotnet-quality: 'preview' - name: get render dependencies - run: download-assets-pipeline.sh + run: sh ./download-assets-pipeline.sh - name: Restore dependencies run: dotnet restore From 800687332fa4d49945ae4df2a4dadc2110872851 Mon Sep 17 00:00:00 2001 From: webmaster442 Date: Sun, 31 May 2026 20:03:46 +0200 Subject: [PATCH 08/15] Pipeline upgrade --- BookGen.slnx | 1 + download-assets-pipeline.sh | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/BookGen.slnx b/BookGen.slnx index 9933f406..620677c2 100644 --- a/BookGen.slnx +++ b/BookGen.slnx @@ -6,6 +6,7 @@ + diff --git a/download-assets-pipeline.sh b/download-assets-pipeline.sh index 65820d1e..90330292 100644 --- a/download-assets-pipeline.sh +++ b/download-assets-pipeline.sh @@ -1,6 +1,6 @@ #!/bin/sh -mkdir -p "./Assets\tools" +mkdir -p "./Assets/tools" cd "./Assets/tools" -curl.exe -L -O "https://github.com/erweixin/RaTeX/releases/download/v0.1.10/ratex-cli-v0.1.10-aarch64-unknown-linux-musl.tar.gz" -tar -xzf ./ratex-cli-v0.1.10-aarch64-unknown-linux-musl.tar.gz -C +curl -L -O "https://github.com/erweixin/RaTeX/releases/download/v0.1.10/ratex-cli-v0.1.10-aarch64-unknown-linux-musl.tar.gz" +tar -xzf ./ratex-cli-v0.1.10-aarch64-unknown-linux-musl.tar.gz -C . mv ./ratex-cli-v0.1.10-aarch64-unknown-linux-musl/render-svg ./ratex-svg \ No newline at end of file From 4b3182eb3002c8b8ed8a7d0e014d237294882abb Mon Sep 17 00:00:00 2001 From: webmaster442 Date: Sun, 31 May 2026 20:07:14 +0200 Subject: [PATCH 09/15] MMDR fix for pipeline --- download-assets-pipeline.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/download-assets-pipeline.sh b/download-assets-pipeline.sh index 90330292..71f0f73a 100644 --- a/download-assets-pipeline.sh +++ b/download-assets-pipeline.sh @@ -1,6 +1,10 @@ #!/bin/sh mkdir -p "./Assets/tools" cd "./Assets/tools" + curl -L -O "https://github.com/erweixin/RaTeX/releases/download/v0.1.10/ratex-cli-v0.1.10-aarch64-unknown-linux-musl.tar.gz" tar -xzf ./ratex-cli-v0.1.10-aarch64-unknown-linux-musl.tar.gz -C . -mv ./ratex-cli-v0.1.10-aarch64-unknown-linux-musl/render-svg ./ratex-svg \ No newline at end of file +mv ./ratex-cli-v0.1.10-aarch64-unknown-linux-musl/render-svg ./ratex-svg + +curl -L -O "https://github.com/1jehuang/mermaid-rs-renderer/releases/download/v0.2.2/mmdr-x86_64-unknown-linux-gnu.tar.gz" +tar -xzf .\mmdr-x86_64-unknown-linux-gnu.tar.gz -C . From cf8996e725567c194ffffeabb6133b6484850a19 Mon Sep 17 00:00:00 2001 From: webmaster442 Date: Sun, 31 May 2026 20:08:45 +0200 Subject: [PATCH 10/15] mmdr fix --- download-assets-pipeline.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/download-assets-pipeline.sh b/download-assets-pipeline.sh index 71f0f73a..7c2ebb15 100644 --- a/download-assets-pipeline.sh +++ b/download-assets-pipeline.sh @@ -7,4 +7,4 @@ tar -xzf ./ratex-cli-v0.1.10-aarch64-unknown-linux-musl.tar.gz -C . mv ./ratex-cli-v0.1.10-aarch64-unknown-linux-musl/render-svg ./ratex-svg curl -L -O "https://github.com/1jehuang/mermaid-rs-renderer/releases/download/v0.2.2/mmdr-x86_64-unknown-linux-gnu.tar.gz" -tar -xzf .\mmdr-x86_64-unknown-linux-gnu.tar.gz -C . +tar -xzf ./mmdr-x86_64-unknown-linux-gnu.tar.gz -C . From 686ca84a424c35e2823e8fae9079c30941e657ff Mon Sep 17 00:00:00 2001 From: webmaster442 Date: Mon, 1 Jun 2026 18:28:46 +0200 Subject: [PATCH 11/15] Pipeline fixes --- download-assets-pipeline.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/download-assets-pipeline.sh b/download-assets-pipeline.sh index 7c2ebb15..6a558894 100644 --- a/download-assets-pipeline.sh +++ b/download-assets-pipeline.sh @@ -1,5 +1,6 @@ #!/bin/sh mkdir -p "./Assets/tools" +mkdir -p "./Assets/dictionaries" cd "./Assets/tools" curl -L -O "https://github.com/erweixin/RaTeX/releases/download/v0.1.10/ratex-cli-v0.1.10-aarch64-unknown-linux-musl.tar.gz" From b6f0fd45810934ffc96e633960278c5a9f77c37f Mon Sep 17 00:00:00 2001 From: webmaster442 Date: Mon, 1 Jun 2026 18:32:57 +0200 Subject: [PATCH 12/15] Codeql adjust --- .github/workflows/codeql.yml | 10 +++++----- download-assets-pipeline.sh | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 595999e2..6aaa50ce 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -67,8 +67,8 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java). # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v4 + # - name: Autobuild + # uses: github/codeql-action/autobuild@v4 # ℹ️ Command-line programs to run using the OS shell. # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun @@ -76,9 +76,9 @@ jobs: # If the Autobuild fails above, remove it and uncomment the following three lines. # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. - # - run: | - # echo "Run, Build Application using script" - # ./location_of_script_within_repo/buildscript.sh + - run: | + sh ./download-assets-pipeline.sh + dotnet build - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v4 diff --git a/download-assets-pipeline.sh b/download-assets-pipeline.sh index 6a558894..72d9ae96 100644 --- a/download-assets-pipeline.sh +++ b/download-assets-pipeline.sh @@ -1,6 +1,7 @@ #!/bin/sh mkdir -p "./Assets/tools" mkdir -p "./Assets/dictionaries" +touch "./Assets/dictionaries/keep.file" cd "./Assets/tools" curl -L -O "https://github.com/erweixin/RaTeX/releases/download/v0.1.10/ratex-cli-v0.1.10-aarch64-unknown-linux-musl.tar.gz" From d6cbd1b5e5d1f220c487cbb425e58dd32775142f Mon Sep 17 00:00:00 2001 From: webmaster442 Date: Mon, 1 Jun 2026 18:41:21 +0200 Subject: [PATCH 13/15] Test: restrict to x64 when it makes sense --- Test/Bookgen.Tests/Lib/UT_RenderInterop.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Test/Bookgen.Tests/Lib/UT_RenderInterop.cs b/Test/Bookgen.Tests/Lib/UT_RenderInterop.cs index 2c82de96..a75f46dc 100644 --- a/Test/Bookgen.Tests/Lib/UT_RenderInterop.cs +++ b/Test/Bookgen.Tests/Lib/UT_RenderInterop.cs @@ -1,4 +1,6 @@ -using Bookgen.Lib.Domain.IO.Configuration; +using System.Runtime.InteropServices; + +using Bookgen.Lib.Domain.IO.Configuration; using Bookgen.Lib.ImageService; using Bookgen.Lib.Markdown.RenderInterop; @@ -32,6 +34,11 @@ public void TearDown() [Test] public void EnsureThat_RenderLatex_ReturnsCorrectSvg() { + if (RuntimeInformation.ProcessArchitecture != Architecture.X64) + { + Assert.Ignore("Test only runs on x64."); + } + ImageResult svg = _sut.RenderLatex("\\frac{1}{2} + \\sqrt{x}", _config); using (Assert.EnterMultipleScope()) From 686b17ebbe9e47b8cb52ec07aa0b74671241d7e6 Mon Sep 17 00:00:00 2001 From: webmaster442 Date: Mon, 1 Jun 2026 18:58:22 +0200 Subject: [PATCH 14/15] Execute bit set for running Ratex --- .github/workflows/codeql.yml | 4 ++-- .../Markdown/RenderInterop/ProcessInterop.cs | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 6aaa50ce..24ad8d8a 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -77,8 +77,8 @@ jobs: # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. - run: | - sh ./download-assets-pipeline.sh - dotnet build + sh ./download-assets-pipeline.sh + dotnet build - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v4 diff --git a/Source/Bookgen.Lib/Markdown/RenderInterop/ProcessInterop.cs b/Source/Bookgen.Lib/Markdown/RenderInterop/ProcessInterop.cs index 0932ab3a..a9a37aaa 100644 --- a/Source/Bookgen.Lib/Markdown/RenderInterop/ProcessInterop.cs +++ b/Source/Bookgen.Lib/Markdown/RenderInterop/ProcessInterop.cs @@ -13,11 +13,24 @@ private static string GetBinary(string name) public static string RunRatex(string input) { + var binary = GetBinary("ratex-svg"); + + if (OperatingSystem.IsLinux() + || OperatingSystem.IsMacOS()) + { + UnixFileMode permissions = File.GetUnixFileMode(binary); + if (!permissions.HasFlag(UnixFileMode.UserExecute)) + { + permissions |= UnixFileMode.UserExecute; + File.SetUnixFileMode(binary, permissions); + } + } + var process = new Process { StartInfo = new ProcessStartInfo { - FileName = GetBinary("ratex-svg"), + FileName = binary, Arguments = "--stdout", RedirectStandardInput = true, RedirectStandardOutput = true, From 067b29b1287c9ab9add7d2eb0f44ca6f9aa76141 Mon Sep 17 00:00:00 2001 From: webmaster442 Date: Mon, 1 Jun 2026 19:14:16 +0200 Subject: [PATCH 15/15] Update ratex --- download-assets-pipeline.sh | 6 +++--- download-assets.ps1 | 32 ++++++++++++++++---------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/download-assets-pipeline.sh b/download-assets-pipeline.sh index 72d9ae96..e04a5d80 100644 --- a/download-assets-pipeline.sh +++ b/download-assets-pipeline.sh @@ -4,9 +4,9 @@ mkdir -p "./Assets/dictionaries" touch "./Assets/dictionaries/keep.file" cd "./Assets/tools" -curl -L -O "https://github.com/erweixin/RaTeX/releases/download/v0.1.10/ratex-cli-v0.1.10-aarch64-unknown-linux-musl.tar.gz" -tar -xzf ./ratex-cli-v0.1.10-aarch64-unknown-linux-musl.tar.gz -C . -mv ./ratex-cli-v0.1.10-aarch64-unknown-linux-musl/render-svg ./ratex-svg +curl -L -O "https://github.com/erweixin/RaTeX/releases/download/v0.1.11/ratex-cli-v0.1.11-x86_64-unknown-linux-musl.tar.gz" +tar -xzf ./ratex-cli-v0.1.11-x86_64-unknown-linux-musl.tar.gz -C . +mv ./ratex-cli-v0.1.11-x86_64-unknown-linux-musl/render-svg ./ratex-svg curl -L -O "https://github.com/1jehuang/mermaid-rs-renderer/releases/download/v0.2.2/mmdr-x86_64-unknown-linux-gnu.tar.gz" tar -xzf ./mmdr-x86_64-unknown-linux-gnu.tar.gz -C . diff --git a/download-assets.ps1 b/download-assets.ps1 index 52de47d1..7abbfaa2 100644 --- a/download-assets.ps1 +++ b/download-assets.ps1 @@ -27,27 +27,27 @@ function download-dictionaries { function download-tools { Set-Location $toolsPath - curl.exe -L -O "https://github.com/erweixin/RaTeX/releases/download/v0.1.10/ratex-cli-v0.1.10-x86_64-pc-windows-msvc.zip" - curl.exe -L -O "https://github.com/erweixin/RaTeX/releases/download/v0.1.10/ratex-cli-v0.1.10-aarch64-unknown-linux-musl.tar.gz" - curl.exe -L -O "https://github.com/1jehuang/mermaid-rs-renderer/releases/download/v0.2.2/mmdr-x86_64-pc-windows-msvc.zip" - curl.exe -L -O "https://github.com/1jehuang/mermaid-rs-renderer/releases/download/v0.2.2/mmdr-x86_64-unknown-linux-gnu.tar.gz" + curl.exe -L "https://github.com/erweixin/RaTeX/releases/download/v0.1.11/ratex-cli-v0.1.11-x86_64-pc-windows-msvc.zip" -o ratex-windows.zip + curl.exe -L "https://github.com/erweixin/RaTeX/releases/download/v0.1.11/ratex-cli-v0.1.11-x86_64-unknown-linux-musl.tar.gz" -o ratex-linux.tar.gz + curl.exe -L "https://github.com/1jehuang/mermaid-rs-renderer/releases/download/v0.2.2/mmdr-x86_64-pc-windows-msvc.zip" -o mmdr-windows.zip + curl.exe -L "https://github.com/1jehuang/mermaid-rs-renderer/releases/download/v0.2.2/mmdr-x86_64-unknown-linux-gnu.tar.gz" -o mmdr-linux.tar.gz # mmdr - Expand-Archive .\mmdr-x86_64-pc-windows-msvc.zip -Force -DestinationPath . - Remove-Item .\mmdr-x86_64-pc-windows-msvc.zip - tar -xzf .\mmdr-x86_64-unknown-linux-gnu.tar.gz -C . - Remove-Item .\mmdr-x86_64-unknown-linux-gnu.tar.gz + Expand-Archive .\mmdr-windows.zip -Force -DestinationPath . + Remove-Item .\mmdr-windows.zip + tar -xzf .\mmdr-linux.tar.gz -C . + Remove-Item .\mmdr-linux.tar.gz # RaTeX - Expand-Archive .\ratex-cli-v0.1.10-x86_64-pc-windows-msvc.zip -Force -DestinationPath . - Move-Item -Force .\ratex-cli-v0.1.10-x86_64-pc-windows-msvc\render-svg.exe .\ratex-svg.exe - Remove-Item .\ratex-cli-v0.1.10-x86_64-pc-windows-msvc.zip - Remove-Item .\ratex-cli-v0.1.10-x86_64-pc-windows-msvc -Recurse -Force + Expand-Archive .\ratex-windows.zip -Force -DestinationPath . + Move-Item -Force .\ratex-cli-v0.1.11-x86_64-pc-windows-msvc\render-svg.exe .\ratex-svg.exe + Remove-Item .\ratex-windows.zip + Remove-Item .\ratex-cli-v0.1.11-x86_64-pc-windows-msvc -Recurse -Force - tar -xzf .\ratex-cli-v0.1.10-aarch64-unknown-linux-musl.tar.gz -C . - Move-Item -Force .\ratex-cli-v0.1.10-aarch64-unknown-linux-musl\render-svg .\ratex-svg - Remove-Item .\ratex-cli-v0.1.10-aarch64-unknown-linux-musl.tar.gz - Remove-Item .\ratex-cli-v0.1.10-aarch64-unknown-linux-musl -Recurse -Force + tar -xzf .\ratex-linux.tar.gz -C . + Move-Item -Force .\ratex-cli-v0.1.11-x86_64-unknown-linux-musl\render-svg .\ratex-svg + Remove-Item .\ratex-linux.tar.gz + Remove-Item .\ratex-cli-v0.1.11-x86_64-unknown-linux-musl -Recurse -Force Set-Location $startdir }