Skip to content

Commit e81176c

Browse files
committed
enh: improve highlighting of required and recommended sections
1 parent b506dea commit e81176c

File tree

3 files changed

+116
-37
lines changed

3 files changed

+116
-37
lines changed

docs/community/licensing.md

Lines changed: 109 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ The *high-level description of the changes* will preferably contain:
6262
## Example of our expectations
6363

6464
Let's say a Derived Work modifies the `sdcflows.viz.utils` code-base.
65-
Some files may not have the attribution notice.
65+
The file may or may not have the attribution notice.
6666
At the time of writing, the header comment of [this file](https://github.com/nipreps/sdcflows/blob/50393a8584dd0abf5f8e16e6ba66c43e1126f844/sdcflows/viz/utils.py) is:
6767

6868
!!! example "Header comment in the original Work"
@@ -98,42 +98,114 @@ Either way (whether the attribution notice is present or not), we suggest to upd
9898

9999
!!! example "Suggested header comment in the Derived Work"
100100

101-
``` {.python hl_lines="5 6 19 20 21 22 23 24 25 26 27 28 29 30 31"}
102-
# <shebang and editor settings can be preserved or removed freely>
103-
#
104-
# <your attribution notice, either maintaining the Apache-2.0 license or changing the license>
105-
#
106-
# STATEMENT OF CHANGES: This file is derived from sources licensed under the Apache-2.0 terms,
107-
# and this file has been changed.
108-
# <recommended> The original file this work derives from is found at:
109-
# https://github.com/nipreps/sdcflows/blob/50393a8584dd0abf5f8e16e6ba66c43e1126f844/sdcflows/viz/utils.py
110-
# <alternative> The original file this work derives from is found within
111-
# the version 2.0.2 distribution of the software.
112-
#
113-
# <recommended> [April 2021] CHANGES:
114-
# * BUGFIX: Outdated function call from the ``svgutils`` dependency that changed API as of version 0.3.2.
115-
# * ENH: Changed plotting dependency to the new `netplotbrain` package.
116-
# * DOC: Added docstrings to some functions that lacked them.
117-
#
118-
# ORIGINAL WORK'S ATTRIBUTION NOTICE:
119-
#
120-
# Copyright 2021 The NiPreps Developers <[email protected]>
121-
#
122-
# Licensed under the Apache License, Version 2.0 (the "License");
123-
# you may not use this file except in compliance with the License.
124-
# You may obtain a copy of the License at
125-
#
126-
# http://www.apache.org/licenses/LICENSE-2.0
127-
#
128-
# Unless required by applicable law or agreed to in writing, software
129-
# distributed under the License is distributed on an "AS IS" BASIS,
130-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
131-
# See the License for the specific language governing permissions and
132-
# limitations under the License.
133-
"""Visualization tooling."""
134-
```
135-
136-
Only the lines highlighted are explicitly required by the Apache-2.0 conditions.
101+
=== "Required"
102+
103+
``` {.python hl_lines="5 6 19 20 21 22 23 24 25 26 27 28 29"}
104+
# <shebang and editor settings can be preserved or removed freely>
105+
#
106+
# <your attribution notice, either maintaining the Apache-2.0 license or changing the license>
107+
#
108+
# STATEMENT OF CHANGES: This file is derived from sources licensed under the Apache-2.0 terms,
109+
# and this file has been changed.
110+
# The original file this work derives from is found at:
111+
# https://github.com/nipreps/sdcflows/blob/50393a8584dd0abf5f8e16e6ba66c43e1126f844/sdcflows/viz/utils.py
112+
#
113+
# [April 2021] CHANGES:
114+
# * BUGFIX: Outdated function call from the ``svgutils`` dependency that changed API as of version 0.3.2.
115+
# * ENH: Changed plotting dependency to the new `netplotbrain` package.
116+
# * DOC: Added docstrings to some functions that lacked them.
117+
#
118+
# ORIGINAL WORK'S ATTRIBUTION NOTICE:
119+
#
120+
# Copyright 2021 The NiPreps Developers <[email protected]>
121+
#
122+
# Licensed under the Apache License, Version 2.0 (the "License");
123+
# you may not use this file except in compliance with the License.
124+
# You may obtain a copy of the License at
125+
#
126+
# http://www.apache.org/licenses/LICENSE-2.0
127+
#
128+
# Unless required by applicable law or agreed to in writing, software
129+
# distributed under the License is distributed on an "AS IS" BASIS,
130+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
131+
# See the License for the specific language governing permissions and
132+
# limitations under the License.
133+
"""Visualization tooling."""
134+
```
135+
The lines highlighted with yellow color are explicitly required by the Apache-2.0 conditions.
136+
137+
=== "Recommended (commit)"
138+
139+
``` {.python .recommended hl_lines="7 8 9 10 11 12 13 14 15 16"}
140+
# <shebang and editor settings can be preserved or removed freely>
141+
#
142+
# <your attribution notice, either maintaining the Apache-2.0 license or changing the license>
143+
#
144+
# STATEMENT OF CHANGES: This file is derived from sources licensed under the Apache-2.0 terms,
145+
# and this file has been changed.
146+
# The original file this work derives from is found at:
147+
# https://github.com/nipreps/sdcflows/blob/50393a8584dd0abf5f8e16e6ba66c43e1126f844/sdcflows/viz/utils.py
148+
#
149+
# [April 2021] CHANGES:
150+
# * BUGFIX: Outdated function call from the ``svgutils`` dependency that changed API as of version 0.3.2.
151+
# * ENH: Changed plotting dependency to the new `netplotbrain` package.
152+
# * DOC: Added docstrings to some functions that lacked them.
153+
#
154+
# ORIGINAL WORK'S ATTRIBUTION NOTICE:
155+
#
156+
# Copyright 2021 The NiPreps Developers <[email protected]>
157+
#
158+
# Licensed under the Apache License, Version 2.0 (the "License");
159+
# you may not use this file except in compliance with the License.
160+
# You may obtain a copy of the License at
161+
#
162+
# http://www.apache.org/licenses/LICENSE-2.0
163+
#
164+
# Unless required by applicable law or agreed to in writing, software
165+
# distributed under the License is distributed on an "AS IS" BASIS,
166+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
167+
# See the License for the specific language governing permissions and
168+
# limitations under the License.
169+
"""Visualization tooling."""
170+
```
171+
The lines highlighted with green color are recommended by the *NiPreps Developers*.
172+
173+
=== "Recommended (version)"
174+
175+
``` {.python .recommended hl_lines="7 8 9 10 11 12 13 14 15 16"}
176+
# <shebang and editor settings can be preserved or removed freely>
177+
#
178+
# <your attribution notice, either maintaining the Apache-2.0 license or changing the license>
179+
#
180+
# STATEMENT OF CHANGES: This file is derived from sources licensed under the Apache-2.0 terms,
181+
# and this file has been changed.
182+
# The original file this work derives from is found within
183+
# the version 2.0.2 distribution of the software.
184+
#
185+
# [April 2021] CHANGES:
186+
# * BUGFIX: Outdated function call from the ``svgutils`` dependency that changed API as of version 0.3.2.
187+
# * ENH: Changed plotting dependency to the new `netplotbrain` package.
188+
# * DOC: Added docstrings to some functions that lacked them.
189+
#
190+
# ORIGINAL WORK'S ATTRIBUTION NOTICE:
191+
#
192+
# Copyright 2021 The NiPreps Developers <[email protected]>
193+
#
194+
# Licensed under the Apache License, Version 2.0 (the "License");
195+
# you may not use this file except in compliance with the License.
196+
# You may obtain a copy of the License at
197+
#
198+
# http://www.apache.org/licenses/LICENSE-2.0
199+
#
200+
# Unless required by applicable law or agreed to in writing, software
201+
# distributed under the License is distributed on an "AS IS" BASIS,
202+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
203+
# See the License for the specific language governing permissions and
204+
# limitations under the License.
205+
"""Visualization tooling."""
206+
```
207+
The lines highlighted with green color are recommended by the *NiPreps Developers*.
208+
137209
Although it is not mandated by the license letter, the spirit of the Apache-2.0 (and all other licenses stipulating the statement of changes, such as the CC-BY 4.0) suggests that a date of modification and an overview of outstanding changes are pertinent.
138210
We also suggest a link to the original code, including the commit-hash (that long string starting with `50393a` in the URL above) for the location of the exact origin of the file.
139211
Alternatively, Derived Works may point to a exact release identifier where the original file is part of the code-base distribution.

docs/stylesheets/extra.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
div.recommended.highlight span.hll {
3+
background-color: #a7e8c8;
4+
}

mkdocs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,6 @@ markdown_extensions:
5151

5252
plugins:
5353
- toc-sidebar
54+
55+
extra_css:
56+
- stylesheets/extra.css

0 commit comments

Comments
 (0)