public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: Albert Krewinkel <albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: Re: Removing local URL protocols when converting to HTML?
Date: Tue, 20 Dec 2022 07:18:49 +0100	[thread overview]
Message-ID: <87sfhatx3m.fsf@zeitkraut.de> (raw)
In-Reply-To: <732b167f-0380-8ba6-9385-762601ee4b56-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

You probably want a filter like this (untested):

``` lua
function Link (link)
  if link.target:match '^outlook:' then
    return link.content
  end
end
```

Balaji Dutt <balaji.dutt-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> Hello,
>
>
> I am using Dendron as a personal knowledge management solution and
> from time to time, need to send some meeting notes that I take to
> others. Typically, my meeting notes will look something like this:
>
>
> #### Notes
> 1. Steal Underpants
> 2. ???
> 3. Profit!
>
> #### References
> - [Plan for world domination](outlook:<GUID>)
> - [Contingency Plan](https://www.example.com)
>
>
> As you can see the "References" section includes a "link" to an
> Outlook GUID. I'm using the Outlook Protocol handler (More info) to
> deep link to specific messages in my Inbox.
>
> Now while this works really nicely for me, it's not very useful when
> I share my notes with others. I'm trying to figure out if there's a
> way for me in Pandoc to setup a filter such that if Pandoc encounters
> these type of "outlook" links, it deletes the link leaving just the
> Link description. In other words, the output HTML for the above
> example would (ideally) look like this:
>
>
> <h4 id="references>References</h4>
> <ul>
> <li>[Plan for world domination]</li>
> <li><a href="https://www.example.com>Contingency Plan</a></li>
> </ul>
>
>
> I've tried various combinations of keywords on "url", "filter",
> "link" etc but that has not yielded much result. I'm pretty sure this
> is not a very common problem and hence I'm hoping the group can help
> me figure out.
>
> I should also say as I'm using pandoc at my $dayjob which is a
> heavily restricted environment, I'm limited to an extremely old
> version of pandoc (v2.2.3) which is very unfortunate but also not
> easily resolvable.
>
> -- 
> Balaji Dutt


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


  parent reply	other threads:[~2022-12-20  6:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-20  3:41 Balaji Dutt
     [not found] ` <732b167f-0380-8ba6-9385-762601ee4b56-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2022-12-20  6:18   ` Albert Krewinkel [this message]
     [not found]     ` <87sfhatx3m.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
2022-12-20 10:32       ` balaj...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

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=87sfhatx3m.fsf@zeitkraut.de \
    --to=albert+pandoc-9eawchwdxg8hfhg+jk9f0w@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).