@tyleretters/discography 0.0.10 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/discography.js +78 -78
- package/dist/discography.js.map +1 -1
- package/dist/index.js +78 -78
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/convert.py +10 -0
- package/src/discography.ts +78 -78
package/package.json
CHANGED
package/src/convert.py
CHANGED
|
@@ -42,6 +42,12 @@ def make_slug(str):
|
|
|
42
42
|
str = re.sub(r'--+', '-', str)
|
|
43
43
|
return str
|
|
44
44
|
|
|
45
|
+
def make_html_paragraphs(str):
|
|
46
|
+
str = str.rstrip("\n")
|
|
47
|
+
str = "<p>" + str + "</p>"
|
|
48
|
+
str = str.replace("\n", "</p><p>")
|
|
49
|
+
return str
|
|
50
|
+
|
|
45
51
|
# load data
|
|
46
52
|
with open(yml_path, "r") as yml_file:
|
|
47
53
|
data = yaml.safe_load(yml_file)
|
|
@@ -60,6 +66,10 @@ for release in data:
|
|
|
60
66
|
# generate an id
|
|
61
67
|
release["id"] = make_id(release["project"] + release["title"])
|
|
62
68
|
|
|
69
|
+
# turn \n into paragraphs
|
|
70
|
+
release["notes"] = make_html_paragraphs(release["notes"])
|
|
71
|
+
release["credits"] = make_html_paragraphs(release["credits"])
|
|
72
|
+
|
|
63
73
|
# generate a slug for each track
|
|
64
74
|
if "tracks" in release:
|
|
65
75
|
for track in release["tracks"]:
|