From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/27126 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: EBkysko Newsgroups: gmane.text.pandoc Subject: Re: How to indent a block when exporting to reStructuredText Date: Thu, 3 Dec 2020 07:49:06 -0800 (PST) Message-ID: References: <875z5n7rsg.fsf@example.com> <87eekbjl2a.fsf@example.com> <877dq2iq4d.fsf@example.com> <871rg8fqo3.fsf@example.com> <0d1533ca-8cf8-4a50-8318-a770eaaf2d31n@googlegroups.com> <87360oduiq.fsf@example.com> <87k0tzci6s.fsf@example.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_784_554709204.1607010546883" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33523"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBDW4B3GJ2UFBB44RUT7AKGQEOTEX6DY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu Dec 03 16:49:11 2020 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-oi1-f192.google.com ([209.85.167.192]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kkqr1-0008cu-8M for gtp-pandoc-discuss@m.gmane-mx.org; Thu, 03 Dec 2020 16:49:11 +0100 Original-Received: by mail-oi1-f192.google.com with SMTP id o130sf1116445oig.2 for ; Thu, 03 Dec 2020 07:49:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:date:from:to:message-id:in-reply-to:references:subject :mime-version:x-original-sender:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:list-subscribe :list-unsubscribe; bh=X7myWX1ZHcQIwpev2JyoH+3LdytFGnF/8Gu4342vZtk=; b=Mz8qaBE8sYRL37Br7zAOiYn2a53GGSrDoW/ay8DxssoyTy2PcRYOxTzru5pPeF+fAJ PxcBmAKMsaE0dy/oLzhasX1xzzvErUrEvfDJuf/CbyKJ/dZIOgY1oCJ2GcpytwIvuKT5 GO1e4h+J+YD+wbTWGr9IpGvJplQNHJbWHLi5IZz9/kATdG71FpxzrIsFBfmNKfaHkWza /7t40XWPeqVBm5B6GHDSozxchzvRE4CRKS4ME72f9BFQKcfa6SnTFpBtKParbPlQV3vW ebiPPpHPTrJg8RctM+zkgob86GunHD5Hz4GdCgaP+yyXbNVovklXSHbNO91cogcbQcDv zQIg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:message-id:in-reply-to:references:subject:mime-version :x-original-sender:reply-to:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=X7myWX1ZHcQIwpev2JyoH+3LdytFGnF/8Gu4342vZtk=; b=pD4kTh9CqkoQtjg43LOsoD3RYfUTcv6d+BAhbKmqiBELIO8BwCZs4yxmjAgoobaKCc R4SWYsihBG02sjADNGuih0QseU2YDzoMlnIYAikSYErb0VAWBlYKOOqKMHDXOQ63KWEh XrLFDUvSQw1qvc9RxMtiBvRHRC8lVrVK2YtOWCdKGaB7zt7SLGnDJs1usKWMZehaZaX+ oZTKktBYSy6BiO+QplKOgncnd819110iecMgMUOOBQ/NrcbtrffEc3cJlQll9qBlcKUv aTjG1iHgZPghmhfeoJdBU9lYDneKPuYiRbldw/FORcXwSLouNChECQXDSpYiCGqMrhwX nZEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:date:from:to:message-id:in-reply-to :references:subject:mime-version:x-original-sender:reply-to :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=X7myWX1ZHcQIwpev2JyoH+3LdytFGnF/8Gu4342vZtk=; b=exR+KsyNuwYJiHqZIko12oN1ltbBVOfRJpkhSwSLI5vrhbU+Gajszqx/VGrqgbq8iz TqcYj5CLEU6P6Youn4KcBGUFur5sd5Zc8Drn0iC78NovEX45IFYhumdqO8cVfFPYlKW+ 9M51hlKiloOeErRkT6i98z0eVfgs60PEmUy5o8V5v8VhlEdibJnCTo1xLtK+H64/XMJp 7ECWuPS7m7bnV0KFoR+8PNlbIGIalDc8AGWCjkcAUFcHWkR3+amqIbMGBY6CvO1NAoEA OThihHtvHbdh+or1pQb6GgNpXva4l9r2nSwXttXSDflwysK8IxvHLUIOkyBDY3Qw9Gln xdaQ== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM530kv5bB9ymVv/jnr6wG7UN/FRe8G/cKqmrzsQCr0vKPk6mvy0qF PPWX0SsU9W9ZID6mJE/QXwk= X-Google-Smtp-Source: ABdhPJyx9fLZSDR8wTJnOgkclzQBvPkE4XIaz3MFJ79nd6oBmUYWDCMYLVJcB8lK4wc1NFCx2DdQAg== X-Received: by 2002:a05:6808:4b:: with SMTP id v11mr2223357oic.169.1607010550319; Thu, 03 Dec 2020 07:49:10 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a9d:344b:: with SMTP id v69ls1490709otb.3.gmail; Thu, 03 Dec 2020 07:49:07 -0800 (PST) X-Received: by 2002:a05:6830:188:: with SMTP id q8mr2593040ota.96.1607010547661; Thu, 03 Dec 2020 07:49:07 -0800 (PST) In-Reply-To: <87k0tzci6s.fsf-hcDgGtZH8xNBDgjK7y7TUQ@public.gmane.org> X-Original-Sender: ebkysko-Re5JQEeQqe8AvxtiuMwx3w@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:27126 Archived-At: ------=_Part_784_554709204.1607010546883 Content-Type: multipart/alternative; boundary="----=_Part_785_735619068.1607010546883" ------=_Part_785_735619068.1607010546883 Content-Type: text/plain; charset="UTF-8" Almost there! - most importantly, after removing the 'note' tags from the block, you forget to put the modified block in the `note` table, since it contains what's left of the paragraphs once the tag is removed; - also important, in `elseif isNoteStart` chunk, you should really uncomment the creation of a new `note` table, this is where the collection will begin for the current note; - in the loop to remove the SoftBreak's, I can guess you wanted to remove any SoftBreak at the start, but the loop really isn't doing that; I'll let you rethink about it. In fact, for now let's forget about the SoftBreak's and concentrate on obtaining a working `Div`; the SoftBreak's won't do any arm; - finally, as I said the pandoc.Pandoc constructor takes the new list of blocks as first (or only) argument, but you put back only the 'el', which is a table containing el.blocks and el.meta. So you either return `pandoc.Pandoc(contents)`, or `pandoc.Pandoc(contents, el.meta)` (if you put `el.blocks=contents`, you can use `el.blocks` rather than `contents`) - minor comment: `table.remove(block.c, #block.c)` works, but there's a simpler way to write it, I'll let you think about it. I think with these you should have a working code. -- 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 view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/db1f8570-4afc-45ee-ac1f-0ae4435cf833n%40googlegroups.com. ------=_Part_785_735619068.1607010546883 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Almost there!

- most importantly, after removing the 'note' tags fro= m the block, you forget to put the modified block in the `note` table, sinc= e it contains what's left of the paragraphs once the tag is removed;
- also important, in `elseif isNoteStart` chunk, you should really uncomme= nt the creation of a new `note` table, this is where the collection will be= gin for the current note;

- in the loop to remove the SoftBreak= 's, I can guess you wanted to remove any SoftBreak at the start, but the lo= op really isn't doing that; I'll let you rethink about it.
 = In fact, for now let's forget about the SoftBreak's and concentrate on obt= aining a working `Div`; the SoftBreak's won't do any arm;

- finall= y, as I said the pandoc.Pandoc constructor takes the new list of blocks as = first (or only) argument, but you put back only the 'el', which is a table = containing el.blocks and el.meta. So you either return `pandoc.Pandoc(conte= nts)`, or `pandoc.Pandoc(contents, el.meta)`  (if you put `el.blocks= =3Dcontents`, you can use `el.blocks` rather than `contents`)

- mino= r comment: `table.remove(block.c, #block.c)` works, but there's a simpler w= ay to write it, I'll let you think about it.

I think with these= you should have a working code.

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pand= oc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d= /msgid/pandoc-discuss/db1f8570-4afc-45ee-ac1f-0ae4435cf833n%40googlegroups.= com.
------=_Part_785_735619068.1607010546883-- ------=_Part_784_554709204.1607010546883--