Skip to content

Improvement of code metadata #11

@SicroAtGit

Description

@SicroAtGit

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)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions