public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Removing local URL protocols when converting to HTML?
@ 2022-12-20  3:41 Balaji Dutt
       [not found] ` <732b167f-0380-8ba6-9385-762601ee4b56-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Balaji Dutt @ 2022-12-20  3:41 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

[-- Attachment #1: Type: text/plain, Size: 2009 bytes --]

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 
<https://www.slipstick.com/problems/outlook-missing-outlook-protocol/>) 
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

-- 
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/732b167f-0380-8ba6-9385-762601ee4b56%40gmail.com.

[-- Attachment #2: Type: text/html, Size: 3746 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Removing local URL protocols when converting to HTML?
       [not found] ` <732b167f-0380-8ba6-9385-762601ee4b56-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2022-12-20  6:18   ` Albert Krewinkel
       [not found]     ` <87sfhatx3m.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Albert Krewinkel @ 2022-12-20  6:18 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Removing local URL protocols when converting to HTML?
       [not found]     ` <87sfhatx3m.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
@ 2022-12-20 10:32       ` balaj...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
  0 siblings, 0 replies; 3+ messages in thread
From: balaj...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org @ 2022-12-20 10:32 UTC (permalink / raw)
  To: pandoc-discuss


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

Worked well enough for me. Thank you very much!

On Tuesday, 20 December 2022 at 14:20:37 UTC+8 Albert Krewinkel wrote:

> 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 <balaj...-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
>

-- 
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/115263e1-d1c1-45b6-b812-bce6f074f459n%40googlegroups.com.

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-12-20 10:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-20  3:41 Removing local URL protocols when converting to HTML? Balaji Dutt
     [not found] ` <732b167f-0380-8ba6-9385-762601ee4b56-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2022-12-20  6:18   ` Albert Krewinkel
     [not found]     ` <87sfhatx3m.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org>
2022-12-20 10:32       ` balaj...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

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).