1. to just preprocess the google spreadsheet into a normal json file
for exhibit, you can just make a static exhibit somewhere else that
loads the data from the spreadsheet, then use exhibit's data export
functionality (activated by clicking the orange scissors that appear
when you hover over the data in the page) to copy out the same data in
exhibit json format.
2. If you want to access the spreadsheet data "live", perhaps you
canput some javascript in your page that inserts the <link> tag exhibit
wants into the head _after_ you're CMS has finished parsing the head
(so it won't see and complain about the link) but _before_ executing
exhibit (which will happen if the script for your "link insertion"
javascript appears before the link to exhibit in the head of your page).
3. If for some reason your script link inserter has to run _after_ the
exhibit scripts are loaded, you can take advantage of exhibit's
autocreate option. There is an "autoCreate=false" option that tells
exhibit _not_ to run after its code has been loaded; if you set that
option in the exhibit script then you can take over the data-loading
step and then launch exhibit yourself. Take a look at, e.g.,
http://trunk.simile-widgets.org/exhibit/api/scripts/create.js This
is the code that is executed if autoCreate is not cleared. If you run
this code yourself after setting autoCreate=false, you'll get normal
exhibit behavior. So, set autocreate=false, then after exhibit loads
(using jQuery(document).ready as create.js does) run some javascript
that inserts the desired link tag in the header, then call the
autoCreate function yourself.
4. If you simply can't fiddle with the head that way, another way to
avoid placing the link command is to do your own loading of the data
manually, inserting your own code that replaces exhibit's loading
process. But you'll need to replace quite a few things. Again, you
can take over the pipeline using autoCreate=false. You can replace
the function window.database.loadDataLinks in create.js with your own
data loading code. Your loading code needs to fetch, parse, and insert
the data you want. For the case of a jsonp data feed like google
spreadsheets, this is normally done by e.g.
http://trunk.simile-widgets.org/exhibit/api/scripts/data/importers/jsonp-importer.js
, which uses the googleSpreadsheetsConverter in
http://trunk.simile-widgets.org/exhibit/api/scripts/data/database.js as
its translator, and then calls database.loadData to shove the parsed
data into exhibit. You can write a replacement for the jsonp-importer
code to fetch the google spreadsheet data, then call
googleSpreadSheetsConverter yourself to translate it into exhibit and
call database.loadData yourself to shove it into exhibit's database.
then you can replicate the code in create.js to actually show the
exhibit.