From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/16408 Path: news.gmane.org!.POSTED!not-for-mail From: Scott Koga-Browes Newsgroups: gmane.text.pandoc Subject: Re: 'pandoc-abbreviations' python filter: request for advice/guidance Date: Tue, 13 Dec 2016 17:07:23 -0800 (PST) Message-ID: <84e22559-d5c8-4526-ab86-80574ec92a07@googlegroups.com> References: <58db4764-ca7b-4f84-893a-6d6f3260fe47@googlegroups.com> <5c74ed41-79f3-4566-9616-10b2e1224102@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_1564_1429505616.1481677644113" X-Trace: blaine.gmane.org 1481677646 17513 195.159.176.226 (14 Dec 2016 01:07:26 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 14 Dec 2016 01:07:26 +0000 (UTC) To: pandoc-discuss Original-X-From: pandoc-discuss+bncBDNPRGUAYELBBTFWYLBAKGQE7YOKW6I-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Wed Dec 14 02:07:22 2016 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-pg0-f61.google.com ([74.125.83.61]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cGy2T-0003ot-2J for gtp-pandoc-discuss@m.gmane.org; Wed, 14 Dec 2016 02:07:21 +0100 Original-Received: by mail-pg0-f61.google.com with SMTP id x23sf5382844pgx.1 for ; Tue, 13 Dec 2016 17:07:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=sender:date:from:to:message-id:in-reply-to:references:subject :mime-version:x-original-sender:reply-to:precedence:mailing-list :list-id:x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=VGKdH9QSvUqalCQwd3baR1jUkLKsNwoD0Pvle5m7ASM=; b=TAywIO/JLzXaYzNgu4Vtzu0/d+G3A+qXbqrmQYQRuIsSV8KaxGeYt47zQ3BBZiSEUY keTGFN8U8lV9g0FZdlJEe3n6YlHAq+Eu70sqnldeio7uGEPoktIxBW/ipcEqXJK2yT1E H2+BtoLeSTT330iggmVzq5MyRso0NXj5uVKUSY4mbu0a7c59vy9lwbucMtzJLa6QZ/6M TaEtCoqnE2KQKgljqXA7lhLRuADVoU25+EMG4wPK/36zmOU8QnT5FBnjRIHKtheiG4C5 OyrZnXplqPlhK2Q7tuNOI3O431zqnVDDlI3U/3bJw2hi1vfbl/VoLJH1loKLaps6Sf2U Ebjg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:message-id:in-reply-to:references:subject:mime-version :x-original-sender:reply-to:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=VGKdH9QSvUqalCQwd3baR1jUkLKsNwoD0Pvle5m7ASM=; b=JcvBRSrevPxSinPlRQcO/8wXemdknFgWJpZopKxOYEMhzreVCwu84Hwc/FWbW7tF20 J/7LMSw9uc3qn9Cz9HnhoZa6HVNmj4bd7afOONGyDXQcY+MDwvHrQ0IKqgqL92lbFAxm EJna7IsfqbzR85hv6aYeL5F62+ZQubc5FjGsz+7pR65h/4XUsymXd0cvBxMidDbOkUzU mOg/gtb+OjgxQbQA6aM8tDAm3mSO09laFURBIC3kD4nPUI1xDV3yGhHdjHdQZmYIpYyC Z2zd2nsNfJ51WGSnQB0k6T36aSRpQkhvorDUaXf7kZu+bsZt/OJ99pV5oea7UTx7RZON /sug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=sender:x-gm-message-state:date:from:to:message-id:in-reply-to :references:subject:mime-version:x-original-sender:reply-to :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=VGKdH9QSvUqalCQwd3baR1jUkLKsNwoD0Pvle5m7ASM=; b=FaP9j54SuiZ7CQzO+nWAC+DImPp3/rwCkNiak0J9TmtQoSYVFYWF3fbUW014ZL/JIf F8hvte8auSpiHkpJs/RjZMJ+fi4cwHR9t8C6+riSg2CvujKAAlcVmw6oEbJKUPLYG1gB 4Ts44XQU0jQ1KWKRz9f/Z0dQxQI/l42OVJj37tfq5urYww2wQ621nSHZOXKz+tE6ovL3 yu2HZgNeqL8mUwg5nXFkidrXmwNs5kWHuQbdAr6txgj1F2jCu8RjUs2gTIbMuR+uzMDx 6a3KOaOLxm4NH/4DvnYJc0e+s+9Bv2tO6lA1e4AmmcgKlAxuj0dtYywPuR+tWe89ElAe ejKw== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AKaTC01o93mAgj6LM9TFhNps0zl2CzygNhQOdIqG4RYvcQAOk2k99Pjaz3d51QhAzMAjhw== X-Received: by 10.157.11.248 with SMTP id 111mr6550774oth.4.1481677645073; Tue, 13 Dec 2016 17:07:25 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.157.34.166 with SMTP id y35ls2627898ota.49.gmail; Tue, 13 Dec 2016 17:07:24 -0800 (PST) X-Received: by 10.157.11.248 with SMTP id 111mr6550772oth.4.1481677644690; Tue, 13 Dec 2016 17:07:24 -0800 (PST) In-Reply-To: <5c74ed41-79f3-4566-9616-10b2e1224102-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> X-Original-Sender: kogabrowes-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org 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:16408 Archived-At: ------=_Part_1564_1429505616.1481677644113 Content-Type: multipart/alternative; boundary="----=_Part_1565_689675484.1481677644114" ------=_Part_1565_689675484.1481677644114 Content-Type: text/plain; charset=UTF-8 Thanks for that. Wish I'd noticed stringify() a bit earlier, would've saved myself a lot of confusion. Anyway, the new stringify-using version is now up, seems to be quicker too. Many thanks! On Wednesday, 14 December 2016 06:21:12 UTC+9, Sergio Correia wrote: > > The checks for spaces and all that part can be replaced with a call to the > stringify() function, but besides that it looks good to me. > > On Tuesday, December 13, 2016 at 3:41:33 AM UTC-5, Scott Koga-Browes wrote: >> >> I have created a python filter which replaces user-definable >> abbreviations (stored in a dictionary file and/or in a pandoc markdown >> source document's metadata) with their expansions. This is my attempt to >> replicate the kind of possibilities offered by LaTeX macros like >> \newcommand{\osh}{oshigami}, i.e. write '\osh', get 'oshigami' when the >> document is processed. In the past I've found this very useful for >> maintaining consistency throughout a document, and I missed this when I >> moved to writing in markdown. >> >> I'm not really a programmer but - based on what I could understand from >> looking at other python filters out there - I managed to slap together >> something which seems to do what I want it to. However, I'm not really >> competent to judge whether it's fit for 'general consumption' and I am >> hoping there might be people out there willing to spend a few minutes to >> take a look at it and advise me on what needs to be done to make it >> 'roadworthy'. >> >> This is the repository: https://github.com/scokobro/pandoc-abbreviations >> >> Thanks in advance! >> > -- 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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/84e22559-d5c8-4526-ab86-80574ec92a07%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. ------=_Part_1565_689675484.1481677644114 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Thanks for that. Wish I'd noticed stringify() a bit ea= rlier, would've saved myself a lot of confusion. Anyway, the new string= ify-using version is now up, seems to be quicker too. Many thanks!

