mirror of
https://github.com/lancatlin/mdsh.git
synced 2026-11-05 19:30:12 +08:00
feat: add raw func and allow using funcs in output name
This commit is contained in:
1 parent
a2c99c710e
commit
d4e85844a4
5 files changed
+158
-62
No files matched your search
@@ -0,0 +1,45 @@
|
||||
---
|
||||
output: "monthly_report_{{.b}}.md"
|
||||
params:
|
||||
b:
|
||||
required: true
|
||||
default: 2011-01
|
||||
usage: |
|
||||
Required.
|
||||
The begin time of report.
|
||||
Examples:
|
||||
2025
|
||||
2025-07
|
||||
2025-07-15
|
||||
Jul
|
||||
e:
|
||||
required: true
|
||||
default: 2011-02
|
||||
usage: |
|
||||
Required.
|
||||
The end time of report.
|
||||
Same format as -b
|
||||
f:
|
||||
default: examples/ledger.j
|
||||
usage: The ledger file to parse
|
||||
---
|
||||
|
||||
# Finance Report from {{.b}} to {{.e}}
|
||||
|
||||
## Previous status:
|
||||
|
||||
{{ shell "hledger -f $f balancesheet -e $b" }}
|
||||
|
||||
## Expenses:
|
||||
|
||||
### Expense Summary by Category
|
||||
|
||||
{{ shell "hledger -f $f bal expenses -b $b -e $e --depth 3 --sort amount --budget" }}
|
||||
|
||||
## Net Income:
|
||||
|
||||
{{shell "hledger -f $f income -b $b -e $e --monthly"}}
|
||||
|
||||
## Ending balance:
|
||||
|
||||
{{shell "hledger -f $f balancesheet -e $e"}}
|
||||
@@ -0,0 +1,29 @@
|
||||
---
|
||||
output: sys-report-{{ raw "date --iso-8601" }}.md
|
||||
---
|
||||
|
||||
# 💥 System Information Report for {{ sh "hostname" }}
|
||||
|
||||
* **Hostname**: {{ sh "hostname" }}
|
||||
* **Username**: {{ sh "whoami" }}
|
||||
* **Uptime**: {{ sh "uptime -p" }}
|
||||
* **System**: {{ sh "uname -a" }}
|
||||
* **CPU**: {{ sh "uname -m" }} — {{ sh "nproc" }} cores
|
||||
* **IP Address**: {{ sh "hostname -I || ip a | grep inet" }}
|
||||
* **Default Gateway**: {{ sh "ip route | grep default || netstat -rn | grep default" }}
|
||||
|
||||
---
|
||||
|
||||
## 🧠 Memory Usage
|
||||
|
||||
{{ shell "free -h" }}
|
||||
|
||||
---
|
||||
|
||||
## 📉 Disk Usage
|
||||
|
||||
{{ shell "df -h /" }}
|
||||
|
||||
---
|
||||
|
||||
Generated on: {{ sh "date" }}
|
||||
Reference in new issue
Block a user