-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Labels
Description
I'm thinking about a new format for the code metadata.
The current format is too complicated:
-
One file code:
CodeName[Win].pb,CodeName[Win,Lin].pb,CodeName.pb(all OS)Code file header:
; Description: ; OS: Windows, Linux, Mac ; English-Forum: ; French-Forum: ; German-Forum: ; ----------------------------------------------------------------------------- -
More files code:
CodeDirectoryName[Win],CodeDirectoryName[Lin,Mac],CodeDirectoryName(all OS)CodeDirectoryName/CodeInfo.txt:; Description: ; OS: Windows, Linux, Mac ; English-Forum: ; French-Forum: ; German-Forum: ; -----------------------------------------------------------------------------
How I imagine the new format at the moment:
-
One file code and more files code:
CodeDirectoryName/PackageInfo.json:{ "packageDescription": "This is an example package", "packageAuthors": "Author1, Author2", "packageVersion": "1.0 Beta 1", "packageUpdateDate": "02.10.2019 16:00", "packageLicense": "MIT License", "windowsSupport": true, "linuxSupport": true, "macSupport": true, "forumThread_DE": "https://www.purebasic.fr/german/...", "forumThread_EN": "https://www.purebasic.fr/english/...", "forumThread_FR": "https://www.purebasic.fr/french/...", "files": [ { "fileName": "Logo.png", "authors": "Author1, Author2", "version": "1.0", "updateDate": "01.10.2019 10:30", "license": "CC-BY-4.0" }, { "fileName": "Music.mp3", "authors": "Author", "version": "2.0", "updateDate": "04.09.2019 14:18", "license": "CC-BY-4.0" } ] }
As you can see, the new format now also supports metadata for non-code files.
The JSON can easily be read into a structure:
Structure CodeInfoFilesStruc
fileName$
authors$
version$
updateDate$
license$
EndStructure
Structure CodeInfoStruc
packageDescription$
packageAuthors$
packageVersion$
packageUpdateDate$
packageLicense$
windowsSupport.i
linuxSupport.i
macSupport.i
forumThread_DE$
forumThread_EN$
forumThread_FR$
List files.CodeInfoFilesStruc()
EndStructure
[...]
ExtractJSONStructure(JSONValue(json), @codeInfo, CodeInfoStruc)