David Simpson Apps

Table from Source with Rendering Macro

Features

The Table from Source (with Rendering) macro is an advanced formatting macro for Confluence.

This macro is only available in the commercial cloud version of the app – available December 2023.

It has the following features:

  • Takes data from any macro source which emits data in table-adf format, such as a native Confluence table
  • Displays a table based on the source data it receives from a source macro or table
  • Filter/search field for quick access to data
  • Sort the table by clicking on the header cells
  • Wrap cell content, or not
  • Renders the following LaTeX notation to mathematical & chemical equations - where the table header is named LaTeX (with this exact capitalisation)
  • SMILES format to 2D chemical structures - where the table header is named SMILES
  • InChI format to 2D chemical structures - where the table header is named InChI (with this exact capitalisation)
  • URLs and email addresses are hyperlinked
  • Links in markup language are hyperlinked e.g. [David Simpson Apps website](https://dsapps.dev) are rendered in HTML

Horizontal scrollbars for large content with shaded indicators to suggest you can scroll horizontally

Tables can be connected to Charts using the Manage connected data context menu item:

Confluence editor showing the Manage connected data icon for connecting a table to Charts

How to use

To use this macro, you need a source of data, such as a Confluence table.

In the Confluence editor, add a Confluence table and add some SMILES, InChI, and/or LaTeX to the table cells.

Make sure to label your column headers with SMILES, InChI, and LaTeX if you wish to use the rendering capabilities.

Tip: To see this macro in action, copy the table below and paste it into the Confluence editor to get started. 

Your table should look something like this:

NameSMILESInChILaTeX
PhenolC1=CC=C(C=C1)OInChI=1S/C6H6O/c7-6-4-2-1-3-5-6/h1-5,7Ha^2 + b^2 = c^2
AspirinCC(=O)OC1=CC=CC=C1C(=O)OInChI=1S/C9H8O4/c1-6(10)13-8-5-3-2-4-7(8)9(11)12/h2-5H,1H3,(H,11,12)\ce{A ->[{text above}][{text below}] B}
MorphineCN1CCC23C4C1CC5=C2C(=C(C=C5)O)OC3C(C=C4)OInChI=1S/C17H19NO3/c1-18-7-6-17-10-3-5-13(20)16(17)21-15-12(19)4-2-9(14(15)17)8-11(10)18/h2-5,10-11,13,16,19-20H,6-8H2,1H3/t10-,11+,13-,16-,17-/m0/s1\ce{Hg^2+ ->[I-] HgI2 ->[I-] [Hg^{II}I4]^2-}

Click in a table cell and then click on the “Manage connected data“ icon:

Confluence table with SMILES, InChI, and LaTeX columns showing the Manage connected data icon

In the macro properties panel, select Add Target:

Add Target dialog in Confluence for connecting table data to a macro

Then select “Table from Source (with Rendering)”:

Selecting Table from Source (with Rendering) from the target macro list

A new macro will appear below the existing table. Click on the macro, then the Edit icon:

Clicking on the new Table from Source macro to reveal the Edit icon

The macro properties panel will appear.

Table from Source with Rendering macro properties panel

Add the width and height for any rendered SMILES structures, or leave for the default size.

Choose whether or not to wrap the cell content.

Save the Confluence page and the table will be rendered:

Table from Source with Rendering macro rendered output showing 2D molecular structures and equations