I usually analyze data with Python and I’d like to be able to write a paper based on that data in a completely reproducible way. I think the simplest thing would be to add slots to my document (using the macro, for example), which could be replaced later. My python code to generate something like a map from variable names to TeXmacs trees (in scheme format), and I’d have TeXmacs read that file to populate the tags according to their name.
For example, my python code would generate:
(("p_value" "0.032")
("nr_of_successes" "245")
("ratio" '(frac "a" "b"))
And at the click of a button, TeXmacs would read this file generated by the python code and replace occurrences of (tag "id" placeholder)
by (tag "p_value" "0.032")
.
Without expecting anyone to write this for me, what are the steps I should take to write a pluging that does this? Another possiblity would be for the python code to do the replacement, but that would require saving the file as texmacs scheme, which is somewhat disruptive.