pkg.tk-software.de/gotice@v0.4.1-0.20240224130243-6adec687b106/README.md (about)

     1  # gotice - go notice
     2  Go copyright notice generator.
     3  
     4  Gotice generates a third-party copyright notice file based on the go modules in the `go.mod` file of a project.
     5  
     6  Use `gotice help` for further information.
     7  
     8  ## Installation/Start
     9  
    10  ### go install
    11  
    12  ```
    13  > go install pkg.tk-software.de/gotice@latest
    14  > gotice version
    15  ```
    16  
    17  ### go run
    18  
    19  ```
    20  > go run pkg.tk-software.de/gotice@latest version
    21  ```
    22  
    23  ### Releases
    24  Releases are available here: https://gitlab.com/tobiaskoch/gotice/-/releases
    25  
    26  ## Usage
    27  
    28  ### Initialization
    29  ```
    30  gotice init
    31  ```
    32  
    33  Gotice will create a `.gotice.json` file with default values in the current working directory.
    34  
    35  ### Generation
    36  ```
    37  > gotice generate ./project1 ./project1/dist/NOTICE.txt
    38  ```
    39  
    40  Gotice will generate the file `./project1/dist/NOTICE.txt` bases on the `go.mod` file in the directory `./project1`.
    41  If there is a `.gotice.json` configuration file in the `./project1` directory it will be used.
    42  
    43  ## Configuration
    44  
    45  **.gotice.json**
    46  
    47  ```
    48  {
    49      "template":"built-in:txt",
    50      "rendering":"text"
    51  }
    52  ```
    53  
    54  ### template
    55  The template that shall be used for the generation of the notice file.
    56  Supported values:
    57  
    58  - **built-in:txt**: the build-in text template (default)
    59  - **built-in:md**: the build-in markdown template
    60  - **built-in:html:** the built-in html template
    61  - **custom filename:** if a custom filename is provided gotice will try to locate the file in the project directory; relative paths are supported
    62  
    63  #### Example
    64  The following example shows a custom gotice template file:
    65  
    66  ```
    67  NOTICES AND INFORMATION
    68  
    69  This software incorporates material from third parties listed below.
    70  
    71  {{range .}}-------------------------------------------------------------------
    72  {{ .Path }} {{ .Version}}
    73  
    74  {{ .LicenseText}}
    75  
    76  -------------------------------------------------------------------
    77  {{end}}
    78  ```
    79  
    80  ### rendering
    81  The rendering engine that shall be used to render the template file.
    82  Supported values:
    83  
    84  - **text**: uses  `text/template` (default)
    85  - **html**: uses `html/template`
    86  
    87  ## Contributing
    88  see [CONTRIBUTING.md](CONTRIBUTING.md)
    89  
    90  ## Donating
    91  Thanks for your interest in this project. You can show your appreciation and support further development by [donating](https://www.tk-software.de/donate).
    92  
    93  ## License
    94  **GoMod** © 2023-2024 [Tobias Koch](https://www.tk-software.de). Released under a [BSD-style license](https://gitlab.com/tobiaskoch/gomod/-/blob/main/LICENSE).