1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
//! This project is a simple tool to help you create a new Minutes of Meeting (MoM) document.
//! It will create a new text file with the metadata of the meeting and a template for the MoM.
//!
//! ## Features
//!
//! - Create a new MoM document
//! - Add metadata to the document(see below for the list of metadata)
//! - Add a template for the MoM
//! - Save the document to a specified name and location
//!
//! ## Usage
//!
//! ### Windows
//!
//! ```bash
//! momi.exe [options] <filename>
//! ```
//!
//! ### Mac and Linux
//!
//! ```bash
//! ./momi [options] <filename>
//! ```
//!
//! ### Options
//!
//! - `-h, --help`: Show help message and exit
//! - `-V, --version`: Show version and exit
//! - `-a, --author <author>`: Add the author of the document
//! - `-v, --verbose`: Show verbose output
//! - `-o, --overwrite`: Overwrite the file if it already exists
//!
//! #### Example
//!
//! ```bash
//! momi.exe -a "John Doe" "Meeting with the client 1.md"
//! ```
//!
//! And the file `Meeting with the client 1.md` contains the following content:
//! ```text
//! # Meeting with the client 1
//!
//! created: 2024-04-30 04:58:44
//! author: John Doe
//!
//!
//!
//! ```
//!
//! ## Configuration
//!
//! The configuration file is located at `config.json` in the same directory as the executable.
//! It can hold the following settings:
//!
//! - `author`: The default author of the document
//! - `extension`: The default extension of the document
//! - `header`: The default header of the document
//! - `footer`: The default footer of the document
//!
//! #### Example
//!
//! In `config.json`:
//! ```json
//! {
//! "author": "John Doe",
//! "extension": "txt",
//! "header": "--------header--------",
//! "footer": "--------footer--------"
//! }
//! ```
//!
//! This json file will set the default values for metadata:
//! - The author of the document will be "John Doe"
//! - The extension of the document will be `txt`
//! - The header of the document will be "--------header--------"
//! - The footer of the document will be "--------footer--------"
//!
//! As a result of the above configuration, the following bash command will create a file with the following content:
//!
//! ```bash
//! momi.exe "Meeting with the client 1"
//! ```
//!
//! In the file `Meeting with the client 1.txt`:
//! ```text
//! Meeting with the client 1
//!
//! created: 2024-04-30 05:01:39
//! author: John Doe
//! --------header--------
//!
//! --------footer--------
//! ```
//!
//! If options are provided on the command line,
//! the configuration file is overridden by the command line options.
//!
//! ## Supported Metadata
//!
//! - `created`: The date and time the document was created
//! - `author`: The author of the document
//!
//! ## Supported Extensions
//!
//! These are the extensions that the program can automatically add
//! to the filename as the title of the document:
//!
//! - `.txt`: Text file
//! - `.md`: Markdown file
//!
//! ## How to determine which metadata is written to the document?
//!
//! ### Order of Precedence
//!
//! 1. CLI Option
//! 2. Configuration File
//! 3. Nothing or Default Value
//!
//! The program will write the metadata to the document if the author is provided as an CLI option.
//! If the author is not provided, the program will use the default author from the configuration file.
//! If the author is not provided in the configuration file, the program will write the current user's name as the author(`$USER`).
//!
//! If the author is provided as an option at the same time as the configuration file,
//! the program will use the author provided as an option and ignore the author in the configuration file.
//!
//! The rest of the metadata will be written to the document by same rules as the author.
//!
//! ## How to Build
//!
//! ### Prerequisites
//!
//! - [Rust and Cargo](https://www.rust-lang.org/tools/install)
//!
//! ### Steps
//!
//! 1. Clone the repository
//! 2. Open a terminal in the project directory
//! 3. Run the following command:
//!
//! ```bash
//! cargo build --release
//! ```
//!
//! 4. The executable will be located at `target/release/momi`
//! 5. You can copy the executable to a directory in your PATH(optional)
//!
//! You can also run the executable from the project directory with the following command:
//!
//! ```bash
//! cargo run -- [options] <filename>
//! ```
//!
//! ## Not Implemented Yet But Planned
//!
//! See [Todo.md](Todo.md) for the list of features that are planned but not implemented yet.
//!
//! ## License
//!
//! This project is licensed under the MIT License.
//!