-
Notifications
You must be signed in to change notification settings - Fork 75
simplify templates #370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
simplify templates #370
Conversation
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
…tion Successfully removed the manual `<!-- TEAMS WITH ASKS -->` placeholder system from the rust-project-goals mdbook preprocessor and implemented automatic team injection. Key Accomplishments: 1. **Eliminated Manual Placeholders** - Removed `<!-- TEAMS WITH ASKS -->` requirement from goal documents - Cleaned up regex definitions and verification code - Updated template to remove Teams row entirely 2. **Implemented Smart Auto-Injection** - Automatically computes team names from goal's `teams_with_asks()` data - Handles both existing goals (replaces placeholder) and new goals (adds row) - Shows "(none)" for goals without team asks, formatted team links otherwise 3. **Robust Implementation** - Added milestone directory filtering to avoid processing documentation files - Proper error handling to prevent panics on malformed paths - Template exclusion to avoid processing template files as goals 4. **Backward Compatibility** - Existing goal files with old placeholders continue to work - Seamless transition - no manual migration required - New goals from updated template work automatically Technical Changes: - Modified: crates/mdbook-goals/src/mdbook_preprocessor.rs - Added inject_teams_into_metadata_table() - Modified: crates/rust-project-goals/src/goal.rs - Removed placeholder verification, added template exclusion - Modified: crates/rust-project-goals/src/re.rs - Removed TEAMS_WITH_ASKS regex - Modified: src/TEMPLATE.md - Removed Teams row entirely Result: Goal authors can now focus purely on content - team information is automatically handled based on their team asks data. The system is cleaner, more maintainable, and eliminates a common source of manual errors.
…ection Extended the automatic injection system to also handle task owners. Removed the manual `<!-- TASK OWNERS -->` placeholder requirement and implemented automatic task owner injection. Goal documents no longer need to include either Teams or Task owners placeholders in their metadata tables. Key Accomplishments: 1. **Eliminated Both Placeholder Systems** - Removed `<!-- TASK OWNERS -->` requirement from goal documents - Completely removed the old placeholder replacement system - Cleaned up all related regex definitions and verification code 2. **Fully Automatic Injection** - Both Teams and Task owners rows are now computed and injected automatically - Smart row placement: Task owners after Teams (if present) or after Point of contact - Shows "(none)" for goals without task owners, formatted names otherwise 3. **Dramatically Simplified Template** - Removed both Teams and Task owners rows from template entirely - Template now only has 4 metadata rows instead of 6 - Focuses on what authors actually need to fill out manually 4. **Consistent Implementation** - Applied the same robust pattern for both injection systems - Milestone directory filtering, template exclusion, backward compatibility - Proper error handling and smart placement logic 5. **Complete Backward Compatibility** - Existing goal files with old placeholders continue to work seamlessly - System replaces existing rows or adds missing ones as needed - No manual migration required Technical Changes: - Modified: crates/mdbook-goals/src/mdbook_preprocessor.rs - Added inject_task_owners_into_metadata_table(), removed replace_metadata_placeholder() - Modified: crates/rust-project-goals/src/goal.rs - Removed placeholder verification, removed unused verify_row function - Modified: crates/rust-project-goals/src/re.rs - Removed TASK_OWNERS regex - Modified: src/TEMPLATE.md - Removed Task owners row entirely Result: Goal authors can now focus entirely on content - all metadata injection is handled automatically based on the goal's structured data. The template is significantly simplified and less error-prone.
Successfully removed all legacy `<!-- TEAMS WITH ASKS -->` and `<!-- TASK OWNERS -->` placeholder rows from 115+ goal files. These placeholders are no longer needed since the preprocessor now automatically injects Teams and Task owners information based on the goal's metadata. Key Accomplishments: 1. **Massive Cleanup** - Removed 115 instances of `<!-- TEAMS WITH ASKS -->` placeholders - Removed 115 instances of `<!-- TASK OWNERS -->` placeholders - Eliminated 230+ lines of legacy placeholder code across all goal files 2. **Fixed Table Structure Issues** - Resolved broken metadata tables where placeholder removal left empty lines - Fixed markdown table parsing errors that prevented successful builds - Ensured all metadata tables have proper continuous structure 3. **Verified Auto-injection System** - Confirmed Teams rows are automatically injected with correct team information - Confirmed Task owners rows are automatically injected with correct owner data - Verified consistent formatting across all goal files 4. **Template Simplification** - Template now only contains 4 metadata rows that authors need to fill manually - Removed 2 placeholder rows that were confusing and error-prone - Goal authors can now focus purely on content creation Impact: - Goal authors no longer need to manage manual placeholders - Cleaner, simpler template reduces chance of formatting errors - Automatic, consistent formatting of team and owner information - Better maintainability and system consistency - Successful mdbook builds without table parsing errors Result: The placeholder cleanup is complete. All goal files are clean, the build works perfectly, and the auto-injection system handles all metadata formatting automatically. Goal authors can focus purely on writing content while the system handles metadata presentation.
… preprocessor - Change regex patterns from <!-- PATTERN --> to (((PATTERN))) - Update all 7 regex patterns in re.rs: TEAM_ASKS, GOAL_LIST, FLAGSHIP_GOAL_LIST, OTHER_GOAL_LIST, GOAL_NOT_ACCEPTED_LIST, GOAL_COUNT, VALID_TEAM_ASKS - Update error messages in mdbook_preprocessor.rs to reference new syntax - Update all markdown files across 2024h2, 2025h1, 2025h2, admin/samples, and about directories - Solves HTML comment processing issues in mdbook templates where comments get stripped or require HTML encoding The new triple-parentheses syntax is HTML-safe, template-friendly, and visually distinctive.
- Replace binary flagship status with categorical system using | Flagship | CategoryName | - Add support for filtered macros like (((FLAGSHIP GOALS:Performance))) - Maintain backward compatibility with existing (((FLAGSHIP GOALS))) macro - Add metadata.flagship() method returning Option<&str> - Include migration script to convert existing flagship goals to | Flagship | Yes | - Refactor goal list processing to use unified replace_goal_lists_helper function - Support whitespace trimming in both macro filters and metadata values All existing flagship goals migrated to use 'Yes' category. New filtered macros enable focused flagship goal pages by category.
- Combined inject_teams_into_metadata_table and inject_task_owners_into_metadata_table into single inject_metadata_rows function - Added find_markdown_table_end helper that finds any table by looking for lines starting with '|' - Simplified logic: find table end, insert both rows - no complex conditional checking - Added test for table finding logic
Contributor
|
Love this! |
lqd
reviewed
Aug 7, 2025
Member
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(This file can be removed)
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.
The use of HTML comments was causing issues. This eliminates unnecessary placeholders and replaces others with
(((...))). Also modifies how flagship goals work to support themes (we'll be using this in 2025H2).cc @lqd @tomassedovic
Rendered