{"size": 1009, "ext": "js", "max_stars_repo_path": "src/index.js", "max_stars_repo_name": "zzzev/observable-press", "max_stars_repo_stars_event_min_datetime": "2019-03-14T23:52:44.000Z", "max_stars_repo_stars_event_max_datetime": "2021-05-21T00:14:59.000Z", "max_issues_repo_path": "src/index.js", "max_issues_repo_name": "zzzev/observable-press", "max_issues_repo_issues_event_min_datetime": "2019-08-06T09:24:28.000Z", "max_issues_repo_issues_event_max_datetime": "2019-12-02T21:57:59.000Z", "max_forks_repo_path": "src/index.js", "max_forks_repo_name": "zzzev/observable-press", "max_forks_repo_forks_event_min_datetime": "2019-03-16T09:08:56.000Z", "max_forks_repo_forks_event_max_datetime": "2021-11-24T05:57:30.000Z"}
{"max_stars_count": 18, "max_issues_count": 2, "max_forks_count": 3, "avg_line_length": 32.5483870968, "max_line_length": 83, "alphanum_fraction": 0.7512388503}
import initialize from './initialize';

// This script pulls the options from the HTML document and invokes the bootstrap
// function from observable-press.js
const notebookAttribute = 'data-notebook';
const notebookId = document.querySelector(`[${notebookAttribute}]`)
    .getAttribute(notebookAttribute);

const loadAll = document.querySelector('[data-load-all]') !== null;

const overrideHeight = document.querySelector('[data-override-height]') !== null;

const apiUrl = `https://api.observablehq.com/${notebookId}.js?v=3`;

// Somewhat hacky workaround for dynamic imports.
//
// Since we only have one (the notebook), it's much simpler to do this than
// use something like shimport.
const scriptSrc = `
import notebook from '${apiUrl}';

observablePress.initialize(notebook, ${JSON.stringify({loadAll, overrideHeight})});
`;

const script = document.createElement('script');
script.innerHTML = scriptSrc;
script.setAttribute('type', 'module');
document.head.appendChild(script);

export {initialize};
