From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/101744 Path: news.gmane.org!.POSTED!not-for-mail From: Rik Kabel Newsgroups: gmane.comp.tex.context Subject: \startuserdata syntax questions Date: Tue, 28 Aug 2018 16:40:35 -0400 Message-ID: <00d41d63-0ba0-1049-9119-b42835b18df7@rik.users.panix.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2103690789132052015==" X-Trace: blaine.gmane.org 1535488759 17959 195.159.176.226 (28 Aug 2018 20:39:19 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 28 Aug 2018 20:39:19 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Aug 28 22:39:15 2018 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fukld-0004Wk-EM for gctc-ntg-context-518@m.gmane.org; Tue, 28 Aug 2018 22:39:13 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 9BABB59940; Tue, 28 Aug 2018 22:40:51 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id v1RY7w9aSfnj; Tue, 28 Aug 2018 22:40:50 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id E7F225979C; Tue, 28 Aug 2018 22:40:50 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id E2B2F5979C for ; Tue, 28 Aug 2018 22:40:49 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iQ-xbkq6if56 for ; Tue, 28 Aug 2018 22:40:49 +0200 (CEST) Original-Received: from mailbackend.panix.com (mailbackend.panix.com [166.84.1.89]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 1AADC59773 for ; Tue, 28 Aug 2018 22:40:39 +0200 (CEST) Original-Received: from [192.168.201.199] (cpe-24-194-22-135.nycap.res.rr.com [24.194.22.135]) by mailbackend.panix.com (Postfix) with ESMTPSA id 18AC021117 for ; Tue, 28 Aug 2018 16:40:37 -0400 (EDT) Content-Language: en-US X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.16 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.org gmane.comp.tex.context:101744 Archived-At: This is a multi-part message in MIME format. --===============2103690789132052015== Content-Type: multipart/alternative; boundary="------------08C0E86D6C8C658E85F8C536" Content-Language: en-US This is a multi-part message in MIME format. --------------08C0E86D6C8C658E85F8C536 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Wolfgang, Hans, et al, The new \startuserdata macro looks very promising, and can simplify some work I have in progress. The first question: the wiki example and the source use \userparameter{optionkey} \userparameter{anotherkey} to retrieve the value of optionkey and anotherkey. Is there a way to provide the key/value pairs in a manner that they can be retrieved with the getparameters mechanism, as: \getrawparameters [XX] [optionkey=,anotherkey=,#1] This has the added advantage of allowing the setting of a default value, as \getrawparameters [XX] [optionkey=2em,anotherkey=,#1] Or is there a reason not to use getparameters in this setting? The second question: Is there the possibility to enhance the syntax so that one can write \startMyStuff [optionalkey=value, anotherkey=value]     stuff \stopMyStuff instead of \startuserdata [MyStuff] [optionalkey=value, anotherkey=value] stuff \stopuserdata Such syntactic sugar makes sweeter reading of the text, and makes clearer what is being done when nesting the macro. -- Rik Kabel --------------08C0E86D6C8C658E85F8C536 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit

Wolfgang, Hans, et al,

The new \startuserdata macro looks very promising, and can simplify some work I have in progress.

The first question: the wiki example and the source use

\userparameter{optionkey}
\userparameter{anotherkey}

to retrieve the value of optionkey and anotherkey. Is there a way to provide the key/value pairs in a manner that they can be retrieved with the getparameters mechanism, as:

\getrawparameters [XX] [optionkey=,anotherkey=,#1]

This has the added advantage of allowing the setting of a default value, as

\getrawparameters [XX] [optionkey=2em,anotherkey=,#1]

Or is there a reason not to use getparameters in this setting?


The second question: Is there the possibility to enhance the syntax so that one can write

\startMyStuff [optionalkey=value, anotherkey=value]
    stuff
\stopMyStuff

instead of

\startuserdata [MyStuff] [optionalkey=value, anotherkey=value]
     stuff
\stopuserdata

Such syntactic sugar makes sweeter reading of the text, and makes clearer what is being done when nesting the macro.

--
Rik Kabel

--------------08C0E86D6C8C658E85F8C536-- --===============2103690789132052015== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f --===============2103690789132052015==--