public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: Bastien DUMONT <bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org>
To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: Re: Substitute a string between custom delimiter in markdown file
Date: Thu, 27 Oct 2022 14:58:58 +0000	[thread overview]
Message-ID: <Y1qcstItC44BCEdd@localhost> (raw)
In-Reply-To: <138750e5-0ff6-4854-bc5a-26b32b085dd3n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>

Is it mandatory for you to use this syntax? It would be easier with spans:

[Gianluca]{.personaldata .name}
[Via anon]{.personaldata .address}

Then, if you want them to be printed, do nothing. If you want them to be masked, pass a filter like:

function Span(span)
  if span.classes:includes('personaldata') then
    span.content = pandoc.Str('xxxxxxx')
  end
  return span
end

Le Thursday 27 October 2022 à 07:06:03AM, Gianluca Carbone a écrit :
> Hello guys,
> 
> I try to process a markdown file where I put some custom delimiter like:
> 
> [name] Gianluca [\name]
> [address] Via anon [\address]
> 
> What I want to do is write some custom writer or a filter in pandoc that can
> substitute the content of that delimiter with "xxxxxxx", in order to hide
> personal information.
> 
> How can I write some line of code that return me a markdown document anonimized
> ?
> 
> Thanks in advance!
> 
> 
> --
> 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 [1]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit [2]https://groups.google.com/d/msgid/
> pandoc-discuss/138750e5-0ff6-4854-bc5a-26b32b085dd3n%40googlegroups.com.
> 
> References:
> 
> [1] mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
> [2] https://groups.google.com/d/msgid/pandoc-discuss/138750e5-0ff6-4854-bc5a-26b32b085dd3n%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/Y1qcstItC44BCEdd%40localhost.


      parent reply	other threads:[~2022-10-27 14:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-27 14:06 Gianluca Carbone
     [not found] ` <138750e5-0ff6-4854-bc5a-26b32b085dd3n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-10-27 14:58   ` Bastien DUMONT [this message]

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=Y1qcstItC44BCEdd@localhost \
    --to=bastien.dumont-vwifzpto/vqstnjn9+bgxg@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).