selector_to_html = {"a[href=\"#check-for-missing-records\"]": "<h3 class=\"tippy-header\" style=\"margin-top: 0;\">Check for \u2018missing\u2019 records<a class=\"headerlink\" href=\"#check-for-missing-records\" title=\"Link to this heading\">#</a></h3><p>Some of the records in the dataset might represent <em>parts</em> of resources, such as the sections of a Parliamentary Paper. You\u2019d expect there to be separate results for the parent records, but I\u2019ve found this is not always the case \u2013 the parent records are missing. In the previous processing step you can add the identifiers for any parent resources from the metadata embedded in the digital object viewer. You can then check all the parent identifiers to make sure they\u2019re already included in the dataset. Something like this:</p>", "a[href=\"get-collection-items.html\"]": "<h1 class=\"tippy-header\" style=\"margin-top: 0;\"><span class=\"section-number\">25.3. </span>HOW TO: Get a list of items from a digitised collection<a class=\"headerlink\" href=\"#how-to-get-a-list-of-items-from-a-digitised-collection\" title=\"Link to this heading\">#</a></h1><h2><span class=\"section-number\">25.3.1. </span>Background<a class=\"headerlink\" href=\"#background\" title=\"Link to this heading\">#</a></h2><p>The NLA\u2019s digitised resources are often presented as \u2018collections\u2019. A collection could be the volumes in a multi-volume work, the issues of a periodical, a map series, an album of photographs, or a manuscript collection. In the web interface, collections will have a \u2018Browse this collection\u2019 link or button that displays a list of the contents, but getting machine-readable data is not so straightforward. You can use the <code class=\"docutils literal notranslate\"><span class=\"pre\">magazine/title</span></code> API endpoint to get a list of issues from a periodical, but there\u2019s no way to get the contents of other types of collections from the Trove API.</p>", "a[href=\"#additional-processing\"]": "<h2 class=\"tippy-header\" style=\"margin-top: 0;\"><span class=\"section-number\">25.1.2. </span>Additional processing<a class=\"headerlink\" href=\"#additional-processing\" title=\"Link to this heading\">#</a></h2><p>Once you have a dataset that is as complete as possible, you might want to:</p>", "a[href=\"get-downloads.html\"]": "<h1 class=\"tippy-header\" style=\"margin-top: 0;\"><span class=\"section-number\">25.4. </span>HOW TO: Get text, images, and PDFs using Trove\u2019s download link<a class=\"headerlink\" href=\"#how-to-get-text-images-and-pdfs-using-troves-download-link\" title=\"Link to this heading\">#</a></h1><h2><span class=\"section-number\">25.4.1. </span>Background<a class=\"headerlink\" href=\"#background\" title=\"Link to this heading\">#</a></h2><p>You can download text, images, and PDFs from individual digitised items using the Trove web interface. But only the text of periodical articles is available for machine access through the Trove API. This makes it difficult to assemble datasets, or build processing pipelines involving digitised resources.</p><p>This page documents a workaround developed by reverse-engineering the download link used by the Trove web interface. You can use it to automate the download of text, images, and PDFs from many digitised resources.</p>", "a[href=\"../../what-is-trove/works-and-versions.html\"]": "<h1 class=\"tippy-header\" style=\"margin-top: 0;\"><span class=\"section-number\">3. </span>Works and versions<a class=\"headerlink\" href=\"#works-and-versions\" title=\"Link to this heading\">#</a></h1><h2><span class=\"section-number\">3.1. </span>Grouping versions into works<a class=\"headerlink\" href=\"#grouping-versions-into-works\" title=\"Link to this heading\">#</a></h2><p>The idea is simple enough \u2013 bring all the versions of a publication together under a single heading to simplify a user\u2019s search results. Instead of having to wade through a long list of near-identical entries, a user can quickly focus in on a title of interest, and drill down to find a specific version at a specific library. This idea is based on the <a class=\"reference external\" href=\"https://www.ifla.org/references/best-practice-for-national-bibliographic-agencies-in-a-digital-age/resource-description-and-standards/bibliographic-control/functional-requirements-the-frbr-family-of-models/functional-requirements-for-bibliographic-records-frbr/\">Functional Requirements for Bibliographic Records</a> (FRBR). The FRBR data model describes four entities: \u2018work\u2019, \u2018expression\u2019, \u2018manifestation\u2019, and \u2018item\u2019:</p>", "a[href=\"../../accessing-data/trove-api-intro.html\"]": "<h1 class=\"tippy-header\" style=\"margin-top: 0;\"><span class=\"section-number\">14. </span>Trove API introduction<a class=\"headerlink\" href=\"#trove-api-introduction\" title=\"Link to this heading\">#</a></h1><p>Use the Trove Application Programming Interface (API) to get direct access to Trove data. Just make a request  and get back data in a predictable, structured format that computers can understand.</p>", "a[href=\"#merge-remove-duplicates-from-dataset\"]": "<h3 class=\"tippy-header\" style=\"margin-top: 0;\">Merge/remove duplicates from dataset<a class=\"headerlink\" href=\"#merge-remove-duplicates-from-dataset\" title=\"Link to this heading\">#</a></h3><p>Duplicates exist at multiple levels amongst Trove\u2019s digitised resources. There can be more than one work record pointing to a single digitised object. Single works can also contain near-duplicate versions pointing to the same resource but including slightly different metadata. The processing steps above will exapand all of these duplicates and near-duplicates out into individual records. The aim of this step is to deduplicate the records while preserving all the harvested metadata. The desired result is a dataset with one record for each fulltext url. If there are multiple values in any column, these need to be concatenated into a single list or value.</p>", "a[href=\"extract-embedded-metadata.html\"]": "<h1 class=\"tippy-header\" style=\"margin-top: 0;\"><span class=\"section-number\">25.2. </span>HOW TO: Extract additional metadata from the digitised resource viewer<a class=\"headerlink\" href=\"#how-to-extract-additional-metadata-from-the-digitised-resource-viewer\" title=\"Link to this heading\">#</a></h1><p>The viewers you use to examine digitised resources in Trove embed some metadata that isn\u2019t available through the Trove API. This includes a JSON-ified version of the item\u2019s MARC record (presumably copied from the NLA catalogue), as well as structural information used by the viewer itself, such as a list of pages in a digitised book.</p><p>This metadata can be useful in a number of different contexts. For example, you can extract the number of pages in a digitised book, then use this number to <a class=\"reference internal\" href=\"get-downloads.html\"><span class=\"doc std std-doc\">automatically download the full text or a PDF</span></a>. The GLAM Workbench includes an example where geospatial coordinates are extracted from the MARC data to add to a <a class=\"reference external\" href=\"https://glam-workbench.net/trove-maps/exploring-digitised-maps/\">harvest of digitised maps</a>.</p>", "a[href=\"download-images.html\"]": "<h1 class=\"tippy-header\" style=\"margin-top: 0;\"><span class=\"section-number\">25.5. </span>HOW TO: Create download links for images using <code class=\"docutils literal notranslate\"><span class=\"pre\">nla.obj</span></code> identifiers<a class=\"headerlink\" href=\"#how-to-create-download-links-for-images-using-nla-obj-identifiers\" title=\"Link to this heading\">#</a></h1><h2><span class=\"section-number\">25.5.1. </span>Introduction<a class=\"headerlink\" href=\"#introduction\" title=\"Link to this heading\">#</a></h2><p>Many of the resources digitised by the NLA and its partners are made up of images. These might be digitised copies of visual material like photos and maps, or scanned pages of print publications like books or periodicals. In Trove, each image or page has its own unique <code class=\"docutils literal notranslate\"><span class=\"pre\">nla.obj</span></code> identifier. You can use these identifiers to construct urls that lead directly to downloadable versions of the image file.</p>", "a[href=\"#outline-of-harvesting-method\"]": "<h2 class=\"tippy-header\" style=\"margin-top: 0;\"><span class=\"section-number\">25.1.1. </span>Outline of harvesting method<a class=\"headerlink\" href=\"#outline-of-harvesting-method\" title=\"Link to this heading\">#</a></h2><p>This is an outline of a general, \u2018belts and braces\u2019 approach to harvesting details of digitised resources. The specific method will depend on the type of resource, the filters you apply, and the metadata you want to save.</p>", "a[href=\"#harvest-metadata-from-api\"]": "<h3 class=\"tippy-header\" style=\"margin-top: 0;\">Harvest metadata from API<a class=\"headerlink\" href=\"#harvest-metadata-from-api\" title=\"Link to this heading\">#</a></h3><p>Searches using the API return work-level records. Sometimes digitised resources are grouped as <a class=\"reference internal\" href=\"../../what-is-trove/works-and-versions.html\"><span class=\"doc std std-doc\">versions of a work</span></a>, even though they\u2019re quite different. To make sure you get everything, you need to work your way down through through the hierarchy of <code class=\"docutils literal notranslate\"><span class=\"pre\">work</span></code> -&gt; <code class=\"docutils literal notranslate\"><span class=\"pre\">version</span></code> -&gt; <code class=\"docutils literal notranslate\"><span class=\"pre\">sub-version</span></code> (labelled <code class=\"docutils literal notranslate\"><span class=\"pre\">record</span></code> in API responses), harvesting every relevant record. The steps are:</p>", "a[href=\"#expand-collections-and-enrich-dataset-using-embedded-metadata\"]": "<h3 class=\"tippy-header\" style=\"margin-top: 0;\">Expand collections and enrich dataset using embedded metadata<a class=\"headerlink\" href=\"#expand-collections-and-enrich-dataset-using-embedded-metadata\" title=\"Link to this heading\">#</a></h3><p>Most of Trove\u2019s digitised resource viewers embed useful metadata in the HTML of their web pages. You can use this to determine whether a fulltext url points to a single resource or a collection, and to enrich the metadata you obtained from the API. The steps are:</p>", "a[href=\"../../accessing-data/how-to/harvest-complete-results.html\"]": "<h1 class=\"tippy-header\" style=\"margin-top: 0;\"><span class=\"section-number\">15.2. </span>HOW TO: Harvest a complete set of search results using the Trove API<a class=\"headerlink\" href=\"#how-to-harvest-a-complete-set-of-search-results-using-the-trove-api\" title=\"Link to this heading\">#</a></h1><p>See <a class=\"reference internal\" href=\"../../accessing-data/trove-api-intro.html\"><span class=\"doc\">Trove API introduction</span></a> for general information about using the Trove API.</p>", "a[href=\"#how-to-harvest-data-relating-to-digitised-resources\"]": "<h1 class=\"tippy-header\" style=\"margin-top: 0;\"><span class=\"section-number\">25.1. </span>HOW TO: Harvest data relating to digitised resources<a class=\"headerlink\" href=\"#how-to-harvest-data-relating-to-digitised-resources\" title=\"Link to this heading\">#</a></h1><p>Harvesting data from a search for digitised resources (other than newspapers) in Trove is not as simple as making a few <a class=\"reference internal\" href=\"../../accessing-data/trove-api-intro.html\"><span class=\"doc std std-doc\">API requests</span></a>. The major problem is that digitised resources are often assembled into groups or collections, and the full details of these groupings are not available through the Trove API. This means that simply harvesting results from an API query can miss many digitised resources. In addition, the way resources are described and arranged is often inconsistent, so you can\u2019t assume that a particular type of resource will be grouped in a particular way.</p><p>As a result of these problems, a \u2018belts and braces\u2019 approach seems best \u2013 follow every possible route and harvest as many records as possible. This may result in duplicates, but these can be dealt with later. In any case, Trove already contains a large number of duplicate records for digitised resources, so some form of merging or deduplication will always be required.</p>"}
skip_classes = ["headerlink", "sd-stretched-link", "sd-rounded-pill"]

window.onload = function () {
    for (const [select, tip_html] of Object.entries(selector_to_html)) {
        const links = document.querySelectorAll(`article.bd-article ${select}`);
        for (const link of links) {
            if (skip_classes.some(c => link.classList.contains(c))) {
                continue;
            }

            tippy(link, {
                content: tip_html,
                allowHTML: true,
                arrow: true,
                placement: 'auto-start', maxWidth: 500, interactive: false,

            });
        };
    };
    console.log("tippy tips loaded!");
};
