Adds a couple of hashes in the App::WRT::EntryStore::new() constructor
which stash arrays of properties for each entry, and arrays of entries
for each property, as File::Find works its way through the $entry_dir.
Uses props_for() in App::WRT::entry_topic_list() instead of dir_list().
This is maybe a tiny performance gain, but also probably more hassle
than it's worth unless other features are going to be built on these
methods (or other code that calls dir_list() simplified).
This also moves a chunk of logic out of EntryStore::all() and into the
constructor, and directly accesses $self->{source_files} in a couple of
methods instead of tossing around copies of the array.
I'm kind of iffy on whether any of this is worth doing.
I never could quite figure out why non-ASCII characters were getting
badly munged in XML::Atom::SimpleFeed output. Using Encode::decode() on
the content of entries turns out to fix this, although it's probably the
tip of an iceberg.
- get_all_source_files() -> EntryStore::all()
- get_date_entries_by_depth() -> EntryStore::dates_by_depth()
- get_recent_entries_by_depth() -> EntryStore::recent_by_depth()
...plus some convenience methods for accessing recent or all years /
months / days, and a next($entry) / previous($entry) for indexing into the
date lists.
An instance of App::WRT::EntryStore is stashed on an App::WRT instance.
- give absolute paths to imgsize() so it chills out on Cwd::getcwd() calls
- rip out App::WRT::MethodSpit's convenience accessors and just access
elements of $self directly
- kill local_path()
- stop using a() in entry_markup()
- cache get_date_entries_by_depth() results
- swap out state vars for stashing things on $self in
get_all_source_files()
This gets rendering the whole p1k3 repo back down in the neighborhood of
2.1 seconds, which is a lot more tolerable than 5 or 6.
It also kinda technically breaks the API, maybe, so I guess this'll be a
v5.0.0 after a while.
Replaces get_all_day_entries() with get_date_entries_by_depth(). Adds
generate_month_lists() to stash %prev_months and %next_months (this can
probably be generalized a bunch).
Generalizes sortable_date_from_entry() to work with different levels of
date. Assumes that no component of the date is more than 4 digits, which
is not very future proof. (Though if this code is still running in the
year 10000, the future will have gone very differently than I expect it
to.)
month_before() now uses the %prev_months and %next_months hashes.
Removes fulltext(), because you can just call get_date_entries_by_depth(3).
Much slower than it probably needs to be.
Shuffles a bit of stuff out of App::WRT::Renderer into App::WRT, including
the method now called get_all_source_files() and a new one called
get_all_day_entries() that returns a sorted listed of days.
Uses state variables to cache the get_all_source_files() data, as well
as month_before() data (this was previously memoized inside a closure).
App::WRT::feed_print() now takes a list of entries instead of a month to
render the feed for.
App::WRT::feed_print_latest() gets a feed with most recent feed_length
entries.
I went and read:
https://pause.perl.org/pause/authenquery?ACTION=pause_namingmodules
Realized I should probably not name this something with an inscrutable
top-level namespace. WRT is still inscrutable, I guess, but at least
it's now under App.
- Renames all modules, fixes tests (such as they are)
- Zaps old t/validate/ stuff
- adds include_process() in WRT::Markup
- moves eval_perl() into WRT::Markup. The way object instances are
composed (and instance methods called) here still feels pretty janky,
and this does nothing to help the situation.
- changes all existing $root_dir instances to $entry_dir; adds a $root_dir
which represents the root of the archive (top-level folder containing
the wrt.json file)
I'd be worried about the $root_dir change if I thought this module had a
single other user in the wild, but I strongly doubt that it does. If I
am wrong and you are that user, I apologize sincerely in advance.
The include feature still has fairly unsettled semantics, but it gets the
whole thing much closer to a usable site generator.