Skip to content

Commit 86ae5d0

Browse files
authored
style: 💄 refactor so WIP status of interface are icons (#1041)
## Description The main reason for this stylistic change is that Mermaid diagrams don't seem to like being in a callout-block. So I removed the callout blocks and used icons instead. <!-- Select quick/in-depth as necessary --> This PR needs a quick review. ## Checklist - [x] Updated documentation - [x] Ran `just run-all`
1 parent cb2afaa commit 86ae5d0

File tree

2 files changed

+52
-99
lines changed

2 files changed

+52
-99
lines changed

_variables.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
done: '[{{< fa circle-check size="l" title="Completed" >}}]{style="color: #47DC76"}'
2+
wip: '[{{< fa hammer size="l" title="In progress" >}}]{style="color: #7647DC"}'

docs/design/interface/functions.qmd

Lines changed: 50 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,17 @@
22
title: "Functions and classes"
33
callout-icon: false
44
callout-appearance: "minimal"
5+
toc-depth: 2
56
---
67

8+
```{=html}
9+
<style>
10+
h3 {
11+
font-size: 1.1em;
12+
}
13+
</style>
14+
```
15+
716
::: {.callout-important appearance="default" icon="true"}
817
We created this document mainly as a way to help us as a team all
918
understand and agree on what we're making and what needs to be worked
@@ -51,73 +60,58 @@ and resource(s) in the package. This metadata is stored in the
5160
`datapackage.json` file and follows the Frictionless Data specification.
5261

5362
::: {.callout-important appearance="default" icon="true"}
54-
Functions shown in orange are not yet implemented while those in blue
55-
are implemented.
63+
Functions shown with a {{< var wip >}} icon are not yet implemented
64+
while those with a {{< var done >}} icon are implemented.
5665
:::
5766

5867
## Data package functions
5968

60-
::: {.callout-warning collapse="true"}
61-
### `create_package_properties(properties, path)`
69+
### {{< var wip >}} `create_package_properties(properties, path)`
6270

6371
This is the first function to use to create a new data package. It
6472
generates a template for the `datapackage.json` file where the user
6573
needs to fill in required fields by providing the `properties` argument
6674
using the helper `PackageProperties` class. Outputs a full Properties
6775
object. Use `write_package_properties()` to store the properties to the
6876
`datapackage.json` file.
69-
:::
7077

71-
::: {.callout-warning collapse="true"}
72-
### `build_readme_text(properties)`
78+
### {{< var wip >}} `build_readme_text(properties)`
7379

7480
Using a template, this will build a README file with the contents of the
7581
properties object in a human-readable format. Outputs a text string. Use
7682
`write_text()` to save the text to the `README.md` file.
77-
:::
7883

79-
::: {.callout-note collapse="true"}
80-
### `edit_package_properties(path, properties)`
84+
### {{< var done >}} `edit_package_properties(path, properties)`
8185

8286
See the help documentation with `help(edit_package_properties())` for
8387
more details.
84-
:::
8588

86-
::: {.callout-warning collapse="true"}
87-
### `delete_package(path, confirm)`
89+
### {{< var wip >}} `delete_package(path, confirm)`
8890

8991
Completely delete a specific package and all it's data resources.
9092
Because this action would be permanent, the `confirm` argument would
9193
default to `false` so that the user needs to explicitly provide `true`
9294
to the function argument as confirmation. This is done to prevent
9395
accidental deletion. Outputs `true` if the deletion was successful.
94-
:::
9596

96-
::: {.callout-note collapse="true"}
97-
### `write_package_properties(properties, path)`
97+
### {{< var done >}} `write_package_properties(properties, path)`
9898

99-
See the help documentation with `help(write_package_properties)` for more
100-
details.
101-
:::
99+
See the help documentation with `help(write_package_properties)` for
100+
more details.
102101

103102
## Data resource functions
104103

105-
::: {.callout-note collapse="true"}
106-
### `create_resource_structure(path)`
104+
### {{< var done >}}`create_resource_structure(path)`
107105

108-
See the help documentation with `help(create_resource_structure)` for more
109-
details.
110-
:::
106+
See the help documentation with `help(create_resource_structure)` for
107+
more details.
111108

112-
::: {.callout-note collapse="true"}
113-
### `create_resource_properties(path, properties)`
109+
### {{< var done >}} `create_resource_properties(path, properties)`
114110

115-
see the help documentation with `help(create_resource_properties)` for more
116-
details.
117-
:::
111+
See the help documentation with `help(create_resource_properties)` for
112+
more details.
118113

119-
::: {.callout-warning collapse="true"}
120-
### `write_resource_data_to_raw(data_path, resource_properties)`
114+
### {{< var wip >}} `write_resource_data_to_raw(data_path, resource_properties)`
121115

122116
See the help documentation with `help(write_resource_data_to_raw)` for
123117
more details.
@@ -132,31 +126,25 @@ flowchart
132126
in_properties --> function
133127
function --> out
134128
```
135-
:::
136129

137-
::: {.callout-warning collapse="true"}
138-
### `write_resource_parquet(raw_files, path)`
130+
### {{< var wip >}} `write_resource_parquet(raw_files, path)`
139131

140132
This function takes the files provided by `raw_files` and merges them
141133
into a `data.parquet` file provided by `path`. Use
142134
`path_resource_data()` to provide the correct path location for `path`
143135
and `path_resource_raw_files()` for the `raw_files` argument. Outputs
144136
the path object of the created file.
145-
:::
146137

147-
::: {.callout-warning collapse="true"}
148-
### `edit_resource_properties(path, properties)`
138+
### {{< var wip >}} `edit_resource_properties(path, properties)`
149139

150140
Edit the properties of a resource in a package. The `properties`
151141
argument must be a JSON object that follows the Frictionless Data
152142
specification. Use the `path_properties()` function to provide the
153143
correct path location. Outputs a JSON object only; use
154144
`write_resource_properties()` to save the JSON object to the
155145
`datapackage.json` file.
156-
:::
157146

158-
::: {.callout-warning collapse="true"}
159-
### `delete_resource_raw_file(path, confirm)`
147+
### {{< var wip >}} `delete_resource_raw_file(path, confirm)`
160148

161149
Use this to delete a raw file in the `raw/` folder of a resource. This
162150
is useful if the file is no longer needed or if it is incorrect or had
@@ -166,10 +154,8 @@ list of files found. Will only delete one file. The `confirm` argument
166154
defaults to `false` so that the user needs to explicitly provide `true`
167155
to the function argument as confirmation. This is done to prevent
168156
accidental deletion. Outputs `true` if the deletion was successful.
169-
:::
170157

171-
::: {.callout-warning collapse="true"}
172-
### `delete_resource_data(path, confirm)`
158+
### {{< var wip >}} `delete_resource_data(path, confirm)`
173159

174160
Delete all data (Parquet) and raw data of a specific resource. Use
175161
`path_resource_raw()` to provide the correct path location. The
@@ -178,32 +164,25 @@ explicitly provide `true` to the function argument as confirmation. This
178164
is done to prevent accidental deletion. Outputs `true` if the deletion
179165
was successful. Use `delete_resource_properties()` to delete the the
180166
associated properties/metadata for the resource.
181-
:::
182167

183-
::: {.callout-warning collapse="true"}
184-
### `delete_resource_properties(path, confirm)`
168+
### {{< var wip >}} `delete_resource_properties(path, confirm)`
185169

186170
Deletes all properties for a resource within the `datapackage.json`
187171
file. Use `path_properties()` to provide the correct location for
188172
`path`. The `confirm` argument defaults to `false` so that the user
189173
needs to explicitly provide `true` to the function argument as
190174
confirmation. This is done to prevent accidental deletion. Outputs
191175
`true` if the deletion was successful.
192-
:::
193176

194-
::: {.callout-note collapse="true"}
195-
### `write_resource_properties(properties, path)`
177+
### {{< var done >}} `write_resource_properties(properties, path)`
196178

197-
See the help documentation with `help(write_resource_properties)` for more
198-
details.
199-
:::
179+
See the help documentation with `help(write_resource_properties)` for
180+
more details.
200181

201-
::: {.callout-note collapse="true"}
202-
### `extract_resource_properties(data_path)`
182+
### {{< var done >}} `extract_resource_properties(data_path)`
203183

204-
See the help documentation with `help(extract_resource_properties)` for more
205-
details.
206-
:::
184+
See the help documentation with `help(extract_resource_properties)` for
185+
more details.
207186

208187
## Path functions
209188

@@ -213,45 +192,33 @@ details.
213192
- If the wrong `resource_id` is given, an error message will include a
214193
list of all the actual `resource_id`s for a specific package.
215194

216-
::: {.callout-note collapse="true"}
217-
### `path_properties(path)`
195+
### {{< var done >}} `path_properties(path)`
218196

219197
See the help documentation with `help(path_properties)` for more
220198
details.
221-
:::
222199

223-
::: {.callout-note collapse="true"}
224-
### `path_resources()`
200+
### {{< var done >}} `path_resources()`
225201

226202
See the help documentation with `help(path_resources)` for more details.
227-
:::
228203

229-
::: {.callout-note collapse="true"}
230-
### `path_resource(resource_id)`
204+
### {{< var done >}} `path_resource(resource_id)`
231205

232206
See the help documentation with `help(path_resource)` for more details.
233-
:::
234207

235-
::: {.callout-note collapse="true"}
236-
### `path_resource_raw(resource_id)`
208+
### {{< var done >}} `path_resource_raw(resource_id)`
237209

238210
See the help documentation with `help(path_resource_raw)` for more
239211
details.
240-
:::
241212

242-
::: {.callout-note collapse="true"}
243-
### `path_resource_raw_files(package_id, resource_id)`
213+
### {{< var done >}} `path_resource_raw_files(package_id, resource_id)`
244214

245215
See the help documentation with `help(path_resource_raw_files)` for more
246216
details.
247-
:::
248217

249-
::: {.callout-note collapse="true"}
250-
### `path_resource_data(package_id, resource_id)`
218+
### {{< var done >}} `path_resource_data(package_id, resource_id)`
251219

252220
See the help documentation with `help(path_resource_data)` for more
253221
details.
254-
:::
255222

256223
## Properties dataclasses
257224

@@ -261,36 +228,28 @@ to allow us to pass structured properties objects between functions.
261228
They also enable users to create valid properties objects more easily
262229
and get an overview of optional and required class fields.
263230

264-
::: {.callout-note collapse="true"}
265-
### `PackageProperties`
231+
### {{< var done >}} `PackageProperties`
266232

267233
See the help documentation with `help(PackageProperties())` for more
268234
details on the properties.
269-
:::
270235

271236
## Properties functions
272237

273-
::: {.callout-warning collapse="true"}
274-
### `read_properties(path)`
238+
### {{< var wip >}} `read_properties(path)`
275239

276240
Reads the `datapackage.json` file, checks that is correct, and then
277241
outputs a `PackageProperties` object.
278-
:::
279242

280243
## Helper functions
281244

282-
::: {.callout-warning collapse="true"}
283-
### `pretty_json(json)`
245+
### {{< var wip >}} `pretty_json(json)`
284246

285247
Create a prettier, human readable version of a JSON object.
286-
:::
287248

288-
::: {.callout-warning collapse="true"}
289-
### `write_text(text, path)`
249+
### {{< var wip >}} `write_text(text, path)`
290250

291251
Writes a text string to a file at the given path. Outputs the path
292252
object of the created file.
293-
:::
294253

295254
## Observational unit functions
296255

@@ -299,11 +258,9 @@ animal, event) that the data was collected on. An example would be: A
299258
person in a research study who came to the clinic in May 2024 to have
300259
their blood collected and to fill out a survey.
301260

302-
::: {.callout-warning collapse="true"}
303-
### `delete_participant_data()`
261+
### {{< var wip >}} `delete_participant_data()`
304262

305263
TODO.
306-
:::
307264

308265
## Multi-user environments
309266

@@ -315,21 +272,15 @@ All the below `path_*()` functions use `path_sprout_global()` internally
315272
to get the global path as well as `package_id` and/or `resource_id` to
316273
complete the correct path for the specific package/resource.
317274

318-
::: {.callout-note collapse="true"}
319-
### `path_packages()`
275+
### {{< var done >}} `path_packages()`
320276

321277
See the help documentation with `help(path_packages)` for more details.
322-
:::
323278

324-
::: {.callout-note collapse="true"}
325-
### `path_package(package_id)`
279+
### {{< var done >}} `path_package(package_id)`
326280

327281
See the help documentation with `help(path_package)` for more details.
328-
:::
329282

330-
::: {.callout-note collapse="true"}
331-
### `path_sprout_global()`
283+
### {{< var done >}} `path_sprout_global()`
332284

333285
See the help documentation with `help(path_sprout_global)` for more
334286
details.
335-
:::

0 commit comments

Comments
 (0)