@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tyleretters/discography",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "description": "A canonical discography of the music of Tyler Etters.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
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"]: