Feature/hopa bookmarks - #110
Open
epsig wants to merge 28 commits into
Open
Conversation
# Conflicts: # src/shob.cpp
There was a problem hiding this comment.
🟡 Changes recommended
There are confirmed correctness/build issues (link dependencies and unsafe container indexing) that can cause link failures or runtime crashes.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR migrates homepage and bookmarks-page generation from legacy Perl scripts to the C++ codebase, introducing new bookmarks/page formatting modules, updating bookmark data sources, and refreshing the generated HTML outputs.
Changes:
- Added a new
shob.bookmarksC++ module (events, configurable bookmarks, current events) and corresponding unit tests/CMake targets. - Added new
shob.pagesformatters to rebuildindex.htmland configurable bookmark pages using shared HTML helpers (table::yellowRed,html::List) and updatedHeadBottomoptions. - Removed legacy Perl bookmark generation code paths and updated bookmark CSV data + regenerated HTML pages.
File summaries
| File | Description |
|---|---|
| CMakeLists.txt | Adds shob.bookmarks library + test target and links it into the main executable. |
| src/shob.pages/HeadBottom.h | Adds toggles to optionally emit <h1> and footer. |
| src/shob.pages/HeadBottom.cpp | Implements conditional <h1> and footer rendering. |
| src/shob.pages/FormatHomePage.h | Declares homepage rebuild entrypoint. |
| src/shob.pages/FormatHomePage.cpp | Generates pages/index.html from bookmarks + site blocks. |
| src/shob.pages/FormatBookmarks.h | Declares configurable bookmark page formatter. |
| src/shob.pages/FormatBookmarks.cpp | Builds bookmark pages from CSV-configured blocks and events. |
| src/shob.html/table.h | Adds table::yellowRed helper to format two-column blocks with headers. |
| src/shob.html/table.cpp | Implements table::yellowRed HTML generation. |
| src/shob.html/List.h | Adds html::List helper for unordered lists. |
| src/shob.html/List.cpp | Implements unordered list rendering from MultipleStrings. |
| src/shob.general/itdate.h | Makes splitAndValidate publicly callable; keeps date immutable via const dd. |
| src/shob.cpp | Wires homepage + bookmarks rebuild into the main run. |
| src/shob.bookmarks/OwnSportPages.h | Declares helpers to build sports page link ranges. |
| src/shob.bookmarks/OwnSportPages.cpp | Implements sports page link list generation. |
| src/shob.bookmarks/ListOfEvents.h | Introduces event list container and render helpers. |
| src/shob.bookmarks/ListOfEvents.cpp | Implements event list rendering helpers. |
| src/shob.bookmarks/Event.h | Introduces simple event model (name/url). |
| src/shob.bookmarks/Event.cpp | Implements HTML anchor generation for events. |
| src/shob.bookmarks/CurrentEvents.h | Declares “current events” lookup API. |
| src/shob.bookmarks/CurrentEvents.cpp | Implements date-window filtering from current.csv. |
| src/shob.bookmarks/ConfigurableBookmarks.h | Declares CSV-driven bookmark page configuration/events API. |
| src/shob.bookmarks/ConfigurableBookmarks.cpp | Implements config parsing and event lookup from CSV archives. |
| src/shob.bookmarks.test/TestOwnSportPages.h | Declares OwnSportPages unit tests. |
| src/shob.bookmarks.test/TestOwnSportPages.cpp | Implements OwnSportPages unit tests. |
| src/shob.bookmarks.test/TestCurrentEvents.h | Declares CurrentEvents unit test. |
| src/shob.bookmarks.test/TestCurrentEvents.cpp | Implements CurrentEvents unit test. |
| src/shob.bookmarks.test/TestConfigurableBookmarks.h | Declares ConfigurableBookmarks unit tests. |
| src/shob.bookmarks.test/TestConfigurableBookmarks.cpp | Implements ConfigurableBookmarks unit tests. |
| src/shob.bookmarks.test/BookmarksUnitTest.cpp | Adds a dedicated gtest runner for bookmarks unit tests. |
| data/bookmarks/config.csv | Updates/extends bookmark page configuration (new pages/blocks). |
| data/bookmarks/archive.csv | Updates bookmark link archive content (adds sport blocks, removes one entry). |
| pages/index.html | Regenerated homepage HTML based on new C++ generators. |
| pages/bookmarks_media.html | Regenerated media bookmarks HTML. |
| pages/bookmarks_treinen.html | Regenerated trains bookmarks HTML. |
| pages/bookmarks_computers.html | Regenerated computers bookmarks HTML. |
| pages/bookmarks_sport.html | Regenerated sport bookmarks HTML. |
| pages/tmp_bookmarks_science.html | Regenerated tmp science bookmarks HTML. |
| pages/tmp_bookmarks_milieu.html | Regenerated tmp environment bookmarks HTML. |
| code/Sport_Collector/Bookmarks_Index.pm | Removes unused exported Perl generator (get_sport_links) and its implementation. |
| code/Shob/SiteUpdater.pm | Stops invoking Perl-based homepage/bookmarks generators in site update flow. |
| code/Shob/Bookmarks.pm | Removes the legacy Perl bookmarks generator module. |
| code/Shob/Algemeen.pm | Removes legacy Perl homepage generation (get_hopa). |
Review details
- Files reviewed: 43/43 changed files
- Comments generated: 5
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
129
to
133
| target_link_libraries(shob.pages shob.football shob.general shob.readers shob.html shob.teams) | ||
| target_link_libraries(shob shob.football shob.general shob.readers shob.html shob.teams shob.pages) | ||
| target_link_libraries(shob shob.football shob.general shob.readers shob.html shob.teams shob.pages | ||
| shob.bookmarks) | ||
| target_link_libraries(shob.pages.test shob.football shob.general shob.readers shob.html | ||
| shob.teams shob.pages shob.test.utils gtest_main) |
Comment on lines
+23
to
+30
| MultipleStrings ListOfEvents::printFirstAndLast() const | ||
| { | ||
| MultipleStrings return_value; | ||
| return_value.addContent(events.front().link()); | ||
| return_value.addContent(" t/m "); | ||
| return_value.addContent(events.back().link()); | ||
| return return_value; | ||
| } |
Comment on lines
+60
to
+64
| auto hb = HeadBottomInput(dd_page); | ||
| hb.title = props.title; | ||
| hb.css = StyleSheetType::SeparateFile; | ||
| hb.copyTitleToH1 = false; | ||
| std::swap(hb.body, blocks[0]); |
Co-authored-by: epsig <34799234+epsig@users.noreply.github.com>
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.
No description provided.