feat: complete TODO parity with microposts and local rewriter#15
Merged
Conversation
Extracts structured content from HTML pages including title, body text, date, and author from common article markup patterns (article elements, role=article, blog post classes). Falls back to body content when no article containers are found.
Adds LocalRewriter class that rewrites previously downloaded files by converting archive URLs to local paths without fetching. The rewrite-local CLI command processes HTML, CSS, and JS files from an input directory and writes rewritten output to an output directory.
| ].freeze | ||
|
|
||
| def rewrite_candidate?(content) | ||
| content.include?("web.archive.org") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Completes the final two remaining TODO parity items:
1. Page#microposts (TODO 13.6 — Content Extraction Pipeline)
article,[role=article],.post,.entry, etc.)2. LocalRewriter + rewrite-local CLI (TODO 11.5 — Local-Only Rewrite Mode)
archaeo rewrite-local INPUT_DIR [--output DIR] [--prefix PREFIX]Changes
lib/archaeo/page.rb— microposts method with article extractionlib/archaeo/local_rewriter.rb— new LocalRewriter classlib/archaeo/cli.rb— rewrite-local commandlib/archaeo.rb— autoloads for LocalRewriter, LocalRewriteSummaryTest Results
561 examples, 0 failures