ioccc-src / mkiocccentry

Form an IOCCC submission as a compressed tarball file
Other
28 stars 6 forks source link

Enhancement: Add `title` and `abstract` from `.info.json` to .entry.json #979

Open lcn2 opened 2 hours ago

lcn2 commented 2 hours ago

Is there an existing issue for this?

Describe the enhancement

The mkiocccentry(1) tool, today, adds to the .info.json file it creates:

    "abstract" : "a short abstract",

We propose that the same abstract field become a required field in an entry's .entry.json file.

The mkiocccentry(1) tool, today, also adds to the .info.json file it creates:

    "title" : "title.9",

We propose that the same title field become a required field in an entry's .entry.json file.

Relevant images, screenshots or other files

We are not sure exactly how the title and abstract will be used by the "other repo".

The title might not be used, however we might as well out it in now in case it proves useful later on. And if it is not used, it won't hurt. See the related issue the "other repo" for more on that when it is created.

PLEASE to NOT discus how the title and abstract will be used by the "other repo" in this issue. Use the related issue the "other repo" when that issue is created for that. The same goes for the bin tools used by the "other repo".

Relevant links

TBD: we will add a link to a related issue the "other repo" when that issue is created.

Anything else?

When adding title and abstract to .entry.json er command that you add them after the entry_id and before the author_set.

For example 2020/ferguson1/.entry.json would change from:

{
    "no_comment" : "mandatory comment: because comments were removed from the original JSON spec",
    "entry_JSON_format_version" : "1.1 2024-02-11",
    "award" : "Don't tread on me award",
    "year" : 2020,
    "dir" : "ferguson1",
    "entry_id" : "2020_ferguson1",
    "author_set" : [
        {
            "author_handle" : "Cody_Boone_Ferguson"
        }
    ],
    "manifest" : [
...
}

To (we are making up / guessing at a title and abstract here):

{
    "no_comment" : "mandatory comment: because comments were removed from the original JSON spec",
    "entry_JSON_format_version" : "1.2 2024-09-24",
    "award" : "Don't tread on me award",
    "year" : 2020,
    "dir" : "ferguson1",
    "entry_id" : "2020_ferguson1",
    "title" : "snake",
    "abstract" : "Feature-rich curses implementation of the Snake game",
    "author_set" : [
        {
            "author_handle" : "Cody_Boone_Ferguson"
        }
    ],
    "manifest" : [
...
}

The same limits that for into a submission's title and abstract would apply to a submission's .entry.json file.

For example:

#define MAX_TITLE_LEN (32)              /* maximum length of a title */
#define MAX_ABSTRACT_LEN (64)           /* maximum length of an abstract */

For title, the chk_title(.) function restrictions implanted by soup/chk_validate.c would apply.

For abstract, the chk_abstract() function restrictions implanted by soup/chk_validate.c would also apply.

The entry_JSON_format_version value would need to change.

NOTE: There is no change to .info.json, so tools such as mkiocccentry(1) do not change.

For course when issue #940 is implanted, the chkentry(1) tool would change .. but that is for another issue at a later date.

For this repo, the impact is probably mostly in the test cases that related .entry.json file tests. Those should be updated with the new title and abstract as well as the updated entry_JSON_format_version value.

This is a priority update as issue #956 will depend on this being completed.

And as always, there may be an UPDATE 0 to this comment.

Also NO, this is NOT an invitation to throw in the kitchen sink into a new .entry.json format. This is limited to just title and abstract.

And comments to this issue that relate to THIS REPO are welcome.

UPDATE 0

What documentation in this repo, if any, needs to be updated as a result of this issue?

xexyl commented 2 hours ago

Thanks - glad you think the idea is a good one.

Please assign .. and funny last paragraph. I won't of course.

I'll have to read this later .. hopefully tomorrow but if not then later in the week for sure.

xexyl commented 2 hours ago

UPDATE 0

What documentation in this repo, if any, needs to be updated as a result of this issue?

My guess is the FAQ in the other repo? I'm not even sure why there has to be a code change here - not until chkentry(1) validates .entry.json .. except maybe minor changes like .entry.json version macro and such.

Anyway I'll get to this in the next couple days or so. I think I'll probably try and finish the -V stuff first and then this.

xexyl commented 2 hours ago

One other thing real quick. I think in the example that would not be the abstract. I would have used that but I think it should be what you have in the summary.txt file. That was my original idea - so that it would be easy to extract to make a summary.html file instead and to allow easily fixing anything.

That's why I thought of another name btw.