#mdbook #summary-md #day #command-line-tool #logging #today #ie #01 #jan

bin+lib mdbook-newday

A commandline tool to add a new day to the top of the summary of an mdbook

3 releases (breaking)

Uses new Rust 2024

0.3.0 Sep 9, 2025
0.2.0 Sep 13, 2022
0.1.0 Nov 20, 2021

#1052 in Parser implementations

Download history 104/week @ 2025-09-06 19/week @ 2025-09-13 1/week @ 2025-09-20 6/week @ 2025-09-27 3/week @ 2025-10-04

111 downloads per month

MIT/Apache

16KB
255 lines

mdbook-newday

Motivation

With a lot of projects I like to keep a log or journal. Mdbook is a nice way to do that, but I find that actually entering in the day and date and creating a new file can be error prone and tedious.

What mdbook-newday does

mdbook-newday is a very special purpose command that will take a SUMMARY.mdfile and add a line to it for the current day.

The format of that line is

- [%A, %b %d, %Y](./%Y/%Y-%m/%Y-%m-%d.md), ie

- [Thursday, Jan 01, 1970](./1970/1970-01/1970-01-01.md),

If you then run mdbook serve, it will create a file at ./1970/1970-01/1970-01-01.md .

The file will be automatically given a title in the form # Thursday, Jan 01, 1970 .

Usage

Basic usage (add today's entry)

mdbook-newday path/to/SUMMARY.md

Plan ahead usage (add entries for the next n days)

mdbook-newday --plan-ahead 5 path/to/SUMMARY.md

This will add entries for the next 5 days (tomorrow, day after tomorrow, etc.) in reverse chronological order (newest first), which is typical for journals and logs.

Options

  • --plan-ahead <n>: Add entries for the next n days instead of just today. The argument must be a positive number.

Examples

Add today's entry:

mdbook-newday SUMMARY.md

Add entries for the next 7 days:

mdbook-newday --plan-ahead 7 SUMMARY.md

The command is idempotent - running it multiple times will not create duplicate entries.

Dependencies

~1MB
~18K SLoC