From 2ec2d941c2c8fcedb19ea449794e45e5bc73fa77 Mon Sep 17 00:00:00 2001 From: "Dr. Gernot Starke" Date: Mon, 16 Dec 2024 17:05:06 +0100 Subject: [PATCH] add --tx flag, add credits section --- docs/_data/navigation.yml | 3 +++ docs/_pages/index.md | 37 +++++++++++++++++++++++++----- documentation/init-sequence.puml | 39 ++++++++++++++++++++++++++++++++ 3 files changed, 73 insertions(+), 6 deletions(-) create mode 100644 documentation/init-sequence.puml diff --git a/docs/_data/navigation.yml b/docs/_data/navigation.yml index abd8c0f..6bf082e 100644 --- a/docs/_data/navigation.yml +++ b/docs/_data/navigation.yml @@ -11,4 +11,7 @@ main: blank: false - title: "Examples" url: /#examples + blank: false + - title: "Credits" + url: /#credits blank: false \ No newline at end of file diff --git a/docs/_pages/index.md b/docs/_pages/index.md index ed91891..6ee82ad 100644 --- a/docs/_pages/index.md +++ b/docs/_pages/index.md @@ -218,10 +218,11 @@ Set the running head, the page- and chapter prefix etc. | **Name** | **Long Command** | **Short Command** | **Description** | |-----------|-------------------|-------------------|-----------------| -| **Help** | `--help` | `-h`, `-?`, `?`| Displays a list of supported commands and their usage. Example: `pdfminion --help`| -| **Version** | `--version` | `-v` | Displays the current version of PDFminion. Example: `pdfminion --version` | -| **Defaults** | `--defaults` | | Prints all current default settings. Example: `pdfminion --defaults`. | -| **Debug Mode** | `--debug` | | Enables debug mode for detailed logs. Example: `pdfminion --debug` | +| **Help** | `--help` | `-h`, `-?`, `?`| Displays a list of supported commands and their usage. Example: `pdfminion --help`| +| **Version** | `--version` | `-v` | Displays the current version of PDFminion. Example: `pdfminion --version` | +| **Thanx** | `--thanx` | `-tx` | Gives credit to the maintainers of several OS libraries. Example: `pdfminion --thanx`. | +| **Defaults** | `--defaults` | | Prints all current default settings. Example: `pdfminion --defaults`. | +| **Debug Mode** | `--debug` | | Enables debug mode for detailed logs. Example: `pdfminion --debug` |

Multi-Language Support

@@ -267,13 +268,21 @@ After all files have been processed, you may merge them or create a table-of-con > **Example 1**: Add page numbers and running headers to all PDF files in the `input` directory and save the processed files in the `output` directory. Requires the `output` to be empty! ```shell -pdfminion --source ./input --target ./output +$ pdfminion --source ./input --target ./output ``` > **Example 2**: Force overwrite of existing files in the `output` directory ```shell -pdfminion --force --source ./input --target ./output +$ pdfminion --force --source ./input --target ./output +``` + +> **Example 41**: Gives credit to the maintainers of the open-source libraries used by PDFminion, e.g. [pdfcpu](https://pdfcpu.io/) and a few others.. + +```shell +$ pdfminion --thanx + +PDFminion was created on the shoulder of giants... ``` @@ -282,3 +291,19 @@ pdfminion --force --source ./input --target ./output + +
+
+
+
+

Credits

+ +PDFminion uses numerous open-source libraries, and wish to thank the maintainers of the following projects: + + +* Horst Rutter for [pdfcpu](https://pdfcpu.io/), all things related to PDF processing. +* Hao Ding for [go-locale](https://github.com/Xuanwo/go-locale) to handle tricky locale settings. + +* and, of course, the [Go team](https://golang.org/) for creating the language that compiles to various operating systems, + and refrains from adding fancy features every 6 month (pun intended). +
\ No newline at end of file diff --git a/documentation/init-sequence.puml b/documentation/init-sequence.puml new file mode 100644 index 0000000..10ae0d4 --- /dev/null +++ b/documentation/init-sequence.puml @@ -0,0 +1,39 @@ +@startuml +actor User as user +participant main +participant config +participant domain +participant "github.com/spf13/viper" as viper +participant "github.com/spf13/cobra" as cobra +participant "golang.org/x/text/language" as language + +user -> main : Execute application +main -> config : LoadConfig() +activate config + +config -> domain : InitializeDefaults() +activate domain +domain --> config : Return default MinionConfig +deactivate domain + +config -> cobra : Parse CLI flags (--file, --source, --language, etc.) +activate cobra +cobra --> config : CLI flag values +deactivate cobra + +config -> config : Determine config file path\n(either --file or pdfminion.cfg) +config -> viper : Read config file +activate viper +viper --> config : Parsed config values +deactivate viper + +config -> language : Parse language tag (if applicable) +activate language +language --> config : Parsed language.Tag +deactivate language + +config --> main : Final merged MinionConfig +deactivate config + +main -> domain : Use MinionConfig for application logic +@enduml