@@ -16,6 +16,7 @@ metadata fields and can synchronize this information into different **target
1616files** .
1717
1818!!! info
19+
1920 The somesy schemas are designed to allow expressing metadata in the most
2021 useful and rich form, i.e. the best form that some of the target formats
2122 supports.
@@ -42,6 +43,7 @@ contribution of a person and acknowledge contributors that are neither full
4243authors or maintainers.
4344
4445!!! note
46+
4547 Currently, provided information about contributors that are neither authors
4648 nor maintainers, and all the detailed information on the contributions is
4749 not used.
@@ -110,28 +112,31 @@ The following tables sketch how fields are mapped to corresponding other fields
110112some of the currently supported formats.
111113
112114=== "Person Metadata"
113- | Field Name | Poetry Config | SetupTools Config | CITATION.cff | Requirement |
114- | ---------------- | ------------- | ----------------- | --------------- | ----------- |
115- | given-names | name+email | name | given-names | required |
116- | family-names | name+email | name | family-names | required |
117- | email | name+email | email | email | required |
118- | orcid | - | - | orcid | optional |
119- | * (many others)* | - | - | * (same)* | optional |
115+
116+ | Field Name | Poetry Config | SetupTools Config | CITATION.cff | package.json | Requirement |
117+ | ---------------- | ------------- | ----------------- | --------------- | ------------ | ----------- |
118+ | given-names | name+email | name | given-names | name | required |
119+ | family-names | name+email | name | family-names | name | required |
120+ | email | name+email | email | email | email | required |
121+ | orcid | - | - | orcid | url | optional |
122+ | *(many others)* | - | - | *(same)* | - | optional |
120123
121124=== "Project Metadata"
122- | Field Name | Poetry Config | SetupTools Config | CITATION.cff | Requirement |
123- | ----------------- | ------------- | ----------------- | --------------- | ----------- |
124- | name | name | name | title | required |
125- | description | description | description | abstract | required |
126- | license | license | license | license | required |
127- | version | version | version | version | optional |
128- | | | | | |
129- | * author=true* | authors | authors | authors | required |
130- | * maintainer=true* | maintainers | maintainers | contact | optional |
131- | | | | | |
132- | keywords | keywords | keywords | keywords | optional |
133- | repository | repository | urls.repository | repository_code | optional |
134- | homepage | homepage | urls.homepage | url | optional |
125+
126+ | Field Name | Poetry Config | SetupTools Config | CITATION.cff | package.json | Requirement |
127+ | ----------------- | ------------- | ----------------- | --------------- | ------------ | ----------- |
128+ | name | name | name | title | name | required |
129+ | description | description | description | abstract | description | required |
130+ | license | license | license | license | license | required |
131+ | version | version | version | version | version | optional |
132+ | | | | | | |
133+ | *author=true* | authors | authors | authors | author | required |
134+ | *maintainer=true* | maintainers | maintainers | contact | maintainers | optional |
135+ | *people* | - | - | - | contributors | optional |
136+ | | | | | | |
137+ | keywords | keywords | keywords | keywords | keywords | optional |
138+ | repository | repository | urls.repository | repository_code | repository | optional |
139+ | homepage | homepage | urls.homepage | url | homepage | optional |
135140
136141Note that the mapping is often not 1-to-1. For example, CITATION.cff allows rich
137142specification of author contact information and complex names. In contrast,
@@ -158,26 +163,113 @@ Without an input file specifically provided, somesy will check if it can find a
158163* ` .somesy.toml `
159164* ` somesy.toml `
160165* ` pyproject.toml ` (in ` tool.somesy ` section)
166+ * ` package.json ` (in ` somesy ` section)
161167
162168which is located in the current working directory. If you want to provide
163169the somesy input file from a different location, you can pass it with the ` -i ` option.
164170
171+ ### Somesy Input File
172+
173+ Here is an example how project metadata and ` somesy ` can be configured using
174+ one of the supported input formats:
175+
176+ === "somesy.toml"
177+
178+ --8<-- "README.md:somesytoml"
179+
180+ === "pyproject.toml"
181+
182+ ```toml
183+ [tool.poetry]
184+ name = "my-amazing-project"
185+ version = "0.1.0"
186+ ...
187+
188+ [tool.somesy.project]
189+ name = "my-amazing-project"
190+ version = "0.1.0"
191+ description = "Brief description of my amazing software."
192+
193+ keywords = ["some", "descriptive", "keywords"]
194+ license = "MIT"
195+ repository = "https://github.com/username/my-amazing-project"
196+
197+ # This is you, the proud author of your project
198+ [[tool.somesy.project.people]]
199+ given-names = "Jane"
200+ family-names = "Doe"
201+ email = "j.doe@example.com"
202+ orcid = "https://orcid.org/0000-0000-0000-0001"
203+ author = true # is a full author of the project (i.e. appears in citations)
204+ maintainer = true # currently maintains the project (i.e. is a contact person)
205+
206+ # this person is a acknowledged contributor, but not author or maintainer:
207+ [[tool.somesy.project.people]]
208+ given-names = "Another"
209+ family-names = "Contributor"
210+ email = "a.contributor@example.com"
211+ orcid = "https://orcid.org/0000-0000-0000-0002"
212+
213+ [tool.somesy.config]
214+ verbose = true # show detailed information about what somesy is doing
215+ ```
216+
217+ === "package.json"
218+
219+ ```json
220+ {
221+ "name": "my-amazing-project",
222+ "version": "0.1.0",
223+ ...
224+
225+ "somesy": {
226+ "project": {
227+ "name": "my-amazing-project",
228+ "version": "0.1.0",
229+ "description": "Brief description of my amazing software.",
230+ "keywords": ["some", "descriptive", "keywords"],
231+ "license": "MIT",
232+ "repository": "https://github.com/username/my-amazing-project",
233+ "people": [
234+ {
235+ "given-names": "Jane",
236+ "family-names": "Doe",
237+ "email": "j.doe@example.com",
238+ "orcid": "https://orcid.org/0000-0000-0000-0001",
239+ "author": true,
240+ "maintainer": true
241+ },
242+ {
243+ "given-names": "Another",
244+ "family-names": "Contributor",
245+ "email": "a.contributor@example.com",
246+ "orcid": "https://orcid.org/0000-0000-0000-0002"
247+ }
248+ ]
249+ },
250+ "config": {
251+ "verbose": true
252+ }
253+ }
254+ }
255+ ```
256+
257+ All possible metadata fields and configuration options are explained further [ above] ( #schemas-overview ) .
258+
259+ ### pre-commit hook
260+
261+ --8<-- "README.md: precommit "
262+
165263### Synchronization
166264
167265Unless configured otherwise, ` somesy ` will create ` CITATION.cff `
168266and ` codemeta.json ` files if they do not exist.
169- Other supported files (such as ` pyproject.toml ` ) are updated if they already
170- exist in your repository.
267+ Other supported files (such as ` pyproject.toml ` or ` package.json ` )
268+ are updated if they already exist in your repository.
171269
172270If you do not want that somesy creates/synchronizes these files,
173271you can disable them by CLI options or in your somesy configuration.
174272
175- ### Somesy input file
176-
177- In the [ quickstart] ( ./quickstart.md ) you can find an example somesy input file.
178-
179- All possible metadata fields and configuration options are explained further [ above] ( #schemas-overview ) .
180-
181273## Metadata Update Logic
182274
183275In this section we explain a few details about how ` somesy ` updates metadata.
@@ -195,14 +287,17 @@ In most cases, `somesy` will try not to interfere with other values, metadata
195287and configuration you might have in a target file.
196288
197289!!! info
290+
198291 For typically manually-edited files, it will even make sure that the
199292 comments stay in place! (currently works for TOML)
200293
201294!!! tip
295+
202296 Only edit target files manually to add or update fields
203297 that `somesy` does **not** understand or care about!
204298
205299!!! warning
300+
206301 All changes in target files you do to fields `somesy` *does* understand will be
207302 overwritten the next time you run somesy.
208303
@@ -218,6 +313,7 @@ most cases, but in certain tricky situations it might not be able to figure out
218313the and needed changes correctly.
219314
220315!!! danger
316+
221317 Always check the files that somesy synchronized look right
222318 before committing/pushing the changes!
223319
@@ -243,9 +339,11 @@ When somesy compares two metadata records about a person, it will proceed as fol
2433393 . Otherwise, the records are considered to be about the same person if they agree on the full name (i.e. given, middle and family name sequence).
244340
245341!!! tip
342+
246343 State ORCIDs for persons whenever possible (i.e. the person has an ORCID)!
247344
248345!!! tip
346+
249347 If a person does not have an ORCID, suggest that they should create one!
250348
251349Somesy will usually correctly understand cases such as:
@@ -259,6 +357,7 @@ Nevertheless, you should **check the changes somesy does** before committing the
259357especially ** after you significantly modified your project metadata** .
260358
261359!!! warning
360+
262361 Note that changing the ORCID will not be recognized,
263362 because ORCIDs are assumed to be unique per person.
264363
@@ -281,6 +380,7 @@ target is enabled, `somesy` will generate your `codemeta.json` by:
281380* running ` cffconvert ` and ` codemetapy ` to combine both sources into a final ` codemeta.json `
282381
283382!!! warning
383+
284384 The `codemeta.json` is overwritten and regenerated from scratch every time you `sync`,
285385 so **do not edit it** if you have the codemeta target enabled in `somesy`!
286386
0 commit comments