From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/31505 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Albert Krewinkel Newsgroups: gmane.text.pandoc Subject: Re: Lua filters: Extensions with pandoc.read? Date: Tue, 04 Oct 2022 11:13:38 +0200 Message-ID: <87v8oz3ohm.fsf@zeitkraut.de> References: <87czbrfrzr.fsf@zeitkraut.de> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11476"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCZJF7XJTILRBSUE6CMQMGQELDT32XY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Tue Oct 04 11:52:15 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-ed1-f63.google.com ([209.85.208.63]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ofeaz-0002l0-UP for gtp-pandoc-discuss@m.gmane-mx.org; Tue, 04 Oct 2022 11:52:13 +0200 Original-Received: by mail-ed1-f63.google.com with SMTP id e15-20020a056402190f00b0044f41e776a0sf10658684edz.0 for ; Tue, 04 Oct 2022 02:52:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1664877133; cv=pass; d=google.com; s=arc-20160816; b=rQKCf7sh0xB3s9EFm9WrtspQZg7wbUb321l5QEbITS2KuhdqtOITfKmlVxcjP3z/dm c027YkYcOZTN6WIkjQbCV0Uw31ToWudw2m3lQcHrr25WsZhnzWVPr/+d/ziJIVa7pQ8+ KBsdowoRmQ4GGXMn1RZd4Vlfw0nYXxfd3PGz8Q2y2FlLXrtQkOXXdk/0BHb6DuLSpoGZ 8hsie1mOlTHCeUt0Bj4fNoAQ3HMjmjEyNHlzGBWqSIeYcW13IVcHZ8gGOCVHFy1TTXgX YBN+2EOmmH39V2nNjCoCuFFR+uQ/r+3HCuPPuUNr1ny6o2R8VtT2RrGZsVnxpO0NLcRB H/Gg== 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-transfer-encoding :mime-version:message-id:in-reply-to:date:subject:to:from:references :sender:dkim-signature; bh=fCUnPz4WteELODcbefjC+IBv36Gc1nkMuXxLTDg1BwE=; b=e1dG3tOgnnGZqx3QCPARSLEpldOUG7s5fjlmBXsEzNDUj1ZxHx+5CwQAZ+J8wX2Frm G/kX8sThYpEO4Foq95Ca94hbRYfnrBngW4U909l6rLtej9xwxQFOoq/3ZT2wwWM71D2l soacLczvzUyvWGIkMAAZ5op7Fk881UAI+tI6egRjs2QKzvtec3qINAITouf6qIAtVX8k Sgn0p5+79FwsJDauOep1+K0snQR8tfkb4O2RnT2Ae14UGCGxTFr25fAboezyKquG8KUc +j8eKp695akGxJfDDiJS+qUSC/jOZaKOWBI0fYj/WeoqW0dq35d1tyEIJAHWrjMlSVhw Xb/g== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org designates 2001:67c:2050:0:465::101 as permitted sender) smtp.mailfrom=albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender :content-transfer-encoding:mime-version:message-id:in-reply-to:date :subject:to:from:references:sender:from:to:cc:subject:date; bh=fCUnPz4WteELODcbefjC+IBv36Gc1nkMuXxLTDg1BwE=; b=JJcixQrHBlXP7jRTiKP2mpVjSxa0DY4GtxSAiox8EkYhgFqG0vSefyDdiEryJzuLGK aHjRFLfeUMDopr6EEVZEOkpTc1SxTwdAgbilJPIyKzF0a+5ow653wgr3pR/7QsBUYMKL v4Brtv/0ePhqeAS2evKL2gKGkBgp30PahwEXCO8aDaFhH71nMgy2mv2unT+X0lh0cLWM IP9Z8vWCImfAMKlc81x1KMz9QoDB2pWDN5+4UWUU2SQjNE9CZlOkAU5+hhfWl07ngJiq Nnh3mOqULel/qaDPAesq9u0izrIpvjSOGEoxscboS8XxWPUVxpirmreO1P1p1LZ+PM7H SDGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender :content-transfer-encoding:mime-version:message-id:in-reply-to:date :subject:to:from:references:x-gm-message-state:sender:from:to:cc :subject:date; bh=fCUnPz4WteELODcbefjC+IBv36Gc1nkMuXxLTDg1BwE=; b=Xu1C/4OqcVA6FPCHeL0saG7UlDH7Ef8HA/blE13GD4RIUvVmrC0/sPAm1qlEy2+SeJ CCOYh+RhJiuM5nF0C2hv23oVP9HFh1BY3pEO0Q8M7jPJXdJf7WEJuF8LH+X/kXtZQtIO CpoV+3BP90jqC1Ce8MIz9+LtEKjDnTtmoZhwCBSRVkSs6EwWMKwyVCxnFMKDDLuc2TZ4 +caDLNCNvEL0JozZFpz5uaPnMRqyTjALktbp/PqaFkCXowS4C5So1yd82KtCdiYSCjpc z5VBB9vLTZw/8X1ScUJct8/lttrDXIOcSiUB3WyZ Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: ACrzQf0+EFYEYiYYmrNfDrFQWal2QsnUVmGL/iFe47fAFswTtWeEJDB5 JjND/dsvqPXEsQmZP1vO1ok= X-Google-Smtp-Source: AMsMyM5guh7/lZs+HmCNgankPB2wYohic2tf6YtzzbrvC1g0nFDW352lJvWCFiyMTp0roX6+SsVuBg== X-Received: by 2002:a17:906:7316:b0:787:8f41:d233 with SMTP id di22-20020a170906731600b007878f41d233mr18687077ejc.483.1664877133377; Tue, 04 Oct 2022 02:52:13 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a17:906:1dcc:b0:770:7b74:43de with SMTP id v12-20020a1709061dcc00b007707b7443dels696650ejh.3.-pod-prod-gmail; Tue, 04 Oct 2022 02:52:09 -0700 (PDT) X-Received: by 2002:a17:907:2c41:b0:787:6d66:b593 with SMTP id hf1-20020a1709072c4100b007876d66b593mr18736878ejc.401.1664877128991; Tue, 04 Oct 2022 02:52:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664877128; cv=none; d=google.com; s=arc-20160816; b=v6DPh6i9w6YtRfgyHpGLpEpcCvcpy9YrjTvodXaFh/KtBA4yPYP4hhjug2EPdIw7Df ejrH4HzxW0iKu4O8w/Lu5O67aU6YWKPfBoQAOw0JSOHWLKyeoIZwloPpb27wENo8YJpb hCNFZWPsBMO2ug4mST9GS/GkkxQ5roscJv6s1eGOB56bgj0R/qAm4aOdoLilw87SpYNu JG7/zZIZZ56ttk2lRvjbKOhFbSEinnhguF2Hk4BQJ8YrfMITycfWD6pHI4MDhSgHZF22 QSfPeB40N/RkC/53XPswKN+zR5262vAZU3NrV6abgPubKfc8C5tLH/5dZK8DaA3f64Rf SSwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:in-reply-to:date :subject:to:from:references; bh=ezNQHnrze70jjK6xjbi3cM8uACHLZxmFiR6jYGewOT0=; b=hTDOtSuPW9aOMEcG5FeTeQrPnUYe+rW+BTqVkHOzTsgeHEQ78nI3GkRoRpGfpoipbG Z4B4PPh/Q4S1h/rSyX0DJShWY/Q4O+zuXLZip1QAcIurXyxDnyjm2IHetKgQdgRSGUa6 mhxKwrD6tRcetQvrzvyaRcq8IbM+7dCCOfkwY4tNu+5N6qpOq2SQsP9r1ET+RhZpEyIE qruvL8P6cUSqxxQIAWNOqEWRznGWxVUUuGj9OIsMnUq/wD7feevi4U24PhfkiDscP2jT 5XtgInmvETJ6Jub59eDOFiqwuJ0H73s/xxfIdBFLQPkTadJ8iLIcvguCXOsgzPO3VfZ7 HmOQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org designates 2001:67c:2050:0:465::101 as permitted sender) smtp.mailfrom=albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org Original-Received: from mout-p-101.mailbox.org (mout-p-101.mailbox.org. [2001:67c:2050:0:465::101]) by gmr-mx.google.com with ESMTPS id c19-20020aa7df13000000b0044ea33a8ac8si386724edy.2.2022.10.04.02.52.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Oct 2022 02:52:08 -0700 (PDT) Received-SPF: pass (google.com: domain of albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org designates 2001:67c:2050:0:465::101 as permitted sender) client-ip=2001:67c:2050:0:465::101; Original-Received: from smtp1.mailbox.org (smtp1.mailbox.org [10.196.197.1]) (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 4MhXzp6lb8z9rwJ for ; Tue, 4 Oct 2022 11:52:06 +0200 (CEST) In-reply-to: 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 2001:67c:2050:0:465::101 as permitted sender) smtp.mailfrom=albert+pandoc-9EawChwDxG8hFhg+JK9F0w@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.io gmane.text.pandoc:31505 Archived-At: BPJ writes: > Den m=C3=A5n 19 sep. 2022 14:51 Albert Krewinkel < >> albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org> skrev: >> >> Extensions have to be passed as part of the format string, e.g., >> >> pandoc.read(source, 'markdown-tex_math_dollars') >> >> I'm not entirely happy with this, as it means that any extensions >> passed via a ReaderOptions object will be ignored. >> >> -- this may seem like it should disable all extensions, >> -- but the ReaderOptions `extensions` field is ignored. >> -- The default 'markdown' extensions will be used instead. >> pandoc.read(src, 'markdown', {extensions =3D {}}) >> >> Ideas to improve this would be most welcome. > > I would just change it to not ignore reader options, and throw an > error if the format string and the reader options contradict each > other (except for empty table =3D no extensions and no extensions in > string =3D default extensions). And better hurry before someone starts > to rely on reader options being ignored! :-) I believe that this has already become the expected behavior, so I'd be very hesitant to break it. How about this approach: The format specifier can currently only be a string. We change this to accept either a string, or a table with the extensions being given in separate fields. E.g. -- extensions relative to default for format { format =3D 'markdown', , disable =3D {'markdown_in_html_blocks'}, , enable =3D {'emoji'}, } or -- absolute set of extensions { format =3D 'docx', , extensions =3D {'auto_identifiers', 'styles', 'citations'} } If the function is called with either a string or a table that has explicit info on extensions, then the ReaderOptions extensions are overridden. If the table has no info about extensions, then we use the ReaderOptions. It might still be a little confusing, as pandoc.read(src, 'markdown', opts) -- default Markdown extensions will behave differently than pandoc.read(src, {format: 'markdown'}, opts) -- extensions in opts Extensions are closer to formats than to reader options, conceptually. It seems sensible to tie them to formats. But maybe there is a better way? --=20 Albert Krewinkel GPG: 8eed e3e2 e8c5 6f18 81fe e836 388d c0b2 1f63 1124 --=20 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 e= mail 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/87v8oz3ohm.fsf%40zeitkraut.de.