From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/25627 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Albert Krewinkel Newsgroups: gmane.text.pandoc Subject: Re: simple dictionary with pandoc Date: Sun, 12 Jul 2020 10:27:21 +0200 Message-ID: <87tuydkuja.fsf@zeitkraut.de> References: 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="14683"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCZJF7XJTILRB34SVP4AKGQEBEJ2V3Y-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sun Jul 12 10:27:29 2020 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-lj1-f192.google.com ([209.85.208.192]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1juXKb-0003i1-PV for gtp-pandoc-discuss@m.gmane-mx.org; Sun, 12 Jul 2020 10:27:29 +0200 Original-Received: by mail-lj1-f192.google.com with SMTP id s22sf8564116ljs.21 for ; Sun, 12 Jul 2020 01:27:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1594542449; cv=pass; d=google.com; s=arc-20160816; b=Y6kcR74N4Jb48jcWWMNaA/CXCs852DJ5MxevGEafiqFHAF0f1S6eSK8/Q2FdjsGiP/ z/F8ZCq1lmH8GIzD4/3PrZ309meHY7JlgF3LEf72Rqy99TlNLjUbqPFyy5ylOyRoL70e K5LKg1kcWmMMhGvcWJ3ju6K+CR5pG91AsP/uTaeMdThvWgR7b+sYGt+gfnhqcMualXNZ R/43tOToXUq6phOXAAfzKj1KMyUCFTBsb5k1CN4O9rUH62d0jjcYxTo02qJsHBngPkyQ fnmjnxIkrgRmbx56KdmPhUY/Ci0d6+wvKibWAsAWWXO263Mvvy/amgEb4fmdUvH5wZrX ZZnw== 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:date:in-reply-to:subject:to:from:references :sender:dkim-signature; bh=8d+YRlwsKOLWwELkfBG6az20bmR4DZibxn4Q/SfB8PI=; b=ZHOn9+65heeRiGFVPp4oZu1qrSxiIS4kirYBXarnoule3gXBy2jRJDzifNDojgK4KM 7Ghi/gblC4FUDg//SKHZ/DAjK/FO2Pru4niqFvRUdlm11kQ1gk4/NZklXrrkhU8ybWG/ Y64Q05SarlMMDA44WYhwIJq2uqYVFOtI/2VpEo7DAyXNbjYCLo/0wUIGuaCJzp6hnbBI qoVD5Ezahp3JvFq/DFmxzbZKOgY3hfEwx3IoT2iO9HyrbAwuPVeMEm0xJgug+TPaty19 uyG2rZ2jAwxYxHZbAthpvQX2I+Su6o7tHb2449IHVS++HjwPCqvl71gDNWm1RN6xoBKw 7vpg== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org designates 80.241.56.172 as permitted sender) smtp.mailfrom=albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeitkraut.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:references:from:to:subject:in-reply-to:date:message-id :mime-version:content-transfer-encoding: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=8d+YRlwsKOLWwELkfBG6az20bmR4DZibxn4Q/SfB8PI=; b=Yo3akCYJO/btcuDEJz3HEdGrcRj/eG8Wcb7qlfSXLEh7Uaxn/rFOjrUSu80TIbITqI RlJmCsC7S76gAq9pQ0yzK6TgW0DxMimu5eZZRS+me6awl6YEHTC34+3O5iRqi5bEwDWk JmgIAY9grLwiq12O+KS2Sv9c5cwlpTGHqqS3sADb50aHaIbk4UscnY4O7FvkzrIk+bAO HFhvf9H4CnKFFV5as3h2CjyhpebgMhlZ4zNUXepy7s5YCbR/2Wyu0MPhFFzQoAQOAD/Q nkc844iOED3pF02xFJ2UcSTIQNx5T8mbGwLkkkRpHy5UujJHxongX26wnFymcJuBm3Vo 9r+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:references:from:to:subject:in-reply-to :date:message-id:mime-version:content-transfer-encoding :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=8d+YRlwsKOLWwELkfBG6az20bmR4DZibxn4Q/SfB8PI=; b=gdwQBK+wZq6b5/fC0hUff7ZaV1dr7QrzLJy2n+KVWXv8XTELN5lrZVgSEfHmM9pxvP qDIS88IFE7Bxrr1HRULCZQfwknMQchLnK7xim4rGI6Y/uGbJxt2C5UAL8cIYJ9YX3kIP 00QSRedoieKaKoZVfeix/l7+rjL7idOQdQEPsq2Mdxzg1TQbX2kWKgZekI6K084kOxLK 4pOgTdK6LMqlzF5DQAhe9MtfFEZpNFZp8DVsiAEOtDIFeviKSXI6W48xQno29q/35qRF V8/9JKjYC+MITA/ZIjbXS6hlCr2H9aiVP+xTfdNpHRXIsZcmstVfoIsU1t4UhXIH2/wR Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM530wENB85AzjHBzIxS4iwQG0Fol5OyJflnY3/QZ6aOJRoNlRFrI3 1GDICMrgX5a2QzpTsFuGxsQ= X-Google-Smtp-Source: ABdhPJzqLbm3CLJ6kxf1lzbE7C6fvLGWQrIWD3jvRzabE7Ri/xJqy+3nz+eqeuGDEEiRadjysETA5Q== X-Received: by 2002:a2e:b88f:: with SMTP id r15mr36639335ljp.355.1594542449260; Sun, 12 Jul 2020 01:27:29 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a2e:9190:: with SMTP id f16ls2524758ljg.11.gmail; Sun, 12 Jul 2020 01:27:26 -0700 (PDT) X-Received: by 2002:a2e:920e:: with SMTP id k14mr47356693ljg.430.1594542446916; Sun, 12 Jul 2020 01:27:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594542446; cv=none; d=google.com; s=arc-20160816; b=qGjSrzbhg57laOtudhudJYUCZO2Z8juXGu8IyCq7ZO1dwVSeMeqlR1L6BDRgkTqF1I m0eof4Qr6DxrGu8UkkjXpfS4a0P4feRuR0zTyb9EIMFZczTYwA2e5lZ0s4JIUoUW/YfE mPSvHszWL4GctxwpWF/nMxiFqbKFhA2U2FQIdjQUC1x18BZecuwIljAZPsj/cx95UcRM YWS5uwzlJH9/8vSOZ6Vg0QkBnQCrAfenpmkFTv8b1tI2q/bH8rIvbxsQsiyGNaNDPIuZ EaJNKmSrMyLTHw7KP9d2GjG1SyBdX7ZoWVAQpIXbXYTwp19mwBsIa4+JS3vzJVaY9TTu LiRA== 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:date:in-reply-to :subject:to:from:references; bh=UO7GvQmtyWCeBHDQ1C/Pi8mHf65sylGIIEO30p9x6Uo=; b=MbvGR61rhwlSgAnbKVUUAfC9DM/I7WaIJaeMu0PWspvULYNK+TRWxD0VKFkkgvhMKY lNUxwswO0Q1hbiUqrcYHT/j3EtOHPX+7WSP2KM/I2HxWF2k0m4CMMz98zFny9TOw5NJv kxxAIglHcZ4sL/VLE5JvmciRxgzdEsUMqk2OxUyEo7wnwHZYax1oaUffZTTaL9G0crnu 2cEQN9R49oxekpkDSx+xGgH/wRCk/1RvIKy5AT63bkZ3z9OsO69g5HgD0Ayp3NbSeG4v y7LpiOLIMMFUDmPoLvalVAzK2t8dqV7gkmRtzvVKzAdZDJjc+BUuVpbgy01n7s5zX6Vp 5VwQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org designates 80.241.56.172 as permitted sender) smtp.mailfrom=albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeitkraut.de Original-Received: from mout-p-202.mailbox.org (mout-p-202.mailbox.org. [80.241.56.172]) by gmr-mx.google.com with ESMTPS id k10si431015lji.2.2020.07.12.01.27.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 12 Jul 2020 01:27:26 -0700 (PDT) Received-SPF: pass (google.com: domain of albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org designates 80.241.56.172 as permitted sender) client-ip=80.241.56.172; Original-Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4B4Kdp1QbszQlJ1 for ; Sun, 12 Jul 2020 10:27:26 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Original-Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter03.heinlein-hosting.de (spamfilter03.heinlein-hosting.de [80.241.56.117]) (amavisd-new, port 10030) with ESMTP id qDCDTB4NHGZA for ; Sun, 12 Jul 2020 10:27:22 +0200 (CEST) In-reply-to: X-MBO-SPAM-Probability: 0 X-Rspamd-Score: -4.13 / 15.00 / 15.00 X-Rspamd-Queue-Id: E1BB91753 X-Rspamd-UID: 539d65 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 80.241.56.172 as permitted sender) smtp.mailfrom=albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeitkraut.de 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:25627 Archived-At: Hi Tam=C3=A1s, Tam=C3=A1s Ferenci writes: > I was thinking of implementing a very-very simple dictionary with pandoc. > The idea is the following: I store the necessary information in a > YAML-file, such as this: > > --- > dictionary: > - hungarian: asztal > english: table > remark: Can be made of wood. > - hungarian: sz=C3=A9k > english: chair > remark: We sit on it. > ... > > Then I use a pandoc conversion with a custom template to produce a markdo= wn > file (arranging them in a table or list), to which I again apply pandoc t= o > convert to HTML. Both a Hungarian-English and an English-Hungarian > dictionary could be produced; a simple script could automate this whole > process, using the above YAML file as an input and producing the two HTML > files as outputs. > > My first problem is however whether it is possible at all to sort the > entries (alphabetically) with a template? No, sorting in templates is not possible. See https://github.com/jgm/doctemplates for a full list of pandoc templating engine features. > If not, are there any good solutions to this problem? Or pandoc is simply > not suited to solve a task like this...? You could write a Lua filter which converts the dictionary into a normal table. This has the advantage that you'd not be limited to a single output format. Sorting is possible in Lua, but somewhat awkward. See https://www.lua.org/manual/5.3/manual.html#pdf-table.sort. Unicode and locale aware sorting is even harder. A better solution might be to write the dictionary as a CSV file, use external tools to sort it, then use pandoc's CSV reader to produce a table. Cheers, Albert -- 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/87tuydkuja.fsf%40zeitkraut.de.