public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: <denis.maier-NSENcxR/0n0@public.gmane.org>
To: <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: AW: Changing colons to full-stops in titles
Date: Tue, 5 Jul 2022 15:50:41 +0000	[thread overview]
Message-ID: <2bb67f22fc3044088f798c777f3684d2@unibe.ch> (raw)
In-Reply-To: <1ebf2a90-159e-4445-bf3a-b068526877cbn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>


[-- Attachment #1.1: Type: text/plain, Size: 4145 bytes --]

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:


[cid:image001.png-/v79opaF+3RFSh627tqNLzRmByFHzeGd@public.gmane.org]
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<mailto: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<https://groups.google.com/d/msgid/pandoc-discuss/1ebf2a90-159e-4445-bf3a-b068526877cbn%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/2bb67f22fc3044088f798c777f3684d2%40unibe.ch.

[-- Attachment #1.2: Type: text/html, Size: 9569 bytes --]

[-- Attachment #2: image001.png --]
[-- Type: image/png, Size: 30019 bytes --]

  parent reply	other threads:[~2022-07-05 15:50 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <AQHYjVhIsMIE8s9IhE2lBYWP9lHO8a1pnTTw///rpoCAACWJYP//4zWAgAAjbfA=>
     [not found] ` <AQHYjVhIsMIE8s9IhE2lBYWP9lHO8a1pnTTw///rpoCAACWJYA==>
     [not found]   ` <AQHYjVhIsMIE8s9IhE2lBYWP9lHO8a1pnTTw>
2022-07-01 14:38     ` John Carter Wood
     [not found]       ` <78df697a-50f5-46d0-b0b8-29a2cbc9509an-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-07-01 15:30         ` John MacFarlane
     [not found]           ` <m2sfnkvoih.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
2022-07-01 15:41             ` AW: " denis.maier-NSENcxR/0n0
2022-07-01 15:34         ` denis.maier-NSENcxR/0n0
     [not found]           ` <f440b082946148b884b45ed1a3421de4-NSENcxR/0n0@public.gmane.org>
2022-07-01 15:52             ` John Carter Wood
     [not found]               ` <a2d540a6-a435-4285-aed5-018007d155cfn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-07-01 16:16                 ` AW: " denis.maier-NSENcxR/0n0
     [not found]                   ` <bc85a4891eec431f846ee69f9fcbe167-NSENcxR/0n0@public.gmane.org>
2022-07-01 16:23                     ` John Carter Wood
     [not found]                       ` <f0f222ef-e60e-4397-83ac-bec1a6ac2d08n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-07-01 16:40                         ` AW: " denis.maier-NSENcxR/0n0
     [not found]                           ` <2a8d940b3675472fb4b50ead406f6fc7-NSENcxR/0n0@public.gmane.org>
2022-07-01 16:43                             ` John Carter Wood
     [not found]                               ` <b3deb0de-8ba0-4159-b9f3-1ecfbe68d457n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-07-02 20:02                                 ` BPJ
     [not found]                                   ` <CADAJKhAU66TxJKMZdDM-KVabJpmKUVo5xyuAAN03F2b89jv9Ow-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2022-07-03  5:41                                     ` Paulo Ney de Souza
     [not found]                                       ` <CAFVhNZMyj_GZ=Ao_1qR2rwnAAYAaQ=Maf880cGLRv7yD_ianpQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2022-07-03 12:15                                         ` BPJ
     [not found]                                           ` <CADAJKhBjTdgbY-xDouhDGfnE+J+V5c3v0FUA2Hn00z59==WeLw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2022-07-03 16:53                                             ` Paulo Ney de Souza
     [not found]                                               ` <CAFVhNZNNsfQs_Lt8agoaseyrNfdhrVOC9GTusMEdfecJFCBnug-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2022-07-03 19:43                                                 ` BPJ
     [not found]                                                   ` <CADAJKhCjht=mJqUgEbyHQWcp+P5gKjYUoEfe4VQAOa6SS1b5Ag-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2022-07-04  9:09                                                     ` BPJ
2022-07-01 16:54                             ` AW: " Sukil Etxenike arizaleta
     [not found]                               ` <6621a84d-37f3-6741-bb0a-d4bfd6dac4bf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2022-07-01 17:28                                 ` Sukil Etxenike arizaleta
2022-07-05 10:02                             ` John Carter Wood
     [not found]                               ` <5c2a1a00-28b9-4846-9541-92baaf0d5200n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-07-05 10:16                                 ` Albert Krewinkel
     [not found]                                   ` <87h73vj1m1.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
2022-07-05 11:45                                     ` John Carter Wood
     [not found]                                       ` <1ebf2a90-159e-4445-bf3a-b068526877cbn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-07-05 11:49                                         ` Albert Krewinkel
     [not found]                                           ` <87czejixon.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
2022-07-05 12:02                                             ` John Carter Wood
2022-07-05 12:05                                         ` Sukil Etxenike arizaleta
2022-07-05 15:50                                         ` denis.maier-NSENcxR/0n0 [this message]
     [not found]                                           ` <2bb67f22fc3044088f798c777f3684d2-NSENcxR/0n0@public.gmane.org>
2022-07-07 19:05                                             ` AW: " denis.maier-NSENcxR/0n0
2022-07-05 10:38                                 ` denis.maier-NSENcxR/0n0
2022-07-02 16:28         ` BPJ

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2bb67f22fc3044088f798c777f3684d2@unibe.ch \
    --to=denis.maier-nsencxr/0n0@public.gmane.org \
    --cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).