From 3bcdd750c8e469023e81f93dc0ba038cfd4614ef Mon Sep 17 00:00:00 2001 From: Adam Brin Date: Thu, 2 Jun 2022 07:33:08 -0700 Subject: [PATCH] cleanup of labels and css --- README.md | 22 +++++++++++----------- jsdoc-config.json | 2 +- package.json | 2 +- src/docs/style.css | 9 +++++++++ src/helpers/BasicHelpers.js | 8 ++++++-- src/helpers/LinkedArtHelpers.js | 4 ++-- src/helpers/ObjectHelpers.js | 2 +- 7 files changed, 31 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index a758679..c1d431a 100644 --- a/README.md +++ b/README.md @@ -3,15 +3,15 @@ [Docs](http://linkedartjs.org/) | [Contributing](https://github.com/thegetty/linkedart.js/blob/master/.github/CONTRIBUTING.md) -## What is Linked.Art? +## What is LinkedArt? -Linked.Art is a Linked Open Data model which is used to describe cultural heritage materials. Much more information about the model, and the community that is building it, can be found at [https://linked.art/](https://linked.art/) +LinkedArt is a Linked Open Data model which is used to describe cultural heritage materials. Much more information about the model, and the community that is building it, can be found at [https://linked.art/](https://linked.art/) ## What is the LinkedArt.js Library? -This library includes a set of methods for working with [linked.art](https://linked.art) data. Easily manipulate and access rich, complexly nested linked data from any Linked.Art source. This library includes different types of functions or methods: +This library includes a set of methods for working with [linked.art](https://linked.art) data. Easily manipulate and access rich, complexly nested linked data from any LinkedArt source. This library includes different types of functions or methods: -- _Basic Functions_: for things like getting the Title, Name, Identifier, or other common properties from a Linked.Art Object. Please see the helpers, or examples in our tests. +- _Basic Helpers_: for things like getting the Title, Name, Identifier, or other common properties from a LinkedArt Object. Please see the helpers, or examples in our tests. - _Document Navigation and Filters_: to use when building custom functions and queries -- this includes filtering data by multiple classifications, traversing the JSON-LD structure, and working with languages. ## Why did we create this? @@ -26,13 +26,13 @@ This project evolved out of Getty's implementation of the [Research Collections ## How Does it Work? -The library includes a number of methods or helpers for working with Linked.Art’s basic JSON-LD patterns. +The library includes a number of methods or helpers for working with LinkedArt’s basic JSON-LD patterns. ### Simple Helpers for Simple Functions While we cannot imagine every possible use, we've created some simple helpers to facilitate the request of common data fields (Title, Name, Accession #, Description, Materials, Cultures, Dimensions, Rights Statements, and Images, for example). -Note, full examples of many of these functions are available by browsing the "specs" folder in the source, or in the JSDoc. +Note, full examples of many of these functions are available by browsing the "[specs](https://github.com/thegetty/linkedart.js/tree/main/src/specs)" folder in the source, or the links on the left of [this page](https://www.linkedartjs.org). #### Example: Find the Title of this Record @@ -213,13 +213,13 @@ let objects = getObjectsClassifiedAsWithClassification( ### Working with Languages -You can do basic things like getting values based on a classification or set of classifications, as well as more advanced tasks like working with languages and other elements of the Linked.Art model. Almost every function can be passed a `language` attribute to filter on the language returned. +You can do basic things like getting values based on a classification or set of classifications, as well as more advanced tasks like working with languages and other elements of the LinkedArt model. Almost every function can be passed a `language` attribute to filter on the language returned. Want to know more, take a look at the [examples below](#getting started). ## More Examples & Documentation -The links on the left will take you to detailed documentation for each of the methods in this library. Furthermore, the [specs](https://github.com/thegetty/linkedart.js/tree/main/src/specs) folder in the source repository shows some practical examples using data from the community. +The links on the left of [this page](https://www.linkedartjs.org) will take you to detailed documentation for each of the methods in this library. Furthermore, the [specs](https://github.com/thegetty/linkedart.js/tree/main/src/specs) folder in the source repository shows some practical examples using data from the community. ## What this Library doesn't do @@ -229,11 +229,11 @@ To that end, this library does not make HTTP requests or attempt to resolve link ## Contributing -We know this library does not include every use-case, or a simple helper for accessing every Linked.Art property. We’d love feedback or pull-requests to continue to broaden and deepen the library to better support the community. +We know this library does not include every use-case, or a simple helper for accessing every LinkedArt property. We’d love feedback or pull-requests to continue to broaden and deepen the library to better support the community. ## What Do I Need to Use It? -You will need to be comfortable with javascript and npm (Node Package Manager). You will also need data that is formatted to the Linked.Art model. Example sets you can work with can be found at [https://linked.art/cookbook/](https://linked.art/cookbook/) +You will need to be comfortable with javascript and npm (Node Package Manager). You will also need data that is formatted to the LinkedArt model. Example sets you can work with can be found at [https://linked.art/cookbook/](https://linked.art/cookbook/) ## How do I install it? @@ -245,7 +245,7 @@ $ npm install @thegetty/linkedart.js --save ## Getting Started -Below is a simple example of how to use the LinkedArt library, for more examples, please see the tutorials [Understanding Linked Art](https://observablehq.com/@jrladd/linked-art-1), [Working with Linked Art](https://observablehq.com/@jrladd/linked-art-2), [Exploring Linked Art](https://observablehq.com/@jrladd/linked-art-3) for using Linked.Art with the Getty Museum’s linked open data APIs. +Below is a simple example of how to use the LinkedArt library, for more examples, please see the tutorials [Understanding Linked Art](https://observablehq.com/@jrladd/linked-art-1), [Working with Linked Art](https://observablehq.com/@jrladd/linked-art-2), [Exploring Linked Art](https://observablehq.com/@jrladd/linked-art-3) for using LinkedArt with the Getty Museum’s linked open data APIs. ### A Simple Example to get the title of an object: diff --git a/jsdoc-config.json b/jsdoc-config.json index 34c825e..8167837 100644 --- a/jsdoc-config.json +++ b/jsdoc-config.json @@ -5,7 +5,7 @@ "source": { "include": ["src/helpers/"] }, - "plugins": ["plugins/markdown"], + "plugins": ["plugins/markdown", "node_modules/better-docs/category"], "templates": { "cleverLinks": false, "monospaceLinks": false, diff --git a/package.json b/package.json index 8fecaf4..8ed4877 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "build": "npm run clean:dist && rollup -c build/rollup.config.js", "clean:dist": "rm -Rrf ./dist", "clean": "del ./dist", - "build:jsdoc": "node node_modules/jsdoc/jsdoc.js -c jsdoc-config.json; cp src/docs/style.css jsdoc/", + "build:jsdoc": "node node_modules/jsdoc/jsdoc.js -c jsdoc-config.json ; cp src/docs/style.css jsdoc/", "lint": "prettier --check 'src/**/*.js'", "lint:fix": "prettier -w 'src/**/*.js'", "prepublishOnly": "rollup -c build/rollup.config.js" diff --git a/src/docs/style.css b/src/docs/style.css index e69de29..25e3d55 100644 --- a/src/docs/style.css +++ b/src/docs/style.css @@ -0,0 +1,9 @@ +/* make the links to the code clearer to read*/ +p.tag-source span a { + color: black; +} + +/* hide the subcategories which label things as modules, that aren't */ +.category h3 { + display: none; +} diff --git a/src/helpers/BasicHelpers.js b/src/helpers/BasicHelpers.js index f0c30fb..ba92921 100644 --- a/src/helpers/BasicHelpers.js +++ b/src/helpers/BasicHelpers.js @@ -1,8 +1,8 @@ /** * @file BasicHelpers * @author Adam Brin, Pamela Lam, Alyx Rossetti, Charles Webb, Selina Zawacki - * @module BasicHelpers - * @description This file contains helpers for working with linked.art JSON-LD data + * @category Basic + * @description This file contains helpers for working with LinkedArt JSON-LD data */ import { PART } from "../data/constants.json"; @@ -12,6 +12,7 @@ import { PART } from "../data/constants.json"; * an empty array (if it doesn't exist), an array with the single object if it's an object * or primitive, or the array * + * @category Basic Helpers * @param {Object} obj - The object that might have an array attribute * @param {String} key - The key for the attribute field we want to retrieve * @@ -47,6 +48,7 @@ export function normalizeFieldToArray(obj, key) { /** * Normalizes the AAT ID to one of two versions (an aat: prefixed id or a full url) * + * @category Basic Helpers * @param {String} id - an ID to test * * @example - short to full aat value @@ -79,6 +81,7 @@ export function normalizeAatId(id) { /** * Normalize a field that may have parts. * + * @category Basic Helpers * @description Some of the fields in LinkedArt may be (but sometimes dont) include parts. * For example, `produced_by` which may have a production, or that production may contain multiple * parts. This method returns an array with the single or all parts @@ -119,6 +122,7 @@ export function normalizeFieldWithParts(object, field) { * Checks whether the JSON-LD object has unique fields outside of some basic fields (id, type, _label). Useful for testing whether * we should include the parent part in a list or not * + * @category Basic Helpers * @param {Object} object - the JSON-LD object to check * @param {Array} fieldsToIgnore - a list of fields to ignore when checking * @private diff --git a/src/helpers/LinkedArtHelpers.js b/src/helpers/LinkedArtHelpers.js index 718af54..82afd79 100644 --- a/src/helpers/LinkedArtHelpers.js +++ b/src/helpers/LinkedArtHelpers.js @@ -2,7 +2,7 @@ * @file LinkedArtHelpers * @author Adam Brin, Pamela Lam, Alyx Rossetti, Charles Webb, Selina Zawacki, Nabil Kashyap * @module LinkedArtHelpers - * @description This file contains helpers for working with linked.art JSON-LD data + * @description This file contains helpers for working with LinkedArt JSON-LD data */ import { doesObjectLanguageMatch } from "./LanguageHelpers"; @@ -508,7 +508,7 @@ export function getValueOrContent(object) { } /** - * Gets all the values of objects in a Linked Art object's 'referred_to_by' field + * Gets all the values of objects in a LinkedArt object's 'referred_to_by' field * which are classified by the classification parameter. * * @param {Object} object - the Actor object to inspect diff --git a/src/helpers/ObjectHelpers.js b/src/helpers/ObjectHelpers.js index 1ca2870..68dbcbd 100644 --- a/src/helpers/ObjectHelpers.js +++ b/src/helpers/ObjectHelpers.js @@ -2,7 +2,7 @@ * @file LinkedArtHelpers * @author Adam Brin, Pamela Lam, Nabil Kashyap * @module ObjectHelpers - * @description This file contains convenience helpers for working with linked.art objects + * @description This file contains convenience helpers for working with LinkedArt objects */ import {