O= n Wednesday, 14 December 2016 06:21:12 UTC+9, Sergio Correia wrote:
The checks for = spaces and all that part can be replaced with a call to the stringify() fun= ction, but besides that it looks good to me.

On Tuesday, December 13= , 2016 at 3:41:33 AM UTC-5, Scott Koga-Browes wrote:
I have created a python filter which= replaces user-definable abbreviations (stored in a dictionary file and/or = in a pandoc markdown source document's metadata) with their expansions.= This is my attempt to replicate the kind of possibilities offered by LaTeX= macros like=C2=A0\newcommand{}{= oshigami}, i.e. write '\osh', get 'oshigami' = when the document is processed. In the past I've found this very useful= for maintaining consistency throughout a document, and I missed this when = I moved to writing in markdown.

I'm not really a programme= r but - based on what I could understand from looking at other python filte= rs out there - I managed to slap together something which seems to do what = I want it to. However, I'm not really competent to judge whether it'= ;s fit for 'general consumption' and=C2=A0I am hoping= there might be people out there willing to spend a few minutes to take a l= ook at it and advise me on what needs to be done to make it 'roadworthy= '.=C2=A0


Thank= s in advance!

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pand= oc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/= msgid/pandoc-discuss/84e22559-d5c8-4526-ab86-80574ec92a07%40googlegroups.co= m.
For more options, visit http= s://groups.google.com/d/optout.
------=_Part_1565_689675484.1481677644114-- ------=_Part_1564_1429505616.1481677644113--