From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/28630 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "'juh' via pandoc-discuss" Newsgroups: gmane.text.pandoc Subject: Re: Fenced Div to ConTeXt Environment (was: Markdown Fenced Div to LaTeX Environment) Date: Thu, 17 Jun 2021 12:20:05 +0200 Message-ID: References: <8ba84992-d792-4333-aae0-560147ef79d4n@googlegroups.com> <87pn1uwglb.fsf@zeitkraut.de> <20210616143731.GA29446@sokrates> <5db56b4f1d8d4ca2bec612bcebb7a525@unibe.ch> <493d0aa9-47f5-ca8d-2ef5-8e63f965c529@mailbox.org> <4396a9133ab74e4fbff486f09e22d254@unibe.ch> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8"; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14371"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBDO25H455QHRBZODVSDAMGQET5RIESI-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu Jun 17 12:20:23 2021 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-wm1-f57.google.com ([209.85.128.57]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ltp8J-0003cl-10 for gtp-pandoc-discuss@m.gmane-mx.org; Thu, 17 Jun 2021 12:20:23 +0200 Original-Received: by mail-wm1-f57.google.com with SMTP id i82-20020a1c22550000b02901d64e84b3c9sf399279wmi.5 for ; Thu, 17 Jun 2021 03:20:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1623925222; cv=pass; d=google.com; s=arc-20160816; b=sbI/5kDoqtrenIG3110QVn/VFHWrH8Jv0IoNOmhpCCjz4d5pcWhWPy9Kvabh7vSd6T +znFZqiQWUxEZFi0RE6gQ/QLWHWF9h7zN76OSoHmUsjNgds3u6kJK5tUfYGnTrg9t4MG K44KwzrDi1fXfbah3qSvsXm3sZZJrB0gtPTl9clx6SWtvXk558FKO4gaGL0Rbd8/E5Iv bRmcDHA4T39Jp1srr8I/xapVtTSt9UT4K9A+YmNZp8rbPO8bkbAT8q82IkdAVoA3WJS6 O9k+2piQx9czXpCo/ExaeMy6+oiNFecaX+AvVv1haULlSUs+UVY+LYgfMg6d4sHX/je+ xwTw== 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:date:message-id:subject:from:references:to :dkim-signature; bh=K1m7Rxh5oxtA5ywQisop1Uy+iTwCkBKIRWFiAFsxtgk=; b=Q3pUY8jiqCsDgETXrCH+R6TH03xno21pW/xx0U/8QZICrEphYp+ukqpLTmwTtSQP6A HkGb8/CiUFuzjkprEJkZ0poRX0aq8qrpxDtXcgmDaESl3Zv23GuuglJHe5V0/2o702Al 7NwgRJqb/1ltmyHiAbyi+lR+QneJ5Zrv7l9ip+pVieOIT9eYo+/qJALVR37L+UqyANoY WYd4CoY8hYrfBa5JCIHxcWnO40oyoj9o6sfiu8JAYRFUYdQtpvoZcxwbKe7rYr1DeSYC JFRIhB3CvESjG6NFEVuAEf/f3ltcy7N1MjFVQoTPKAFxBKoeSAfJUfYgXaL8K1Qfc6Ei +7Mg== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@mailbox.org header.s=mail20150812 header.b=KCoufzJU; dkim=pass header.i=@mailbox.org header.s=mail20150812 header.b=SyZ3Vs9T; spf=pass (google.com: domain of juh-cl+VPiYnx/1AfugRpC6u6w@public.gmane.org designates 2001:67c:2050::465:101 as permitted sender) smtp.mailfrom=juh-cl+VPiYnx/1AfugRpC6u6w@public.gmane.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=mailbox.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=to:references:from:subject:message-id:date: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=K1m7Rxh5oxtA5ywQisop1Uy+iTwCkBKIRWFiAFsxtgk=; b=HGMH64Fm4LHQiKx7YNBpgREEPieUw7EZX2m0xL5OMgrYosWWfY8G9qlSp4LT28BldE MMoYYCMPTMp2Gkd3hSR8nGOZR20a5n3sz35EXoImOEC61MtEoe+s4/BlpVoyeENTIUUt FzacHVa6R/KY2UhQQuShINc5M5fucvqAooiF+SQLWtMAePRZb6SPhdeCeFlYcMUsQniU IRTwPadVanW09Yx9TOPPAr3Vfz2/myFptaheUEOVHhihlCuQt5cPB0nsldo4/pNw/rYE BllYKbR7iYlmFJ50nwQ4RPwLcYhoPp/CbLAluALI09DhMAb4ooleMz4h/gTtoEbYCdRu 0ZGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:references:from:subject:message-id:date :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=K1m7Rxh5oxtA5ywQisop1Uy+iTwCkBKIRWFiAFsxtgk=; b=IMADvxtLxHmR43q52iAG8+o39EznZmcNvWZUa/dg8AtP5gecuiiKhxsxMO2cIw+ZcE QSeI2nQZ690RQlq+LJLORuTNQL4ckybcLT9F4Q9f3zkMIFvEFznHQW6DKAKlIEAEz8C+ RU1ym3iy4n9vhZb+F1qGq7J3ONg+52Aq7zVOPgmCkOzQqKOC1V4IIvxegQKdrZsCoXb7 rkHkxAmOrE+I9wYaJaNk0DkXwdVUxJN5X7G7huju9PpPKJl5SYN4zuuyjq0rTpGzyrfJ huH14PKOGuSC+4EMeFWRxSLcbiKAj8a6Lk28ZHxBuvkcoS37npf2eIdKiyiCmwG9pY7a W2hQ== X-Gm-Message-State: AOAM530laeK9bys+IoMcRA9efADuMpYmJHtYkT9A+rkVupzkLC421DYx O1K4wJlCuaN0wINsXPXxfZ4= X-Google-Smtp-Source: ABdhPJytGDi7wy80Kd52PSjBTLp8biE0s4t7gRgGyWSUseXIFM/wzY1YPbosDVHVWdTt9RpiLOVdkA== X-Received: by 2002:a1c:2142:: with SMTP id h63mr4253177wmh.84.1623925222729; Thu, 17 Jun 2021 03:20:22 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:600c:358e:: with SMTP id p14ls2507694wmq.0.canary-gmail; Thu, 17 Jun 2021 03:20:20 -0700 (PDT) X-Received: by 2002:a7b:cde1:: with SMTP id p1mr2717245wmj.64.1623925220575; Thu, 17 Jun 2021 03:20:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623925220; cv=none; d=google.com; s=arc-20160816; b=cA4EPwbWLcZXnHu1kLzL7bt39Pps3tmSB8OfVguxsWICUIbH5jx/Ih1cN7vDJnBcuD 866sDCLS7qIGI0GidEX9C/AGGp73nKf87RSXu9waFYT0B0VdcHPzRazn7vZvRVlZNbuP CmQRkT5sBFWJJbOom9CAG/CAHH8YRIWPWrBBG+AakrGG/XYLNA63OvUoH/T4Ve3iii3g eXozI+Hc/uUnvovnLIIQE01/grKG08BN5ENg77c9VTYKx7fkb2d2TgU86LCccOnyVLOy Y4cfIoZOPAFPYD/hWkmlq7JX0SN9PQthPwOvk5vNoOYo5QcHN4BfPw5rZjF3dKYPl9VT e3Hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :date:message-id:subject:from:references:to:dkim-signature :dkim-signature; bh=nBvEV7aTDl3ADbetSEjIiu+fYkN/3NwDaWMybGG0jWE=; b=LvM1cyPoYOsumU0obqIo9BlK0vNq8G92LhA02OUHFEjZz7oRRgr+31nUULZbSEfxEm VmKKHup5sPu5t43JEQc6QOVc5pOYWP4UqlSmlRe/ai41uky1/80X+PG2YEdNWYDzesSo w+37uPDu33Go0QkZdzZ+xv64cYU57AH+EyV/V0W1IOK4wG51KJyFDFQ52KRw+cYY9yFq ds7emFQ65RcIw1qUx72TdpmyY9eBh+HssdaXHwKuvBZHs/WUmEq4igDdfvXKmG0D/juH Rbya8NrXi5MdPpSDXXAtGf+CUxYNynoNmKNeUC7XBT1Nrlfe2krkS3GISe2P1p/VVWeQ iIiA== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@mailbox.org header.s=mail20150812 header.b=KCoufzJU; dkim=pass header.i=@mailbox.org header.s=mail20150812 header.b=SyZ3Vs9T; spf=pass (google.com: domain of juh-cl+VPiYnx/1AfugRpC6u6w@public.gmane.org designates 2001:67c:2050::465:101 as permitted sender) smtp.mailfrom=juh-cl+VPiYnx/1AfugRpC6u6w@public.gmane.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=mailbox.org Original-Received: from mout-p-101.mailbox.org (mout-p-101.mailbox.org. [2001:67c:2050::465:101]) by gmr-mx.google.com with ESMTPS id v4si265929wrg.2.2021.06.17.03.20.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Jun 2021 03:20:20 -0700 (PDT) Received-SPF: pass (google.com: domain of juh-cl+VPiYnx/1AfugRpC6u6w@public.gmane.org designates 2001:67c:2050::465:101 as permitted sender) client-ip=2001:67c:2050::465:101; Original-Received: from smtp2.mailbox.org (smtp2.mailbox.org [80.241.60.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4G5J3810WMzQjv6 for ; Thu, 17 Jun 2021 12:20:20 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Original-Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter06.heinlein-hosting.de (spamfilter06.heinlein-hosting.de [80.241.56.125]) (amavisd-new, port 10030) with ESMTP id 2hskPNcbDkNm for ; Thu, 17 Jun 2021 12:20:16 +0200 (CEST) In-Reply-To: Content-Language: en-US X-Rspamd-Score: -6.10 / 15.00 / 15.00 X-Rspamd-Queue-Id: EA92C17F3 X-Rspamd-UID: 9fccdb X-Original-Sender: juh-cl+VPiYnx/1AfugRpC6u6w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@mailbox.org header.s=mail20150812 header.b=KCoufzJU; dkim=pass header.i=@mailbox.org header.s=mail20150812 header.b=SyZ3Vs9T; spf=pass (google.com: domain of juh-cl+VPiYnx/1AfugRpC6u6w@public.gmane.org designates 2001:67c:2050::465:101 as permitted sender) smtp.mailfrom=juh-cl+VPiYnx/1AfugRpC6u6w@public.gmane.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=mailbox.org X-Original-From: juh 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.io gmane.text.pandoc:28630 Archived-At: Thanks a lot Bastien and Denis, I go with this one: ```lua ENV_CLASSES = { 'intro', 'zitat', 'solution' } local function context(s) return pandoc.RawBlock('context', s) end local function get_env_class(elem) if elem.classes then for i = 1, #elem.classes do for j = 1, #ENV_CLASSES do if elem.classes[i] == ENV_CLASSES[j] then return ENV_CLASSES[j] end end end else error('function has_class used on an element of type ' .. elem.t .. ' that cannot have classes.') end end function Div(el) local env_class = get_env_class(el) -- nil if there is none if env_class then -- false if env_class is nil return { context('\\startparagraph['.. env_class ..']'), el, context('\\stopparagraph') } end end ``` ConTeXt is amazingly flexible in many ways and it is fun to create individually designed documents. But I have to deploy it to an organization were people want to write content in Markdown. I am currently working on a proof of concept that we can meet all of our style ideas with ConTeXt while writing in markdown using pandoc. I think that in the long run I will need some more filters. Eg. it is quite easy to have a default width of images with \setupexternalfigure[width=\textwidth] so that the default image markup \placefigure{My caption}{\externalfigure[image.jpg]} works perfectly fine. But I can imaging situations where I want to pass an argument to it like this. \placefigure{My caption}{\externalfigure[image.jpg][textwidth=6em]} I'll try to figure out how to do this in a lua filter. A co-worker of mine has some programming skills and might help. But in fact there might be another solution, if I put the image in an special paragraph environment and redefine setupexternalfigure. For now, thanks a lot! juh -- Soziale Plastik. Die Kunst der Allmende Essay zum 30. Todestag von Joseph Beuys http://www.amazon.de/dp/1523458763/ Taschenbuch, 130 Seiten, EUR 9,90