From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/23302 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: BPJ Newsgroups: gmane.text.pandoc Subject: Re: Will there ever be a standard wiki-link? Date: Sat, 24 Aug 2019 12:06:48 +0200 Message-ID: <93baab2f-5229-5985-2332-aa503eee0b95@gmail.com> References: Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------359D959D38A19D0D792EF191" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="17046"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCWMVYEK54FRBO4YQTVQKGQEN7YWGWQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sat Aug 24 12:06:54 2019 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-lf1-f64.google.com ([209.85.167.64]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1i1Swf-0004J2-GO for gtp-pandoc-discuss@m.gmane.org; Sat, 24 Aug 2019 12:06:53 +0200 Original-Received: by mail-lf1-f64.google.com with SMTP id g4sf1743791lfj.11 for ; Sat, 24 Aug 2019 03:06:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1566641213; cv=pass; d=google.com; s=arc-20160816; b=ahn+OXaw3PInCellwHfmL3cxsZJHbABAb6rusGEjC47gfbX36AHODDrfvWOmIl68DH suPcD4RLT3ivS3/qSSt5xdcEAQvYeJa3DVqoBmzxgPlxj09weBigsifnTt/vjclJiZw4 wHuhBG5e69Q7QE5DsS/GoHP+B6AOlB5/E1Krt9ZzlStTwsm/xXeGRMYWDyV1zO8HXrY3 A4eFQlpk6T2TyzPlrgwZ82iT0JxL7ZYgG5H+iRRNhKYKMhD4wi6EzGFGaAgwcndUucpr V2qd9/V57iRNMbUWvbbmpD1A/cubvcqGNwBzYjldYoOlDyCddkkbMaMs6/HVx+DegBN0 GlrA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :to:subject:sender:dkim-signature:dkim-signature; bh=/MnyapKhkymQ6tUFwj5I8FuMv8y8fl4iUXf0cpVYorQ=; b=eJkRVXF19Bb0+R69aWeZLL7wUe4CNfVx/oDj6Veim9hfFdmStAWo7RIh7K+WWDvxcW t77V7F2JqOHkfMM/YmWtOUDlorar5bYvNCzres7YqYUq5aSiV7cBXqZBTUhm3/PHkdKc /4nqre76K6AXnTQkQduPA6l/xBP0HyK0q487SLipwgc4EnxaS0vBN6Uo2YiY0iGHW0yu 5nuBXDo/huTTgPlt5Ea7jRsPFCFnjFlbn5h2qdj2j5f0YW1W1hdIFK4tLHZJ7nD+E5v5 +z0StcCrufE+iD7atVu2MZpNP28vqYkd7MCsing2VeboKmqm54iX+WaQX4Sc1LYJzQUp 5cCA== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=vZuEaJYs; spf=pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::535 as permitted sender) smtp.mailfrom=melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:list-subscribe :list-unsubscribe; bh=/MnyapKhkymQ6tUFwj5I8FuMv8y8fl4iUXf0cpVYorQ=; b=CIH3BCPeuNJFWf7olYTbC545gPKByj4XLyNEMy3h7N9PT9CmMmHAKtvn2wP31X9A8e 4bI5/E0AH+N7QQ6ifAKO1uEwpZ35um0rJrvyItPtGWYitS9/sleVTVIrixF6V37tlyvL o7mXcilbqnLndxVNKmsy+TRytYM8KZIb8WkscjIhXHaPhI39kE7dzl2y5imRew95R0rm dpPz5uHHPhZdw4mu1xM/lQrWKolzqKGk8B6s86XWa8TMFAoh6LGUQB4tvauGxJjq2PqZ Y9Cta9L2HwuPs7FWEWCGNKQrhjmIm602zFx7lk/Lsc0IxZWZIw9lyOWwBwe8tCEL15b6 RWYg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:list-subscribe :list-unsubscribe; bh=/MnyapKhkymQ6tUFwj5I8FuMv8y8fl4iUXf0cpVYorQ=; b=XRBJM/a0sodAdJe4PtsnHuQLQ87AFdSOq8AQyxYFATr2yzhSjfYjAJU+l6j5LWfU4j 5C8ZfbtCM/6vzjOEAnqe78q1oQHkIogResMRBWMU2ylsU+rRaBVIs/VhHIaBsha1FL8T mpIpeHFzDrIfH6FxvwHS0PtCsLXWtySmacw7A+H54j3v1NpxTIKykmXNrPIUgiHtIAjc VFsDTtvOepurFWA1+mR9erZ1cWWg2Mni0ScceYlVCLZzoxFeH/QR8ZwTHQ21EktQKMgO 84x2knfdG/bpjSHU5KPDfGRNCgyM098rGlTFqg6B+sAAfIp9j4A8Y9rU9qXOdA5lEFyt tNlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :x-original-sender:x-original-authentication-results:reply-to :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=/MnyapKhkymQ6tUFwj5I8FuMv8y8fl4iUXf0cpVYorQ=; b=oowTL+Xf2lR1IroNeQQaVJ6zZqsFMrGYt54SKgZ1Z3Ucvfd/PZhA/KGQuifx1MzQIh mNN0KUAztzV9kfbKXF8/ips4jRJhMGdLkEwfXwGpxk8UoS3d0Ukd5zj9AXcYGMYBFySD izTI8BG+Nl20Y7h90U293mplnlf7NqOgcrzBmglWLCXOrH8aasmIekTYgs6/EXmzpK+E OdwjkeTNzI1YyYdWanwsADs0N9unEspDLJEpbsJ/Hy9rHypm7Vz+v7XhmK5iAv8D9OnL BWYrurAI3I/tmf7fLwaPdZr6zkAGAKb4RQ8CttaliKrpO7t5C6cAK1fb87d3RjsazyJ+ Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: APjAAAUeNArHURyvh7zAin+77x+Yf9XdtUNDxlYGtybPzxu9PYq+M7Ra ZP5jmFFw7sga3gWnytdM94s= X-Google-Smtp-Source: APXvYqxSvnZ8uhBwRacwgmW9aiJGpE9nCRZ2f2X5yXe6NUs+0XgDxC+x5rMWP0zJ82lZtkrWx70igA== X-Received: by 2002:a2e:8004:: with SMTP id j4mr5297771ljg.231.1566641212917; Sat, 24 Aug 2019 03:06:52 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a2e:91d9:: with SMTP id u25ls1351652ljg.15.gmail; Sat, 24 Aug 2019 03:06:51 -0700 (PDT) X-Received: by 2002:a2e:9196:: with SMTP id f22mr5427305ljg.78.1566641211250; Sat, 24 Aug 2019 03:06:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566641211; cv=none; d=google.com; s=arc-20160816; b=r43IX3B3M9TaNM40XG8aDzi9mBavkN97whBBSwSJlZlRzGLB+BVxZRoIQpvy08ONuf hVYChyInPks2/QS9Z5sE7S22joHiP+z+pK5u/npfONicw2N9mqWhBIp2xEW8WRuzOUOC s8Z8YJBMm9v6o5TqITiIHIv4c5T6yLKXTz6MRsyIovOg+OKF6Jtj4kLjOoE5mq8Ug9Oj B1qTt9Pgb+zgX1g+G8Xg7bmecptQJVWEiOmWewBaNh/X1zxlF8WpkozOGfI0pgGBAv3d vtNB8y0bDTrdXjdi/gtjMm68ZOO4am1Q+ZwUJZCUDEx278NPxkKcOPL6V5OPArcrMkgG qLgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject:dkim-signature; bh=2iwTAw/7HGmsulox9QGbwJvKvAzNLoBb7QK5jgQWs2o=; b=PyMLi9DjzGbDejfLa19dM0RlhTCqW+EOsnWQ53LPWQe83JEI9u7FaDjUhj4EL0JgCJ lYl328uq3D4yhyK5N12Lz6CGyj7KY4QXImh6IiQ3nGxEDLzLmSnATYVnDUPgJFCcnSFb GI06hNcZEE5eU+GV6ymoA98fqRqa264ve0j5NwtEU1Iax3uj+Ngyz52uw4YRZtC0BjPW yn0zu0J40YuzkBaRXAAWJUFBaH1qznRGHLpXJGC8+xxJCwhEu5vnNfBi7Gw+/LQmrgkv hdGyaOiv+eaXyVdoSfWDCQIqTDEJ16UzigKOEwbsKMtDD+10ycVTJo+ffz/LaE2IbsC+ Dmzw== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=vZuEaJYs; spf=pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::535 as permitted sender) smtp.mailfrom=melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Original-Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com. [2a00:1450:4864:20::535]) by gmr-mx.google.com with ESMTPS id t23si279139lfk.2.2019.08.24.03.06.51 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 24 Aug 2019 03:06:51 -0700 (PDT) Received-SPF: pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::535 as permitted sender) client-ip=2a00:1450:4864:20::535; Original-Received: by mail-ed1-x535.google.com with SMTP id g8so17774865edm.6 for ; Sat, 24 Aug 2019 03:06:51 -0700 (PDT) X-Received: by 2002:a17:906:bceb:: with SMTP id op11mr8254059ejb.2.1566641210685; Sat, 24 Aug 2019 03:06:50 -0700 (PDT) Original-Received: from [192.168.1.122] (user141.77-105-220.netatonce.net. [77.105.220.141]) by smtp.gmail.com with ESMTPSA id fk15sm1014378ejb.42.2019.08.24.03.06.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 24 Aug 2019 03:06:49 -0700 (PDT) In-Reply-To: Content-Language: en-US X-Original-Sender: melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=vZuEaJYs; spf=pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::535 as permitted sender) smtp.mailfrom=melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Precedence: list Mailing-list: list pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; contact pandoc-discuss+owners-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-ID: X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.org gmane.text.pandoc:23302 Archived-At: This is a multi-part message in MIME format. --------------359D959D38A19D0D792EF191 Content-Type: text/plain; charset="UTF-8"; format=flowed On 2019-08-21 18:08, Joseph Reagle wrote: > I'm noticing folks building wikis using markdown increasingly adopting the convention [[local link]]. However, gitit uses [local link](). Any chance one of these will be standardized or adopted by Pandoc? > The attached Lua filter kind of does the trick if you want to generate Markdown e.g. for GitHub wikis. It converts three different "syntaxes" into wiki link syntax: Get [[...]] style wiki links in Pandoc Markdown output: [PAGE NAME]() becomes [[PAGE NAME]] (Formatting is lost) [FORMATTED TEXT]{wiki="PAGE NAME"} becomes [[PAGE NAME|FORMATTED TEXT]] `TEXT`{.wiki} becomes [[TEXT]] (Very fast!) $ pandoc --lua-filter wiki-links.lua -w gfm [foo]() [*bar*]{wiki="baz"} `quux`{.wiki} ^D [[foo]] [[baz|*bar*]] [[quux]] -- 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/93baab2f-5229-5985-2332-aa503eee0b95%40gmail.com. --------------359D959D38A19D0D792EF191 Content-Type: text/x-lua; name="wiki-links.lua" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="wiki-links.lua" --[=====================================================================[ Get [[...]] style wiki links in Pandoc Markdown output: [PAGE NAME]() becomes [[PAGE NAME]] (Formatting is lost) [FORMATTED TEXT]{wiki="PAGE NAME"} becomes [[PAGE NAME|FORMATTED TEXT]] `TEXT`{.wiki} becomes [[TEXT]] (Very fast!) $ pandoc --lua-filter wiki-links.lua -w gfm [foo]() [*bar*]{wiki="baz"} `quux`{.wiki} ^D [[foo]] [[baz|*bar*]] [[quux]] --]=====================================================================] local wiki_class = "wiki" -- feel free to change this to e.g. "w" function Link (elem) if "" == elem.target then local text = pandoc.utils.stringify(elem) return { pandoc.RawInline('markdown', '[[' .. text .. ']]' ) } end return nil end function Code (elem) if elem.classes:includes(wiki_class) then return { pandoc.RawInline('markdown', '[[' .. elem.text .. ']]') } end return nil end function Span (elem) local wiki = elem.attributes[wiki_class] if wiki then -- construct the part before the formatted text prefix = pandoc.RawInline('markdown', '[[' .. wiki .. '|') -- the part after the formatted text suffix = pandoc.RawInline('markdown', ']]') -- the formatted text == the span content local content = elem.content -- prepend the prefix table.insert(content, 1, prefix) -- append the suffix most efficiently content[#content+1] = suffix return content end return nil end --[=====================================================================[ This software is Copyright (c) 2019 by Benct Philip Jonsson. This is free software, licensed under: The MIT (X11) License The MIT License Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --]=====================================================================] -- Vim: set ft=lua sw=2 sts=2 et fdm=indent: --------------359D959D38A19D0D792EF191--