public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* Lists and interwiki links in MediaWiki output
@ 2022-10-10 16:06 BPJ
       [not found] ` <CADAJKhCP5bfNanp9XfS6Zb0noGziON4+L7XjkbOBqYO2K=DXuA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: BPJ @ 2022-10-10 16:06 UTC (permalink / raw)
  To: pandoc-discuss

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

I'm converting a set of HTML pages to MediaWiki format for a friend. I
noticed that all lists are output as HTML elements (dl/ol/ul → dt/dd/li →
p). Am I right that this is because (most) of them contain (multiple) block
level elements? Will they be output as native MW lists if I convert lists
of blocks into lists of inlines separated by raw HTML `<br /><br />`
elements in a Plain (or Para) element? (Not that I'm sure it's worth it,
but in case they want it!) I'm already converting definition list items
into sections since DLs are mostly used that way in the HTML pages.

Also I would like to convert http(s) links to Wikipedia into proper
interwiki links. It seems like a Markdown link like `[Foo](wp:Foo)` becomes
an interwiki link when converting to MW, so will massaging the target of
links to Wikipedia this way in Lua achieve that? Also it seems link as in
`[Foo](Foo)` will result in an intrawiki link. What is it that triggers
conversion into a wiki link? The absence of a valid protocol?

TIA,

/bpj

-- 
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/CADAJKhCP5bfNanp9XfS6Zb0noGziON4%2BL7XjkbOBqYO2K%3DDXuA%40mail.gmail.com.

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

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

* Re: Lists and interwiki links in MediaWiki output
       [not found] ` <CADAJKhCP5bfNanp9XfS6Zb0noGziON4+L7XjkbOBqYO2K=DXuA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2022-10-11 18:19   ` John MacFarlane
  0 siblings, 0 replies; 2+ messages in thread
From: John MacFarlane @ 2022-10-11 18:19 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw



> On Oct 10, 2022, at 9:06 AM, BPJ <melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> 
> I'm converting a set of HTML pages to MediaWiki format for a friend. I noticed that all lists are output as HTML elements (dl/ol/ul → dt/dd/li → p). Am I right that this is because (most) of them contain (multiple) block level elements?

Correct.

> Will they be output as native MW lists if I convert lists of blocks into lists of inlines separated by raw HTML `<br /><br />` elements in a Plain (or Para) element?

It might, you could try.  I can't recall what the restrictions are on MW lists; it may be that there are problems including breaks at all, in which case we may also disallow breaks.


> (Not that I'm sure it's worth it, but in case they want it!) I'm already converting definition list items into sections since DLs are mostly used that way in the HTML pages.
> 
> Also I would like to convert http(s) links to Wikipedia into proper interwiki links. It seems like a Markdown link like `[Foo](wp:Foo)` becomes an interwiki link when converting to MW, so will massaging the target of links to Wikipedia this way in Lua achieve that?

It should.

> Also it seems link as in `[Foo](Foo)` will result in an intrawiki link. What is it that triggers conversion into a wiki link? The absence of a valid protocol?


It's a relative URL that matches the link text.

-- 
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/2EA1F1AF-6120-40CF-90E3-F311D74AE90B%40gmail.com.


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

end of thread, other threads:[~2022-10-11 18:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-10 16:06 Lists and interwiki links in MediaWiki output BPJ
     [not found] ` <CADAJKhCP5bfNanp9XfS6Zb0noGziON4+L7XjkbOBqYO2K=DXuA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2022-10-11 18:19   ` John MacFarlane

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