Add tags field to Workout interface
This commit is contained in:
parent
62ce66ddfa
commit
77661ca6d7
|
|
@ -49,6 +49,7 @@ Write a workout description like:
|
|||
```
|
||||
Name: Sample workout
|
||||
Author: John Doe
|
||||
Tags: Recovery, Intervals, FTP
|
||||
Description: Try changing it, and see what happens below.
|
||||
|
||||
Warmup: 10:00 30%..75%
|
||||
|
|
@ -114,7 +115,6 @@ console.log(stats(workout));
|
|||
- Repeats (and nested repeats)
|
||||
- Unsupported params: message duration & y-position
|
||||
- More restricted syntax for text (with quotes)
|
||||
- Support for tags
|
||||
|
||||
[zwift]: https://zwift.com/
|
||||
[zwofactory]: https://zwofactory.com/
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ export type Workout = {
|
|||
name: string;
|
||||
author: string;
|
||||
description: string;
|
||||
tags: string[];
|
||||
intervals: Interval[];
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ describe("Parser", () => {
|
|||
"description": "",
|
||||
"intervals": Array [],
|
||||
"name": "Untitled",
|
||||
"tags": Array [],
|
||||
}
|
||||
`);
|
||||
|
||||
|
|
@ -17,6 +18,7 @@ describe("Parser", () => {
|
|||
"description": "",
|
||||
"intervals": Array [],
|
||||
"name": "Untitled",
|
||||
"tags": Array [],
|
||||
}
|
||||
`);
|
||||
});
|
||||
|
|
@ -28,6 +30,7 @@ describe("Parser", () => {
|
|||
"description": "",
|
||||
"intervals": Array [],
|
||||
"name": "My Workout",
|
||||
"tags": Array [],
|
||||
}
|
||||
`);
|
||||
});
|
||||
|
|
@ -52,6 +55,7 @@ Description:
|
|||
it'll cause lots of pain.",
|
||||
"intervals": Array [],
|
||||
"name": "My Workout",
|
||||
"tags": Array [],
|
||||
}
|
||||
`);
|
||||
});
|
||||
|
|
@ -175,6 +179,7 @@ Interval: 5:00 50%
|
|||
},
|
||||
],
|
||||
"name": "My Workout",
|
||||
"tags": Array [],
|
||||
}
|
||||
`);
|
||||
});
|
||||
|
|
@ -477,6 +482,7 @@ Rest: 5:00 50%
|
|||
},
|
||||
],
|
||||
"name": "My Workout",
|
||||
"tags": Array [],
|
||||
}
|
||||
`);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -138,6 +138,7 @@ export const parseTokens = (tokens: Token[]): Workout => {
|
|||
name: header.name || "Untitled",
|
||||
author: header.author || "",
|
||||
description: header.description || "",
|
||||
tags: [],
|
||||
intervals: parseIntervals(intervalTokens),
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue