Skip to content

Commit d5a1f44

Browse files
committed
show all input examples
1 parent 54cbe6e commit d5a1f44

1 file changed

Lines changed: 113 additions & 34 deletions

File tree

README.md

Lines changed: 113 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -58,37 +58,115 @@ Yes, somesy is *another* tool with its own configuration. However, for your
5858
project metadata it is hopefully the last file you need, and the only one you
5959
have to think about, `somesy` will take care of the others for you!
6060

61-
To get started, create a file named `somesy.toml` (or `.somesy.toml`):
62-
63-
```toml
64-
[project]
65-
name = "my-amazing-project"
66-
version = "0.1.0"
67-
description = "Brief description of my amazing software."
68-
69-
keywords = ["some", "descriptive", "keywords"]
70-
license = "MIT"
71-
repository = "https://github.com/username/my-amazing-project"
72-
73-
# This is you, the proud author of your project
74-
[[project.people]]
75-
given-names = "Jane"
76-
family-names = "Doe"
77-
email = "j.doe@example.com"
78-
orcid = "https://orcid.org/0000-0000-0000-0001"
79-
author = true # is a full author of the project (i.e. appears in citations)
80-
maintainer = true # currently maintains the project (i.e. is a contact person)
81-
82-
# this person is a acknowledged contributor, but not author or maintainer:
83-
[[project.people]]
84-
given-names = "Another"
85-
family-names = "Contributor"
86-
email = "a.contributor@example.com"
87-
orcid = "https://orcid.org/0000-0000-0000-0002"
88-
89-
[config]
90-
verbose = true # show detailed information about what somesy is doing
91-
```
61+
To get started, create a file named `somesy.toml` (or `.somesy.toml`) or add somesy config to your existing `pyproject.toml` or `package.json` file:
62+
63+
64+
=== "somesy.toml"
65+
```toml
66+
[project]
67+
name = "my-amazing-project"
68+
version = "0.1.0"
69+
description = "Brief description of my amazing software."
70+
71+
keywords = ["some", "descriptive", "keywords"]
72+
license = "MIT"
73+
repository = "https://github.com/username/my-amazing-project"
74+
75+
# This is you, the proud author of your project
76+
[[project.people]]
77+
given-names = "Jane"
78+
family-names = "Doe"
79+
email = "j.doe@example.com"
80+
orcid = "https://orcid.org/0000-0000-0000-0001"
81+
author = true # is a full author of the project (i.e. appears in citations)
82+
maintainer = true # currently maintains the project (i.e. is a contact person)
83+
84+
# this person is a acknowledged contributor, but not author or maintainer:
85+
[[project.people]]
86+
given-names = "Another"
87+
family-names = "Contributor"
88+
email = "a.contributor@example.com"
89+
orcid = "https://orcid.org/0000-0000-0000-0002"
90+
91+
[config]
92+
verbose = true # show detailed information about what somesy is doing
93+
```
94+
95+
=== "pyproject.toml"
96+
```toml
97+
[tool.poetry]
98+
name = "my-amazing-project"
99+
version = "0.1.0"
100+
...
101+
102+
[tool.somesy.project]
103+
name = "my-amazing-project"
104+
version = "0.1.0"
105+
description = "Brief description of my amazing software."
106+
107+
keywords = ["some", "descriptive", "keywords"]
108+
license = "MIT"
109+
repository = "https://github.com/username/my-amazing-project"
110+
111+
# This is you, the proud author of your project
112+
[[tool.somesy.project.people]]
113+
given-names = "Jane"
114+
family-names = "Doe"
115+
email = "j.doe@example.com"
116+
orcid = "https://orcid.org/0000-0000-0000-0001"
117+
author = true # is a full author of the project (i.e. appears in citations)
118+
maintainer = true # currently maintains the project (i.e. is a contact person)
119+
120+
# this person is a acknowledged contributor, but not author or maintainer:
121+
[[tool.somesy.project.people]]
122+
given-names = "Another"
123+
family-names = "Contributor"
124+
email = "a.contributor@example.com"
125+
orcid = "https://orcid.org/0000-0000-0000-0002"
126+
127+
[tool.somesy.config]
128+
verbose = true # show detailed information about what somesy is doing
129+
```
130+
131+
=== "package.json"
132+
```json
133+
{
134+
"name": "my-amazing-project",
135+
"version": "0.1.0",
136+
...
137+
138+
"somesy": {
139+
"project": {
140+
"name": "my-amazing-project",
141+
"version": "0.1.0",
142+
"description": "Brief description of my amazing software.",
143+
"keywords": ["some", "descriptive", "keywords"],
144+
"license": "MIT",
145+
"repository": "https://github.com/username/my-amazing-project",
146+
"people": [
147+
{
148+
"given-names": "Jane",
149+
"family-names": "Doe",
150+
"email": "j.doe@example.com",
151+
"orcid": "https://orcid.org/0000-0000-0000-0001",
152+
"author": true,
153+
"maintainer": true
154+
},
155+
{
156+
"given-names": "Another",
157+
"family-names": "Contributor",
158+
"email": "a.contributor@example.com",
159+
"orcid": "https://orcid.org/0000-0000-0000-0002"
160+
}
161+
]
162+
},
163+
"config": {
164+
"verbose": true
165+
}
166+
}
167+
}
168+
```
169+
92170

93171
If you happen to work on a Python project and use a `pyproject.toml`, you can also put this information there and avoid having another separate file. In that case, simply prepend `tool.somesy` to the names of all sections (i.e. `[project]` becomes `[tool.somesy.project]`).
94172

@@ -145,16 +223,17 @@ Here is an overview of all the currently supported files and formats.
145223
| -------------- | ------ |-| ----------------------------- | ------ |
146224
| (.)somesy.toml | ✓ | | pyproject.toml _(poetry)_ | ✓ |
147225
| pyproject.toml | ✓(1.) | | pyproject.toml _(setuptools)_ | ✓(2.) |
148-
| package.json | ✓ | | package.json | ✓ |
226+
| package.json | ✓ | | package.json | ✓(3.) |
149227
| | | | mkdocs.yml | TBD |
150228
| | | | CITATION.cff | ✓ |
151-
| | | | codemeta.json | ✓(3.) |
229+
| | | | codemeta.json | ✓(4.) |
152230

153231
**Notes:**
154232

155233
1. information must be placed inside a `tool.somesy` section (as explained above)
156234
2. note that `somesy` does not support setuptools *dynamic fields*
157-
3. unlike other targets, `somesy` will *re-create* the `codemeta.json` (i.e. you should not edit it by hand!)
235+
3. `package.json` author field allows only one author information. Therefore, somesy sets the first person with author field, in the people definition, as the author.
236+
4. unlike other targets, `somesy` will *re-create* the `codemeta.json` (i.e. you should not edit it by hand!)
158237

159238
<!-- --8<-- [end:quickstart] -->
160239

0 commit comments

Comments
 (0)