I’m getting close to automating the solution to a problem that has plagued most Pandoc users. Tinderbox is key.
When you convert an HTML file with Panoc the table formatting does not work. The only way is to go into the XML of the docx file and manually apply a change.
Here is an image of a docx file I’ve exported and converted from Tinderbox with Pandoc:
If you open this file with the BBEDIT Disk Browser you’ll see this:
What I want is a runCommand that I can trigger from Tinderbox that will go into the newly created docx file, e.g. Test22.docx, go to the word/document.xml file, and then do a global replace of every instance of “Table” to “MyTable” in the following string <w:tblStyle w:val="Table"/>
I’ve played with a script with the terminal that will upzip the docx file. We can then edit the document.xml file through terminal (I’m not exactly sure what the commands would be). Then try to rezip the file, but reziping fails.
With BBEDIT, as shown above I can manually go into the docx file with Disk Browser and make the changes I want with the replace feature. I’m wondering if there is a way to automate this. Maybe with text factory, not sure.
Again, my goal is to have TBX automated it all. In my export script I know the path and name of the newly created file (this file will be dynamic/unique every time i run an export out of Tidnerbox). What I need, as noted above, is is something that will open this file, edit the file with an attribute value, e.g “MyTable”, that I can pass view the Run Command. Does anyone have any idea on how to do this?