Copy Contents of your pages to a Table

I use CODA to take notes at meetings and to jot down my structured lists etc.
But I wanted to have a single table containing a summary of all the pages in a document.
With the text from the page extracted as a TAB indented block

So I built this

In this first version, I extract the textual content of my notes pages into a table.
It scans for indented lists (like Collapsible-Lists, Checkbox-lists or Bullet-Lists) and replicates the indentation in the text.

For now, it cannot handle rich-text formatting in the text. But I am working on that.

I know folks were asking how to do this… I will try to find those posts and reply there also.

How It Works

You create a new page by clicking the New Page! button.
This duplicates a hidden blank page with two buttons at the bottom.

You need to give the new page a Title and then you can edit your notes.
I like to use Collapsible-Lists for my notes because you can collapse whole sections easily.

Any time you have finished making changes to any page, you click the 'Save Page! button.
This will do a few things…

  1. it copies the HTML of the entire page to a helper table
  2. from that it extracts the Title and the Icon URL and its Image
  3. it compiles a list of all the HTML elements

Then an Action Extract_Contents is executed which scans the HTML elements

  1. when it sees the start of an indented list it bumps up the level-counter, N
  2. when it ses the end of an indented list it bumps the counter down
  3. when it sees a text line, it outputs it to the Content column with N TABs

Then it copies all these columns to the PAGES table.
If the page already exists in the table, it updates the row
If the page does not exist in the table, it inserts a new row

9 Likes

Super creative and super interesting @Xyzor_Max ! Thanks for sharing!

One question:

Interestingly enough when I click on your tohtml() formula it recognizes it as an experimental formula. But when I write it myself anywhere, I can’t get it to recognize?

Your written formula is recognized
image

Mine is not:
image

Any idea why?

for some reason it is only available within an action, ie inside the code for a button