You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/actions/get-metadata/README.md
+21-2
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Get metadata
2
2
3
-
This action gets the metadata for each JW Lua script and writes it to a JSON file. This way, users can easily find scripts that they'd like to use. This action creates the metadata for the [docs](https://jw-lua-scripts-docs.vercel.app/) website.
3
+
This action gets the metadata for each Lua script and writes it to a JSON file. This way, users can easily find scripts that they'd like to use. This action creates the metadata for the [docs](https://finalelua.com/) website.
4
4
5
5
## Format
6
6
@@ -18,7 +18,7 @@ Each script is represented as a JSON object with the following properties:
18
18
-`categories (string[])`: An array of categories for the script
19
19
-`date (string)`: The date the script was created in the format `YYYY-MM-DD` ([ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html))
20
20
-`notes (string)`: Longer description of the plug-in and user instructions, can contain multiple lines
21
-
-`revisionNotes (string[])`: Revision history text that might be of interest to an end user, can contain multiple lines
21
+
-`revisionNotes (string[])`: Revision **history** text that might be of interest to an end user, can contain multiple lines
22
22
-`authorUrl (string)`: The author's URL
23
23
-`authorEmail (string)`: The author's email
24
24
-`id (string)`: The ID of the script
@@ -32,3 +32,22 @@ This is the author data from the script. It contains the following properties:
32
32
-`name (string)`: The name of the author
33
33
-`website (string)`: The author's website
34
34
-`email (string)`: The author's email
35
+
36
+
## How it works
37
+
38
+
- Loop through all the `lua` files in the `src` folder
39
+
- Load the text of each file
40
+
- Extract the contents of the `plugindef` function with a regular expression
41
+
- Pass the `plugindef` function to the Lua interpreter, along with Lua code that
42
+
invokes the function and grabs its return values and the values from the
43
+
`finaleplugin` table
44
+
- Return the captured data as a JSON object
45
+
- Perform some manipulation on the JSON (dates, string arrays, etc.)
46
+
- Build an array of the returned JSON and save to a file
47
+
48
+
## Caution
49
+
50
+
`MinJWLuaVersion` and `MaxJWLuaVersion` Min/MaxJWLuaVersion are defined as numbers in Lua,
51
+
but they're expected to have two decimal places -- v0.70 is not v0.7. A function in `parse.ts`
52
+
ensures that the values will display with two decimal places. If there's eveer a case where
53
+
the input value has more or fewer decimal places (e.g., v0.100), this will need to be revisited.
0 commit comments