a simple Block Header Generator
cargo install bhg- Create the
bhgdirectory in the.configdirectory:mkdir -p ~/.config/bhg - Inside the directory create a
variables.json, which contains constants that can be used as variables in the block-headerbase.<file extension>- for each file typebhg output.cwill use the~/.config/bhg/base.cas a base filebhg output.rswill use the~/.config/bhg/base.rsas a base file
bhg <output file> <description>| Variable | Value source |
|---|---|
| description | passed as command line argument |
| year | the current year |
| month | the current month |
| day | the current day |
| hour | the current hour |
| minute | the current minute |
| second | the current second |
| microsecond | the current microsecond |
| weekday | the current weekday (monday = 1, ..., sunday = 7) |
| weekdayName | the current weekday name |
| monthName | the current month name |
| timestamp | the current timestamp |
| timestampMS | the current timestamp in milliseconds |
| timestampISO | the current timestamp in ISO format |
bhg output.c This is a description{
"name": "John Doe",
"email": "john.doe@gmail.com"
}/*
-------------------------------------------------------------
->ABC Company
-------------------------------------------------------------
->{name}, {day}-{month}-{year}
-------------------------------------------------------------
->{email}, {description}
-------------------------------------------------------------
This line won't be centered {weekdayName}
-------------------------------------------------------------
*//*
-------------------------------------------------------------
ABC Company
-------------------------------------------------------------
John Doe, 31-12-2023
-------------------------------------------------------------
john.doe@gmail.com, This is a description
-------------------------------------------------------------
This line won't be centered Sunday
-------------------------------------------------------------
*/