omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Workflow to fold all & unfold specific headers (with their contents) ?

    Editorial
    folding fold
    2
    6
    4132
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • tguillemin
      tguillemin last edited by tguillemin

      I want to build a workflow to fold/unfold not lines, but specific headers and their contents, and I do not know how to proceed.(I suppose iwhat action ? what Regex ?). Of course I know how to do that manually…

      I have a text, e.g. :

      #Chapter one (@tag1, @tag2)
      
      some text
      some other text
      
      #Chapter two (@tag2, @tag3)
      
      foo
      ber
      baz
      
      #Chapter three (@tag1, @tag3)
      
      London
      Paris
      Berlin
      
      #Chapter four (@tag2, @tag4)
      
      something
      anything
      

      I want to select the, e.g. @tag1 headers and unfold these and these only, so as to have :

      #Chapter one (@tag1, @tag2)
      
      some text
      some other text
      
      [number of hidden words]
      
      #Chapter three (@tag1, @tag3)
      
      London
      Paris
      Berlin
      
      [number of hidden words]
      

      How should I proceed ?

      Thanks in advance

      1 Reply Last reply Reply Quote 1
      • jsamlarose47
        jsamlarose47 last edited by

        You've probably solved or moved on from this, but I found it to be an interesting challenge, as I was beating my head against regular expressions for folding in Editorial. If you're still in the market for an answer, try the following:

        http://www.editorial-workflows.com/workflow/5808136921284608/5vSeu1APl5w

        1 Reply Last reply Reply Quote 0
        • tguillemin
          tguillemin last edited by

          First of all, thanks for your answer.
          I had indeed moved on, because I had found a solution suited for my needs :

          http://www.editorial-workflows.com/workflow/5892414547951616/3rPK8OHQ7KY

          As you can see (I hope you will be able to read it : it is the first time I share a workflow), this contraption :

          • is in French
          • includes a Critic Markup Title hypothesis (you may set it aside)

          I suppose you can turn this in a real Rube Goldberg by introducing the choice of 2 patterns, which would allow to choose :

          • A
          • NOT A
          • A OR B
          • A AND B
          • A AND NOT B
          • NOT (A OR B)
          • NOT (A AND B)

          but then I decided to Keep It Simple.

          Thanks again

          1 Reply Last reply Reply Quote 0
          • jsamlarose47
            jsamlarose47 last edited by jsamlarose47

            Looks good! I should really thank you. The solution I came up with for your original request helped me to come at something I was trying to solve with fresh eyes and new thinking... ;)

            Glad you came up with something that worked for you.

            1 Reply Last reply Reply Quote 0
            • tguillemin
              tguillemin last edited by

              Very glad I could be of any help to you..

              But, you know, I think both of us should above all thank omz for this very remarkable software…

              Thanks again for your answer

              1 Reply Last reply Reply Quote 0
              • tguillemin
                tguillemin last edited by

                @jsamlarose47

                I have the feeling, after using your VERY useful workflow, that we answer 2 different cases :

                • my solution : if the contents of a fold contain a specific pattern (and there can be as many different patterns as there are different words in the text), then keep open (unfolded) the fold with its contents
                • your solution : if a pattern is found, and this pattern is bound to be more specific (@something, or as I tried #\d{3}, etc...), keep the fold unfolded with its contents wether the pattern is found in the header or found in the contents of the fold

                My conclusion - and I am very grateful for your answer - is that these 2 solutions are complementary, for my specific uses anyway.

                Thanks again for your help

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post
                Powered by NodeBB Forums | Contributors