public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: John MacFarlane <fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: Re: DTP Formats
Date: Fri, 21 Oct 2022 09:35:54 -0700	[thread overview]
Message-ID: <6444F4E4-2C77-484B-B047-EA83FFDA4970@gmail.com> (raw)
In-Reply-To: <65d7b8a6-77fd-4e53-8e14-f98ceefd836bn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>

One approach could be to keep a global stack of attributes.

function Strong(el)
  -- add "Strong" to the attribute stack
  -- process the children of el
  -- remove "Strong" from the top of the attribute stack
end

function Str(el)
  -- get all the attributes from the current attribute stack
  -- output an ITEXT node with these attributes
end

> On Oct 20, 2022, at 9:12 AM, perro tuerto <nika.zhenya-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> 
> I am working on a Scribus writer --- it stills need a lot of work but the work in progress is here. The main difficulty for Scribus writer is that its structure is “flat”. For example, what it is usual for html (or other xml format) is a nested structure like this:
> 
> <div class="dd"><p class="pp">I have a <strong>strong and <em>italic</em></strong>.</p><p>Other paragraph.</p></div><p>I am outside.</p>
> 
> Where there are nested blocks and inlines (I ignore attr for clearness):
> 
> Div [Para [ Str, Space, Str, Space, Str, Space, Strong [ Str, Space, Str, Space, Emph [ Str]], Str], Para [ Str, Space, Str]], Para [Str, Space, Str, Space, Str]
> 
> But in Scribus, same structure should be like the following:
> 
> <ITEXT CH="I have a "/>
> <ITEXT CPARENT="Strong" CH="strong and "/>
> <ITEXT CPARENT="StrongEmph" CH="italic"/>
> <ITEXT CH="."/>
> <para PARENT="ddpp"/>
> <ITEXT CH="Other paragraph."/>
> <para PARENT="dd"/>
> <ITEXT CH="I am outside."/>
> <para />
> 
> So the must difficult task I am trying to solve is how to flat the structure and inherit the attributes --- as far as I noted, only classes have to be inherit. In the first test I tried to solve it by pure regex, lol, it worked except the inheritance of inline atrributes. In the second try it seems it could work, but I have to continue working and refactor the code for the classic writer --- to late I come to realize that the new writer works when you don't need to rewrite everything, which it is not this case.
> 
> So, if anyone has an idea of how to solve this problem (elements flattening and attributes inheritance), I will be happy to know :D
> 
> El jueves, 18 de agosto de 2022 a las 5:20:16 UTC-7, leon...-bM6h3K5UM154beGV+Eop3g@public.gmane.orgm escribió:
> Yes, I have notified the relevant people and hopefully we'll get it fixed.   (we updated to a new system so things something get lost...)
> 
> No support for Scribus in pandoc currently, though that might be an interesting thing to try to do with the new Lua reader/writer functionality.  Alternatively, it does support importing Word files and you could go that route - but, of course, that wouldn't be automatic.
> 
> Leonard
> 
> On Thu, Aug 18, 2022 at 7:51 AM Trevor Jenkins <bslwa...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> On 17 Aug 2022, at 19:45, Leonard Rosenthol <leon...-bM6h3K5UM15l57MIdRCFDg@public.gmane.org> wrote:
> 
> > Trevor - what do you want/need to know about ICML?  I believe the documentation is part of the InDesign SDK.
> 
> As a sometime member of WG8 my interest is nothing more than intellectual curiosity, But the broken link is important.
> 
> Although it did raise my question of whether pandoc could process Scribus documents into/from other formats. And subsequent general question of the absence of the simple introduction/excmples for using Lua.
> 
> Regards, Trevor.
> 
> <>< Re: deemed!
> 
> -- 
> 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-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/6080948D-C510-4C74-BF12-1BD9DD3C4193%40gmail.com.
> 
> -- 
> 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/65d7b8a6-77fd-4e53-8e14-f98ceefd836bn%40googlegroups.com.

-- 
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/6444F4E4-2C77-484B-B047-EA83FFDA4970%40gmail.com.


  parent reply	other threads:[~2022-10-21 16:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-17 17:51 Trevor Jenkins
     [not found] ` <94877023-0E96-4760-8B50-900C3087DB5B-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2022-08-17 18:45   ` Leonard Rosenthol
     [not found]     ` <CALu=v3JjqgDWFf5+1A_Mve6dvVzJExjBTuVxgcJHttQF4dOydA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2022-08-18 11:51       ` Trevor Jenkins
     [not found]         ` <6080948D-C510-4C74-BF12-1BD9DD3C4193-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2022-08-18 12:20           ` Leonard Rosenthol
     [not found]             ` <CALu=v3LMv_S8mp7KembNgMc1OQ08vzQdv4FDv1aE32tTWVzG2g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2022-10-20 16:12               ` perro tuerto
     [not found]                 ` <65d7b8a6-77fd-4e53-8e14-f98ceefd836bn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-10-21 16:35                   ` John MacFarlane [this message]
     [not found]                     ` <6444F4E4-2C77-484B-B047-EA83FFDA4970-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2022-10-24 19:04                       ` perro tuerto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6444F4E4-2C77-484B-B047-EA83FFDA4970@gmail.com \
    --to=fiddlosopher-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).