No hints? Nobody?

 

Von: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> Im Auftrag von denis.maier-NSENcxR/0n0@public.gmane.org
Gesendet: Dienstag, 5. Juli 2022 17:51
An: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Betreff: AW: Changing colons to full-stops in titles

 

I really don’t know what is going off the rails here, but this is my output:

 

C:\Users\denis\Desktop\pandoc-subtitle>pandoc text.md --citeproc

<p>test <span class="citation" data-cites="doe">(Doe 2022)</span></p>

<div id="refs" class="references csl-bib-body hanging-indent"

role="doc-bibliography">

<div id="ref-doe" class="csl-entry" role="doc-biblioentry">

Doe, Jane. 2022. <em>A Book: With a Subtitle and a Reference to Gen 1:1,

but That Is Not a Problem</em>. Whatever press.

</div>

</div>

 

C:\Users\denis\Desktop\pandoc-subtitle>pandoc text.md -L title.lua --citeproc

<p>test <span class="citation" data-cites="doe">(Doe 2022)</span></p>

<div id="refs" class="references csl-bib-body hanging-indent"

role="doc-bibliography">

<div id="ref-doe" class="csl-entry" role="doc-biblioentry">

Doe, Jane. 2022. <em>A Book. With a Subtitle and a Reference to Gen 1:1,

but That Is Not a Problem</em>. Whatever press.

</div>

</div>

 

Von: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> Im Auftrag von John Carter Wood
Gesendet: Dienstag, 5. Juli 2022 13:45
An: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Betreff: Re: Changing colons to full-stops in titles

 

Changing the order with the original filter didn't have an effect.

Trying the revised filter (which I renamed, as it is very different from the first one) resulted in the following error message:


Albert Krewinkel schrieb am Dienstag, 5. Juli 2022 um 12:27:43 UTC+2:


John Carter Wood <woo...-ZOsAvrTRSvuEhhMi0yms2Q@public.gmane.org> writes:

> I have finally had a chance to try out Denis's lua filter but I don't
> seem to be able to get it to work.
> 1. I saved the filter in my .pandoc/filters folder (as
> colon-to-dot.lua, attached)
> 2. I used the test .md file Denis provided (as dot-test.md, attached)
> 3. I used the pandoc command: pandoc dot-test.md --citeproc
> --lua-filter colon-to-dot.lua -o dot-test.docx
> But what comes out looks like this: the colon is unchanged.
> Screenshot from 2022-07-05 12-00-17.png
> What am I doing wrong?

I didn't test them, but these changes could help:

1. Change the order of `--citeproc` and `--lua-filter=...` on the
command line. The order in which these are given is also the order
in which they are applied. We want the Lua filter to be applied
first.

2. Make sure that the `references` field is populated by filtering the
Pandoc element and adding
`doc.meta.references = pandoc.utils.references(doc)`

Here's the updated filter:

``` lua
function Pandoc (doc)
local meta = doc.meta
meta.references = pandoc.utils.references(doc)
meta.bibliography = nil -- prevent citeproc from parsing this again

for _, ref in ipairs (meta.references or {}) do
ref.title = ref.title:walk {
Str = function (str)
return str:gsub(':$', ',')
end
}
end

return pandoc.Pandoc(doc.blocks, meta)
end
```

HTH

--
Albert Krewinkel
GPG: 8eed e3e2 e8c5 6f18 81fe e836 388d c0b2 1f63 1124

--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/1ebf2a90-159e-4445-bf3a-b068526877cbn%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/2bb67f22fc3044088f798c777f3684d2%40unibe.ch.

--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/c1ebb341fddc4cd3b954c34e3fe16fca%40unibe.ch.