From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/16466 Path: news.gmane.org!.POSTED!not-for-mail From: Albert Krewinkel Newsgroups: gmane.text.pandoc Subject: Panlunatic filtering: modifying documents without external software Date: Sun, 18 Dec 2016 00:42:16 +0100 Message-ID: <877f6yp1gn.fsf@espresso.zeitkraut.de> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: blaine.gmane.org 1482018148 15218 195.159.176.226 (17 Dec 2016 23:42:28 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 17 Dec 2016 23:42:28 +0000 (UTC) To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCZJF7XJTILRBYU227BAKGQEUUH2IBA-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sun Dec 18 00:42:22 2016 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-wm0-f63.google.com ([74.125.82.63]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cIOcP-00038n-Ua for gtp-pandoc-discuss@m.gmane.org; Sun, 18 Dec 2016 00:42:21 +0100 Original-Received: by mail-wm0-f63.google.com with SMTP id g23sf19391388wme.1 for ; Sat, 17 Dec 2016 15:42:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:from:to:subject:date:message-id:mime-version :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=VHBj8evUgnurQlISBu9DQbpKc2c1I0y+Bxo1eEzfiqo=; b=kf8LwrJM4xzIqgBEW0OC9EYe0Vwrg7L99BFmbsXPxE+EKNqs1wuW/R2bQ/KJPIgYIu VQrS9e40nojvHSZdQXTY9wchr66b0Cqv2sehE8mwquJQZepMHnW/oWMkXi6xQ1AbrKsb Auh2aahRxc7sfUHdqfoKAiONHXth981T3ryzxIcjgmZTSVNdtzu5sM5RBQwCDW4nHO3g Padxnd1cAri4OcsujuAHGTRU0ZHxiSlAzCqj3+wW9WZfMQ4KsyT9Lqzv3i57Eid0Mz7T 3EydB5UcqW+6dzh31KyW8xzwaOr3X9AbbmMvGkmDaWnaSmdBYF0iWxpBVN2JIOYg6umP Bb/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:from:to:subject:date:message-id :mime-version: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=VHBj8evUgnurQlISBu9DQbpKc2c1I0y+Bxo1eEzfiqo=; b=hCvYOkfXDKtYFOTe/91YoIJ/tNyk3NTe/dbXOrnVFP4gr7emV6/bo6Nm1sE953giyn hvMLd6Sn2gY+DcvQqEOoLuCePgLugabbVJ8j+mQCkGr5colrK5yF6XITklDK7qH4D/E4 LqadRh1IEjmT5dVqE8kZ/TSFvVEZS+U38u3I2FRcvTVSt7e+EGW81I36qHidgEjoTERd RpgOMx6SH2wSLJehdV5OEherx91eYUbePfuaF3WaiDp9ghi5Bfn5cV7Cf+zhnoTfcsQQ IJBsMPa/pFpDj0mRO9bjZORZkZPw9IY6apubpC8SFJPPe36WoPzEApSta//Jp8210yqc vCKg== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AKaTC01THhD2sTLQVyaj5QH0zjqAKzU3QFmOxYkteAZR24vNSzKroR4W5My1dHqQ7eKWWA== X-Received: by 10.25.92.15 with SMTP id q15mr75857lfb.16.1482018146552; Sat, 17 Dec 2016 15:42:26 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.46.77.146 with SMTP id c18ls829040ljd.22.gmail; Sat, 17 Dec 2016 15:42:25 -0800 (PST) X-Received: by 10.46.78.2 with SMTP id c2mr900968ljb.20.1482018145820; Sat, 17 Dec 2016 15:42:25 -0800 (PST) Original-Received: from mx2.mailbox.org (mx2.mailbox.org. [80.241.60.215]) by gmr-mx.google.com with ESMTPS id d22si956057wmd.0.2016.12.17.15.42.25 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 17 Dec 2016 15:42:25 -0800 (PST) Received-SPF: pass (google.com: domain of albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org designates 80.241.60.215 as permitted sender) client-ip=80.241.60.215; Original-Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx2.mailbox.org (Postfix) with ESMTPS id 10C7F43165 for ; Sun, 18 Dec 2016 00:42:25 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Original-Received: from smtp1.mailbox.org ([80.241.60.240]) by hefe.heinlein-support.de (hefe.heinlein-support.de [91.198.250.172]) (amavisd-new, port 10030) with ESMTP id FM0gTawc1Zqb for ; Sun, 18 Dec 2016 00:42:22 +0100 (CET) X-Original-Sender: albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org designates 80.241.60.215 as permitted sender) smtp.mailfrom=albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org; dmarc=pass (p=NONE dis=NONE) header.from=zeitkraut.de 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:16466 Archived-At: Hello, writing maximally portable filters is difficult, as filters always require additional software to be installed next to the pandoc binary. In certain cases, this might make it impossible to use filters in collaborative writing. I wrote a custom [panlunatic] writer, which outputs JSON. This makes it possible to perform some minor modifications to the document using lua, and without the need for additional software. The script is very limited and far from exposing a user-friendly API in the style of panflute and friends: If you want to modify an element, you'll currently have to decode the element's JSON representation, modify the resulting table, and re-encode the result to JSON again. It's as ugly as it sounds. I plan to implement a nicer API in the future. The project is in very early alpha state. Feedback, criticism, or pull request are welcome. Cheers, Albert [panlunatic]: https://github.com/tarleb/panlunatic -- Albert Krewinkel GPG: 8eed e3e2 e8c5 6f18 81fe e836 388d c0b2 1f63 1124