Open AFCMS opened 3 years ago
This will need to be done in the postReleaseCheckUpdate hook here: https://github.com/minetest/contentdb/blob/master/app/tasks/importtasks.py#L115
Perhaps split the cdb reading into a new function such that the code does:
try:
data = get_edit_data_from_dir(tree.baseDir)
if data != {}: # Not sure if this will actually work to check not empty, probably not
do_edit_package(package.author, package, False, data, "Post release hook")
except LogicError as e:
raise TaskError(e.message)
Then get_edit_data_from_dir(path)
would read {path}/.cdb.json
and {path}/.cdb.md
. The value of .cdb.md
would be set into data["long_description"]
before it is returned. Make sure to convert line endings from \r\n
to \n
, and also handle the case where .cdb.json
doesn't exist
Perhaps get_edit_data_from_dir
should also support {path}/.cdb/meta.json
and {path}/.cdb/long_description.md
Not a fan of the array.
Yeah, me neither
I would love to have a .cdb.md for the long description. It would enable having all the information from the contentdb under revision control.
Alternatively, we could provide a way to point to the file path of a markdown file from within .cdb.json, but .cdb.md seems simplest to implement.
Problem
using the
long_description
field isn't possible, because you cant add new lines without using\n
making a line of lengh > 200 isn't really good for readability....Solutions
concatenate the strings in an array
Alternatives
?
Additional context