Berichtsheft Generator is a versatile program written in GoLang. It is designed to generate weekly reports (Berichtshefte) for a specified year, creating individual text files for each week with specific templates.
Make sure you have Go installed on your machine.
-
Adjusting Parameters: Modify the parameters in the
main
function of themain.go
file:year
: Set the default year for report generation.createNewFolder
: Set to true to create a new folder for the reports.outputFolder
: Set the default output folder path.
-
Run the
main.go
Variant: Execute themain.go
file using the Go compiler:go run main.go
You can also provide arguments when calling the program:
go run main.go [year] [createNewFolder] [outputFolder]
Alternatively, build the executable:
go build main.go
Run the generated executable.
-
Example:
go run main.go 2024 y C:\Reports
-
Run the Executable: Execute the
Berichtsheft-Generator.exe
binary in your command prompt or terminal. -
Command-Line Arguments: The program accepts optional command-line arguments:
Year
: Specify the year for report generation.Create New Folder
: Optionally, provide "y" or "1" to create a new folder for the reports.Output Folder
: Optionally, provide the path to the output folder as the third argument.
-
Example: Windows
Berichtsheft-Generator.exe 2024 y C:\Reports
-
Example: MacOS
./Berichtsheft-Generator.exe 2024 y
- If no command-line arguments are provided, the program defaults to the current year.
- If no output folder is specified, the program uses the current working directory.
- If the second argument is neither "y" nor "1", files will be saved in the current working directory or the output directory given in argument 3.
The generated reports are saved as text files in the specified output folder. Each file follows the naming convention: KW{ISOWeek}_{StartDate}-{EndDate}.txt
.
The content of each report file follows a template with entries for each weekday, details about vocational school days, and a thematic section.
Template used in the exe: template.txt
Montag, {{.Montag}}
●
◦
Dienstag, {{.Dienstag}}
●
◦
Mittwoch, {{.Mittwoch}}
●
◦
Donnerstag, {{.Donnerstag}}
●
◦
Freitag, {{.Freitag}}
●
◦
_________________________________________________________________________________________________________________________
Berufsschule:
Montag, {{.Montag}}
●
◦
Dienstag, {{.Dienstag}}
●
◦
_________________________________________________________________________________________________________________________
Thema:
Another template provided uses a different kind of format: template2.txt
Montag, {{.Montag}}
-
>
Dienstag, {{.Dienstag}}
-
>
Mittwoch, {{.Mittwoch}}
-
>
Donnerstag, {{.Donnerstag}}
-
>
Freitag, {{.Freitag}}
-
>
_________________________________________________________________________________________________________________________
Berufsschule:
Montag, {{.Montag}}
-
>
Mittwoch, {{.Mittwoch}}
-
>
_________________________________________________________________________________________________________________________
Thema:
Feel free to customize the template based on your reporting needs. Use the Days as seen in the template and change it to your desired school days. The code uses the file with the name {template.txt}, this is the one you need to adjust or rename a different file with your desired format to it.
This program is open-source and distributed under the MIT License. Feel free to use, modify, and share it. If you find any issues or have suggestions, please create an issue.