Apply abbreviations to literal names in short form#181
Open
adunning wants to merge 1 commit into
Open
Apply abbreviations to literal names in short form#181adunning wants to merge 1 commit into
adunning wants to merge 1 commit into
Conversation
Add support for abbreviating literal names in names rendering with `form="short"`.
There was a problem hiding this comment.
Pull request overview
This PR extends CSL short-form rendering so abbreviation maps are applied to additional literal-like fields, specifically literal names rendered with <name form="short"/>, alongside new regression tests and a README note describing the behavior.
Changes:
- Apply abbreviation lookup to literal names during short-form name rendering.
- Add CSL fixture tests for abbreviated
container-title,collection-title, and literalauthornames. - Document that
form="short"rendering uses provided CSL abbreviations, including for literal names.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
test/csl/variables_ContainerTitleAbbreviation.txt |
Adds a fixture verifying container-title short-form abbreviation rendering. |
test/csl/variables_CollectionTitleAbbreviation.txt |
Adds a fixture verifying collection-title short-form abbreviation rendering. |
test/csl/name_LiteralShortFormAbbreviation.txt |
Adds a fixture for abbreviating a literal author name in short form. |
src/Citeproc/Eval.hs |
Implements literal-name abbreviation during short-form name formatting. |
README.md |
Documents how abbreviations are applied during short-form rendering. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| -- we set delimiter to Nothing because we're handling delim | ||
| -- manually, to allow for things like "and" and no final comma | ||
| return $ Tagged (TagNames var namesFormat names) | ||
| return $ Tagged (TagNames var namesFormat namesForRendering) |
Comment on lines
+2195
to
+2199
| let namesForRendering = | ||
| if nameForm nameFormat == Just ShortName | ||
| then map abbreviateLiteralName names | ||
| else names | ||
| names' <- zipWithM (formatName nameFormat formatting) [1..] namesForRendering |
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.
Add support for abbreviating literal names in names rendering with
form="short".