Skip to content
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

Include suffixes in lambda functions #100

Closed
kchoong opened this issue Feb 19, 2021 · 3 comments
Closed

Include suffixes in lambda functions #100

kchoong opened this issue Feb 19, 2021 · 3 comments
Assignees

Comments

@kchoong
Copy link
Contributor

kchoong commented Feb 19, 2021

Hello @seboettg,

I have a question regarding the custom lambda functions.

For example I have this additional markup:

$additionalMarkup = [
    "bibliography" => [
        "title" => function($cslItem, $renderedText) {
            return '<span class="citeproc-title">' . $renderedText . '</span>';
        },
        "citation-number" => function($cslItem, $renderedText) {
            return '<span class="citation-number">' . $cslItem->citationNumber . '</span>';
        }
    ]
];

and the CSL for the LNCS (springer-lecture-notes-in-computer-science.csl) states:

<text variable="citation-number" suffix="."/>

This would result for the first entry in the bibliography:

<span class="citation-number">1</span>.

Now is there currently a way to include suffixes like the punctuation above within the lambda function or is this something considered to be integrated in the future?

The result I want to reach would look like following instead:

<span class="citation-number">1.</span>

Regards,
kchoong

@kchoong kchoong changed the title Include suffixes in lambda functions [question] Include suffixes in lambda functions Feb 19, 2021
@kchoong kchoong changed the title [question] Include suffixes in lambda functions Include suffixes in lambda functions Feb 19, 2021
@seboettg
Copy link
Owner

Hi @kchoong!

I guess this is not possible at the moment. Some adjustments are necessary for that. The "lambda" functions must be changed so that the markup has to embrace affixes and other style options. If necessary, it would be useful to make this configurable in the $additionalMarkup.

I can't promise that I will get to it soon. But if it helps, I'm happy about a pull request from you.

nongenti added a commit to UB-Heidelberg/citeproc-php that referenced this issue May 26, 2021
@seboettg seboettg self-assigned this Sep 12, 2021
nongenti added a commit to nongenti/citeproc-php that referenced this issue Sep 22, 2021
Add possibility to include affixes in lambda functions, Issue seboettg#100
seboettg added a commit that referenced this issue May 6, 2022
Add possibility to include affixes in lambda functions, Issue #100, 2
@seboettg
Copy link
Owner

seboettg commented May 8, 2022

@kchoong please check if this issue is solved with new versions

@kchoong
Copy link
Contributor Author

kchoong commented Jun 30, 2022

Hey @seboettg,
yes this fixed my issue, thank you!

@kchoong kchoong closed this as completed Jun 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants