diff --git a/README.md b/README.md index ab633b5..b0e407c 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,9 @@ RSS 2.0: https://cyber.harvard. Podcasts: https://help.apple.com/itc/podcasts_connect/#/itca5b22233 ### Release Notes +1.1.0 +* Enabling CDATA in ISummary fields for Podcast and Channel. + 1.0.0 * Initial release. * Full documentation, full examples and complete code coverage. @@ -61,15 +64,18 @@ Podcasts: ht * [func (et EnclosureType) String() string](#EnclosureType.String) * [type ICategory](#ICategory) * [type IImage](#IImage) +* [type ISummary](#ISummary) * [type Image](#Image) * [type Item](#Item) * [func (i \*Item) AddEnclosure(url string, enclosureType EnclosureType, lengthInSeconds int64)](#Item.AddEnclosure) + * [func (i \*Item) AddSummary(summary string)](#Item.AddSummary) * [type Podcast](#Podcast) * [func New(title, link, description string, pubDate, lastBuildDate \*time.Time) Podcast](#New) * [func (p \*Podcast) AddAuthor(name, email string)](#Podcast.AddAuthor) * [func (p \*Podcast) AddCategory(category string, subCategories []string)](#Podcast.AddCategory) * [func (p \*Podcast) AddImage(url string)](#Podcast.AddImage) * [func (p \*Podcast) AddItem(i Item) (int, error)](#Podcast.AddItem) + * [func (p \*Podcast) AddSummary(summary string)](#Podcast.AddSummary) * [func (p \*Podcast) Bytes() []byte](#Podcast.Bytes) * [func (p \*Podcast) Encode(w io.Writer) error](#Podcast.Encode) * [func (p \*Podcast) String() string](#Podcast.String) @@ -81,6 +87,7 @@ Podcasts: ht * [Podcast.AddCategory](#example_Podcast_AddCategory) * [Podcast.AddImage](#example_Podcast_AddImage) * [Podcast.AddItem](#example_Podcast_AddItem) +* [Podcast.AddSummary](#example_Podcast_AddSummary) * [Podcast.Bytes](#example_Podcast_Bytes) * [Package (HttpHandlers)](#example__httpHandlers) * [Package (IoWriter)](#example__ioWriter) @@ -138,7 +145,7 @@ func (et EnclosureType) String() string ``` String returns the MIME type encoding of the specified EnclosureType. -## type [ICategory](./itunes.go#L22-L26) +## type [ICategory](./itunes.go#L9-L13) ``` go type ICategory struct { XMLName xml.Name `xml:"itunes:category"` @@ -148,7 +155,7 @@ type ICategory struct { ``` ICategory is a 2-tier classification system for iTunes. -## type [IImage](./itunes.go#L16-L19) +## type [IImage](./itunes.go#L23-L26) ``` go type IImage struct { XMLName xml.Name `xml:"itunes:image"` @@ -164,6 +171,17 @@ extensions (.jpg, .png), and in the RGB colorspace. To optimize images for mobile devices, Apple recommends compressing your image files. +## type [ISummary](./itunes.go#L31-L34) +``` go +type ISummary struct { + XMLName xml.Name `xml:"itunes:summary"` + Text string `xml:",cdata"` +} +``` +ISummary is a 4000 character rich-text field for the itunes:summary tag. + +This is rendered as CDATA which allows for HTML tags such as . + ## type [Image](./image.go#L13-L21) ``` go type Image struct { @@ -185,7 +203,7 @@ extensions (.jpg, .png), and in the RGB colorspace. To optimize images for mobile devices, Apple recommends compressing your image files. -## type [Item](./item.go#L25-L50) +## type [Item](./item.go#L25-L49) ``` go type Item struct { XMLName xml.Name `xml:"item"` @@ -203,10 +221,9 @@ type Item struct { Enclosure *Enclosure // https://help.apple.com/itc/podcasts_connect/#/itcb54353390 - IAuthor string `xml:"itunes:author,omitempty"` - ISubtitle string `xml:"itunes:subtitle,omitempty"` - // TODO: CDATA - ISummary string `xml:"itunes:summary,omitempty"` + IAuthor string `xml:"itunes:author,omitempty"` + ISubtitle string `xml:"itunes:subtitle,omitempty"` + ISummary *ISummary IImage *IImage IDuration string `xml:"itunes:duration,omitempty"` IExplicit string `xml:"itunes:explicit,omitempty"` @@ -232,14 +249,25 @@ Recommendations: - Always set an Enclosure.Length, to be nice to your downloaders. - Use Enclosure.Type instead of setting TypeFormatted for valid extensions. -### func (\*Item) [AddEnclosure](./item.go#L53-L54) +### func (\*Item) [AddEnclosure](./item.go#L52-L53) ``` go func (i *Item) AddEnclosure( url string, enclosureType EnclosureType, lengthInSeconds int64) ``` AddEnclosure adds the downloadable asset to the podcast Item. -## type [Podcast](./podcast.go#L19-L58) +### func (\*Item) [AddSummary](./item.go#L67) +``` go +func (i *Item) AddSummary(summary string) +``` +AddSummary adds the iTunes summary. + +Limit: 4000 characters + +Note that this field is a CDATA encoded field which allows for rich text +such as html links: http://www.apple.com">Apple. + +## type [Podcast](./podcast.go#L19-L57) ``` go type Podcast struct { XMLName xml.Name `xml:"channel"` @@ -264,10 +292,9 @@ type Podcast struct { TextInput *TextInput // https://help.apple.com/itc/podcasts_connect/#/itcb54353390 - IAuthor string `xml:"itunes:author,omitempty"` - ISubtitle string `xml:"itunes:subtitle,omitempty"` - // TODO: CDATA - ISummary string `xml:"itunes:summary,omitempty"` + IAuthor string `xml:"itunes:author,omitempty"` + ISubtitle string `xml:"itunes:subtitle,omitempty"` + ISummary *ISummary IBlock string `xml:"itunes:block,omitempty"` IImage *IImage IDuration string `xml:"itunes:duration,omitempty"` @@ -283,7 +310,7 @@ type Podcast struct { ``` Podcast represents a podcast. -### func [New](./podcast.go#L64-L65) +### func [New](./podcast.go#L63-L64) ``` go func New(title, link, description string, pubDate, lastBuildDate *time.Time) Podcast @@ -293,13 +320,13 @@ New instantiates a Podcast with required parameters. Nil-able fields are optional but recommended as they are formatted to the expected proper formats. -### func (\*Podcast) [AddAuthor](./podcast.go#L89) +### func (\*Podcast) [AddAuthor](./podcast.go#L80) ``` go func (p *Podcast) AddAuthor(name, email string) ``` AddAuthor adds the specified Author to the podcast. -### func (\*Podcast) [AddCategory](./podcast.go#L100) +### func (\*Podcast) [AddCategory](./podcast.go#L91) ``` go func (p *Podcast) AddCategory(category string, subCategories []string) ``` @@ -307,7 +334,7 @@ AddCategory adds the categories to the Podcast in comma delimited format. subCategories are optional. -### func (\*Podcast) [AddImage](./podcast.go#L128) +### func (\*Podcast) [AddImage](./podcast.go#L119) ``` go func (p *Podcast) AddImage(url string) ``` @@ -320,7 +347,7 @@ extensions (.jpg, .png), and in the RGB colorspace. To optimize images for mobile devices, Apple recommends compressing your image files. -### func (\*Podcast) [AddItem](./podcast.go#L176) +### func (\*Podcast) [AddItem](./podcast.go#L167) ``` go func (p *Podcast) AddItem(i Item) (int, error) ``` @@ -368,19 +395,30 @@ Recommendations: https://help.apple.com/itc/podcasts_connect/#/itcb54353390 -### func (\*Podcast) [Bytes](./podcast.go#L244) +### func (\*Podcast) [AddSummary](./podcast.go#L240) +``` go +func (p *Podcast) AddSummary(summary string) +``` +AddSummary adds the iTunes summary. + +Limit: 4000 characters + +Note that this field is a CDATA encoded field which allows for rich text +such as html links: http://www.apple.com">Apple. + +### func (\*Podcast) [Bytes](./podcast.go#L251) ``` go func (p *Podcast) Bytes() []byte ``` Bytes returns an encoded []byte slice. -### func (\*Podcast) [Encode](./podcast.go#L249) +### func (\*Podcast) [Encode](./podcast.go#L256) ``` go func (p *Podcast) Encode(w io.Writer) error ``` Encode writes the bytes to the io.Writer stream in RSS 2.0 specification. -### func (\*Podcast) [String](./podcast.go#L260) +### func (\*Podcast) [String](./podcast.go#L267) ``` go func (p *Podcast) String() string ``` diff --git a/doc.go b/doc.go index eedf08b..cefd102 100644 --- a/doc.go +++ b/doc.go @@ -37,6 +37,9 @@ // // Release Notes // +// 1.1.0 +// * Enabling CDATA in ISummary fields for Podcast and Channel. +// // 1.0.0 // * Initial release. // * Full documentation, full examples and complete code coverage.