* 'pandoc-abbreviations' python filter: request for advice/guidance @ 2016-12-13 8:41 Scott Koga-Browes [not found] ` <58db4764-ca7b-4f84-893a-6d6f3260fe47-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> 0 siblings, 1 reply; 3+ messages in thread From: Scott Koga-Browes @ 2016-12-13 8:41 UTC (permalink / raw) To: pandoc-discuss [-- Attachment #1.1: Type: text/plain, Size: 1631 bytes --] 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/58db4764-ca7b-4f84-893a-6d6f3260fe47%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. [-- Attachment #1.2: Type: text/html, Size: 3221 bytes --] ^ permalink raw reply [flat|nested] 3+ messages in thread
[parent not found: <58db4764-ca7b-4f84-893a-6d6f3260fe47-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>]
* Re: 'pandoc-abbreviations' python filter: request for advice/guidance [not found] ` <58db4764-ca7b-4f84-893a-6d6f3260fe47-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> @ 2016-12-13 21:21 ` Sergio Correia [not found] ` <5c74ed41-79f3-4566-9616-10b2e1224102-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> 0 siblings, 1 reply; 3+ messages in thread From: Sergio Correia @ 2016-12-13 21:21 UTC (permalink / raw) To: pandoc-discuss [-- Attachment #1.1: Type: text/plain, Size: 1883 bytes --] 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/5c74ed41-79f3-4566-9616-10b2e1224102%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. [-- Attachment #1.2: Type: text/html, Size: 3914 bytes --] ^ permalink raw reply [flat|nested] 3+ messages in thread
[parent not found: <5c74ed41-79f3-4566-9616-10b2e1224102-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>]
* Re: 'pandoc-abbreviations' python filter: request for advice/guidance [not found] ` <5c74ed41-79f3-4566-9616-10b2e1224102-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> @ 2016-12-14 1:07 ` Scott Koga-Browes 0 siblings, 0 replies; 3+ messages in thread From: Scott Koga-Browes @ 2016-12-14 1:07 UTC (permalink / raw) To: pandoc-discuss [-- Attachment #1.1: Type: text/plain, Size: 2183 bytes --] 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. [-- Attachment #1.2: Type: text/html, Size: 4335 bytes --] ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-12-14 1:07 UTC | newest] Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2016-12-13 8:41 'pandoc-abbreviations' python filter: request for advice/guidance Scott Koga-Browes [not found] ` <58db4764-ca7b-4f84-893a-6d6f3260fe47-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> 2016-12-13 21:21 ` Sergio Correia [not found] ` <5c74ed41-79f3-4566-9616-10b2e1224102-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> 2016-12-14 1:07 ` Scott Koga-Browes
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).