Preview only selected notes

I find myself often putting experimenting with different ideas and sequences of text blocks during work (thinking for instance about a big report or presentation). This involves displaying multi-note text for editing or proof-reading, and verifying the logic of how the ideas are put together in written format. I’m aware of the following functionality that helps me in this process.

  1. Multi-note display in the text view pane. I select the notes I want to display and can edit the text for each note selected in the text field as for the demonstration example below.

  2. Multi-note display at Container level. I select the container and make sure that the container export template includes the reference to “^children” with the path to the template.


    If I look at the preview pane ALL notes in the container are displayed reflecting their order in the container.

What I’m not sure is whether 2 or more selected notes can be displayed in the Preview pane and if so what the export template would look like ? Ideally I would like to display the two notes selected as below in preview.

I realise that much work can be done in the Text pane without worrying about preview. I can also copy the notes into a separate container or use an agent to select the desired notes and preview them. However I’m looking to explore interactively the notes and their (sometimes computed) content and I’m not sure whether this is possible. As least I’ve not found a way… doesn’t mean one doesn’t exist.

In short, No.

Could you indicate which notes you’d like to preview through an attribute, perhaps $Checked? If so, your template could use ^children and then skip over unchecked notes. (I can explain this in more detail if this is too terse.)

Can you compute which notes should be previewed? If so, you could use an agent to gather aliases of those notes.

1 Like

I think working with checkboxes might be a good solution. I can check/uncheck relatively quickly and then click on preview to keep the dynamic exploration of the note text blocks and their sequence relatively interactive.

I’m afraid I’ll need more guidance about how to use ^children for this task though. I use TB a lot but haven’t done much with export codes beyond the basic templates.

1 Like

The general scheme is sometimes called the envelope/letter idiom. One template, the envelope, encloses the exported children:

...
^include(children,conditionalTemplate)
...

Each child is then exported with a special template like this:

^if($Checked). 
     <h4> ^title </h4>
     ^text
^endif

So, the template exports the title and text if, and only if, the note has been checked.

2 Likes

I just produced a sample file for you as well as an installer: 5CS TBX Lesson: 5Cs Is No Show Convention (a.k.a., Envelope or Letter Idiom) for Templates.

Many thanks @satikusala. It was kind of you to follow up with a worked out example and reference TB file. I’ve started looking through the examples you’ve provided and am learning a lot.

1 Like

Happy to help. Please let me know if you have any other questions about the file.

Michael
5Cs Schoo | Mastering Tinderbox