You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are considering to support type setting for theme metadata specified in the metaType option in Theme#fromCSS, ThemeSet#add, and ThemeSet.metaType member.
Currently theme metadata only allows a single value. This behavior is very natural because Marpit only requires @theme metadata.
But in the extended class as like as Marp Core, there may be the meta key want to allow multi-time definitions. Thus, we should accept metaType option when creating Theme instance.
It is an object that has a key as the name of metadata and a value as the specified type which of String or Array. We will parse meta as String by default, included undefined meta key. The user has to set Array if the theme allows multi-time definitions in same meta key.
/** * @theme example * @foo Single value * @foo allows only one string * @bar Multiple value 1 * @bar Multiple value 2 * @bar Multiple value 3 */
constthemeSet=newThemeSet()themeSet.metaType={foo: String,bar: Array,}themeSet.add(css)console.log(themeSet.getThemeMeta('example','foo'))// => 'allows only one string'console.log(themeSet.getThemeMeta('example','bar'))// => ['Multiple value 1', 'Multiple value 2', 'Multiple value 3']
It requires in proposed marp-team/marp-core#91: The proposed @size metadata requires multi-time definitions.
We are considering to support type setting for theme metadata specified in the
metaType
option inTheme#fromCSS
,, andThemeSet#add
ThemeSet.metaType
member.Currently theme metadata only allows a single value. This behavior is very natural because Marpit only requires
@theme
metadata.But in the extended class as like as Marp Core, there may be the meta key want to allow multi-time definitions. Thus, we should accept
metaType
option when creatingTheme
instance.It is an object that has a key as the name of metadata and a value as the specified type which of
String
orArray
. We will parse meta asString
by default, included undefined meta key. The user has to setArray
if the theme allows multi-time definitions in same meta key.It requires in proposed marp-team/marp-core#91: The proposed
@size
metadata requires multi-time definitions.ToDo
metaType
option value inTheme#fromCSS
[ ] AllowmetaType
option value inThemeSet#add
metaType
member inThemeSet
class to set the default type setting forThemeSet#add
@theme
metadata as String and disallow changing type[ ] Support merging array inThemeSet#getThemeProp
Array
.ThemeSet#getThemeMeta
to get correct meta value with array supportThe text was updated successfully, but these errors were encountered: