-
Notifications
You must be signed in to change notification settings - Fork 2
Crs allone #6
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
base: main
Are you sure you want to change the base?
Crs allone #6
Conversation
- crmap: show CR as interactive svg map - display map region and unit information and commands on click - orderfile: render orders with wiki links and comments (with markdown) - readnr/shownr: parse NR and detect sections, regions, units - display sections, regions units
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.
Pull Request Overview
This pull request introduces new shortcodes for displaying Eressea game data in an Eleventy static site. The main purpose is to add interactive map visualization and formatted display of game reports and order files.
- Adds three new shortcode categories:
crmapfor interactive SVG maps,readnr/shownrfor displaying report sections, andorderfilefor formatted order display - Implements conditional CSS/JS loading to only include assets when actually needed
- Adds comprehensive report parsing with bookmarks and unit detection for easy navigation
Reviewed Changes
Copilot reviewed 6 out of 244 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| crs/crs.js | Main plugin file implementing all shortcodes with CR file parsing, SVG generation, and report processing |
| crs/crs.css | Styling for maps, tooltips, order files, and report displays |
| crs/crs-passthrough.js | Client-side JavaScript for interactive map functionality and tooltips |
| _includes/base-layout.njk | Template updated to conditionally include CRS assets and fix title display |
| .eleventyignore | Updated to ignore template directory |
| .eleventy.js | Plugin registration and configuration updates |
| const { start } = require('repl'); | ||
|
|
Copilot
AI
Aug 24, 2025
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.
The start import from 'repl' is unused throughout the file. This import should be removed as it's not needed for the functionality.
| const { start } = require('repl'); |
| const fs = require('fs'); | ||
| const path = require('path'); |
Copilot
AI
Aug 24, 2025
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.
The require statements for 'fs' and 'path' should be moved to the top of the file with other imports, as they're already imported there. This avoids redundant module loading on each function call.
| const fs = require('fs'); | |
| const path = require('path'); |
| {% if content.indexOf('crs-requires-css') !== -1 %} | ||
| <link rel="stylesheet" href="{{ '/css/crs.css' }}"> | ||
| {% endif %} | ||
| {% if content.indexOf('crs-requires-js') !== -1 %} |
Copilot
AI
Aug 24, 2025
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.
The conditional asset loading uses string search on content, which could have false positives if the marker class appears in text content. Consider using a more robust approach like setting template variables in the shortcodes.
| {% if content.indexOf('crs-requires-css') !== -1 %} | |
| <link rel="stylesheet" href="{{ '/css/crs.css' }}"> | |
| {% endif %} | |
| {% if content.indexOf('crs-requires-js') !== -1 %} | |
| {% if crs_requires_css %} | |
| <link rel="stylesheet" href="{{ '/css/crs.css' }}"> | |
| {% endif %} | |
| {% if crs_requires_js %} |
Neue Shortcodes:
css/js only included if actually needed.