pspeter / pen Goto Github PK
View Code? Open in Web Editor NEWCLI Diary - Jot down your thoughts whenever you want - directly from the command line
License: MIT License
CLI Diary - Jot down your thoughts whenever you want - directly from the command line
License: MIT License
The pager should only be used if the output has more lines than the console height.
There's a few requirements for the filter feature:
At first, 1) and 2) seem fairly straightforward: provide a hookspec that takes an entry and the config with cli args and return a Boolean whether to keep this entry (return False) or drop it (return True). If any hookimpls return True, the entry will not be processed further (for editing or reading).
However, if you have multiple filters that are unaware of each other, then that might become a problem. If you have a filter that only allows entries from last year and a last_n filter of 2, then the last_n filter will have no effect as it will drop the entries from last night that are also dropped by the date filter.
Furthermore, 3) makes this issue even more complicated. The question is: at what point will the filter activate? After reading the journal file based on the raw text? After splitting the entries? Or only after parsing each entry (I want to avoid this)?
I might have to end up writing multiple hooks at each of these points in time so that different filters can implement one of the hooks -> the earlier the better. For example, the current last_n filter can be used after splitting the entries but before they are parsed, while a date-filter needs to know the dates of each entry and thus only works with parsed entries. But having multiple hooks makes 1) and 2) even more complicated.
I need to think about this some more before attempting an implementation. One complication are directory-based journals that contain entries in different places, as this might add another hook - before reading each file. Depending on what metadata is known about these files some filters could hook in there and prevent reading the file altogether.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.