From 634a229ed2882532414e63014deef8c93001849d Mon Sep 17 00:00:00 2001 From: Melissa Draper Date: Tue, 8 Sep 2026 12:20:54 -0700 Subject: [PATCH] v3 -> v4 changes This change adds a `badge` shortcode built based on the supported versions config added recently. It will help reduce the number of places the version number needs updating. Sadly, adding shortcodes to codeblocks ruins their formatting. The badge has been added to the json-ld page to replace the existing badge there, and has also been added to the tools page to further emphasize the latest version as described in #122. It was also added to the context section of the user guide. The user guide retains links to real-world examples using old versions towards the end of the document. An admonition has been added under the examples links to prompt people to check and not copy it verbatim without due care. --- config.toml | 1 + content/developer-guide.md | 6 ++++-- content/jsonld.md | 3 ++- content/tools.md | 2 ++ content/user-guide.md | 24 ++++++++++++++++-------- layouts/shortcodes/badge.md | 2 ++ 6 files changed, 27 insertions(+), 11 deletions(-) create mode 100644 layouts/shortcodes/badge.md diff --git a/config.toml b/config.toml index a9e81ab..00922e5 100644 --- a/config.toml +++ b/config.toml @@ -61,6 +61,7 @@ publishDir = "../website" repo = "codemeta.github.io" background = "img/pyramids.jpg" supported = [ + '4.0.0', '3.0.0', '2.0.0' ] diff --git a/content/developer-guide.md b/content/developer-guide.md index 7c1af09..3bcbed2 100644 --- a/content/developer-guide.md +++ b/content/developer-guide.md @@ -170,15 +170,17 @@ with greater ease, and assists with better pipelines for publishing software. ## Extending the CodeMeta Context +The most recent version of CodeMeta is {{% badge %}} + CodeMeta explicitly defines the terms it uses from , rather than merely extending with a few additional terms. To use additional terms from not listed on the [terms page](/terms/) (or terms from any other context), you must extend your context appropriately. -For instance, to combine CodeMeta (v3.1) with all terms available in schema.org, +For instance, to combine CodeMeta (v4.0) with all terms available in schema.org, you would do: ```json -"@context": ["https://w3id.org/codemeta/3.1", "http://schema.org/"] +"@context": ["https://w3id.org/codemeta/4.0", "http://schema.org/"] ``` Note that the default context should be listed last. diff --git a/content/jsonld.md b/content/jsonld.md index a7e1f08..463cda5 100644 --- a/content/jsonld.md +++ b/content/jsonld.md @@ -10,10 +10,11 @@ JSON-LD lead developer Manu Sporny explains how JSON-LD works in this short clip ## The JSON-LD Context File -[![Permanent Identifier](https://img.shields.io/badge/perma--id-https%3A%2F%2Fw3id.org%2Fcodemeta%2F3.1-blue.svg)](https://w3id.org/codemeta/3.1) +{{% badge %}} Context file of released versions: +- CodeMeta 4.0: - CodeMeta 3.1: - CodeMeta 3.0: - CodeMeta 2.0: diff --git a/content/tools.md b/content/tools.md index b63f243..8422097 100644 --- a/content/tools.md +++ b/content/tools.md @@ -32,6 +32,8 @@ The tables in this section contain tools for supported versions of CodeMeta. Note: Tools marked with a warning symbol ( ⚠️ ) are not known to support the *latest version* of CodeMeta. {.tip} +The most recent version of CodeMeta is {{% badge %}} + These tools are categorised according to the context they can be used. In many cases a tool belongs to multiple categories and will be listed multiple times on this page. {{% tools %}} diff --git a/content/user-guide.md b/content/user-guide.md index 8cbab4e..7839155 100644 --- a/content/user-guide.md +++ b/content/user-guide.md @@ -151,7 +151,7 @@ individual is the `maintainer` of the software being described, like this: ```json { - "@context": "https://w3id.org/codemeta/3.1", + "@context": "https://w3id.org/codemeta/4.0", "@type": "SoftwareSourceCode", "name": "CodemetaR", @@ -174,7 +174,7 @@ This means the previous example is equivalent to: ```json { - "@context": "https://w3id.org/codemeta/3.1", + "@context": "https://w3id.org/codemeta/4.0", "@type": "SoftwareSourceCode", "name": "CodemetaR", @@ -202,7 +202,7 @@ object: ```json { - "@context": "https://w3id.org/codemeta/3.1", + "@context": "https://w3id.org/codemeta/4.0", "@type": "SoftwareSourceCode", "name": "CodemetaR" } @@ -213,7 +213,7 @@ SoftwareApplication: ```json { - "@context": "https://w3id.org/codemeta/3.1", + "@context": "https://w3id.org/codemeta/4.0", "@type": "SoftwareSourceCode", "name": "CodemetaR", @@ -229,7 +229,7 @@ application: ```json { - "@context": "https://w3id.org/codemeta/3.1", + "@context": "https://w3id.org/codemeta/4.0", "@type": "SoftwareSourceCode", "name": "CodemetaR", @@ -264,7 +264,7 @@ of the document has changed. It is *_not_* equivalent to the code above. ```json { - "@context": "https://w3id.org/codemeta/3.1", + "@context": "https://w3id.org/codemeta/4.0", "@type": "SoftwareSourceCode", "name": "CodemetaR", @@ -286,6 +286,8 @@ represented as the `"url"` of `rmarkdown`, instead of being the url of ## Context +The most recent version of CodeMeta is {{% badge %}} + Every CodeMeta document must refer to the context file `codemeta.jsonld`, for example via a URL. This indicates that all terms in the document should be interpreted in the "context" of CodeMeta. @@ -321,7 +323,7 @@ of the CodeMeta schema in order to refer to the appropriate context file. For example, use the following for the latest release: ```json -"@context": "https://w3id.org/codemeta/3.1" +"@context": "https://w3id.org/codemeta/4.0" ``` ## Attributions @@ -452,6 +454,9 @@ under `author` or `contributor`. The example below demonstrates the `id` and [Full example](https://github.com/oss-slu/Pi4Micronaut/blob/de4305bec9afe7f7c948e9cc97b9105fd55121f7/codemeta.json). +Note: The above real-world example is using a specific version of CodeMeta. It may not be the correct version for you. Refer to [the tools tables](/tools) to check for compatibility with the tools you use. +{.tip} + ### Organizations The properties listed in the [terms](/terms) tables with a type `Organization` @@ -487,7 +492,7 @@ root of a code repository: ```json { - "@context": "https://w3id.org/codemeta/3.1", + "@context": "https://w3id.org/codemeta/4.0", "type": "SoftwareSourceCode", "applicationCategory": "Biology", "codeRepository": "https://github.com/gem-pasteur/macsyfinder", @@ -505,6 +510,9 @@ root of a code repository: ([Link to full example](https://github.com/gem-pasteur/macsyfinder/blob/69c22b065065105e6c5ac8dcbff00a804a0a34fc/codemeta.json)). +Note: The above real-world example is using a specific version of CodeMeta. It may not be the correct version for you. Refer to [the tools tables](/tools) to check for compatibility with the tools you use. +{.tip} + ## Referencing CodeMeta All versions, including release candidates, may be referred to consistently diff --git a/layouts/shortcodes/badge.md b/layouts/shortcodes/badge.md new file mode 100644 index 0000000..e3d731e --- /dev/null +++ b/layouts/shortcodes/badge.md @@ -0,0 +1,2 @@ +{{ $supported := .Site.Params.supported }}{{ $latest := $supported | sort | collections.Reverse }}{{ $latest := index $latest 0 }} +[![Permanent Identifier](https://img.shields.io/badge/perma--id-https%3A%2F%2Fw3id.org%2Fcodemeta%2F{{ substr $latest 0 3 }}-blue.svg)](https://w3id.org/codemeta/{{ substr $latest 0 3 }})