diff --git a/src/blueprinters/deepids.js b/src/blueprinters/deepids.js new file mode 100644 index 0000000..428012f --- /dev/null +++ b/src/blueprinters/deepids.js @@ -0,0 +1,24 @@ +import { fmtObj } from '../lib/util' +import deeprows from './deeprows' + +/** + * Each resource item is an object with values labelled according + * to column names specified in the sheet's first row. If two or more + * column names are the same except for a different integer at the end + * (e.g. 'tag1', and 'tag2'), then the values of those two columns are + * aggregated into a list, which is the value of the prefix's key ('tag'). + * Any values in those columns that are empty will NOT be added to the list. + * + * @param {type} data list of lists representing sheet data. + * @return {type} Object the structured data. + */ +export default (data) => { + const output = {} + + deeprows(data).forEach(row => { + output[row.id] = row + }) + + return output +} + diff --git a/src/sheets_config.js b/src/sheets_config.js index 96996c3..42af2e9 100644 --- a/src/sheets_config.js +++ b/src/sheets_config.js @@ -9,7 +9,20 @@ export default { tabs: { export_events: [BP.deeprows, BP.rows], export_categories: [BP.groups, BP.rows], - export_sources: BP.ids, + export_narratives: BP.rows, + export_sources: BP.deepids, + export_sites: BP.rows, + export_tags: BP.tree + } + }, + { + name: 'ilovaisk', + id: '1fmK02NZSYM4gJL1KiSgjkIeo90NwY58o2QNYUepu1Fw', + tabs: { + export_events: [BP.deeprows, BP.rows], + export_categories: [BP.groups, BP.rows], + export_narratives: BP.rows, + export_sources: BP.deepids, export_sites: BP.rows, export_tags: BP.tree }