Skip to content

Commit

Permalink
add --tx flag, add credits section
Browse files Browse the repository at this point in the history
  • Loading branch information
gernotstarke committed Dec 16, 2024
1 parent 4cc0c0e commit 2ec2d94
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 6 deletions.
3 changes: 3 additions & 0 deletions docs/_data/navigation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,7 @@ main:
blank: false
- title: "Examples"
url: /#examples
blank: false
- title: "Credits"
url: /#credits
blank: false
37 changes: 31 additions & 6 deletions docs/_pages/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` |


<h2>Multi-Language Support</h2>
Expand Down Expand Up @@ -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...
```


Expand All @@ -282,3 +291,19 @@ pdfminion --force --source ./input --target ./output

</section>


<br>
<hr class="section-sep">
<br>
<section id="examples" markdown="1">
<h1>Credits</h1>

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).
</section>
39 changes: 39 additions & 0 deletions documentation/init-sequence.puml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 2ec2d94

Please sign in to comment.