diff options
| author | John Conway <john.a.conway@gmail.com> | 2019-05-08 13:00:00 +0100 |
|---|---|---|
| committer | John Conway <john.a.conway@gmail.com> | 2019-05-08 13:00:00 +0100 |
| commit | 8c93fede95712e1b8af9c351f3c5184c8ce3f92f (patch) | |
| tree | d0d88a3b908f5811c7d310c9ab515d951392f288 /src | |
| parent | 02d25f9e12bd92b6aab53180f73e6c226a86f63c (diff) | |
| download | feed-nim-8c93fede95712e1b8af9c351f3c5184c8ce3f92f.tar.gz feed-nim-8c93fede95712e1b8af9c351f3c5184c8ce3f92f.zip | |
Category->categories for consistant pluralisation
Diffstat (limited to 'src')
| -rw-r--r-- | src/feednim/atom.nim | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/feednim/atom.nim b/src/feednim/atom.nim index 133e887..92e1060 100644 --- a/src/feednim/atom.nim +++ b/src/feednim/atom.nim @@ -18,7 +18,7 @@ type title*: string # Required Atom field updated*: string # Required Atom field authors*: seq[AtomAuthor] # Pleuralised because the Atom spec allows more than one - category*: seq[string] + categories*: seq[string] contributors*: seq[AtomAuthor] generator*: string icon*: string @@ -47,7 +47,7 @@ type updated*: string # Required Atom field author: AtomAuthor # Sugar, not in Atom spec. Returns the first author. authors*: seq[AtomAuthor] # Pleuralised because the Atom spec allows more than one - category*: seq[string] + categories*: seq[string] content*: string contentSrc*: string contentType*: string @@ -61,7 +61,7 @@ type AtomSource* = object author: AtomAuthor # Sugar, not in Atom spec. Returns the first author. authors: seq[AtomAuthor] - category*: seq[string] + categories*: seq[string] contributors*: seq[AtomAuthor] generator*: string icon*: string @@ -109,7 +109,7 @@ proc parseEntry( node: XmlNode) : AtomEntry = entry.authors = node.parseAuthors() if node.child("category") != nil: - entry.category = map(node.findAll("category"), (x: XmlNode) -> string => x.innerText) + entry.categories = map(node.findAll("category"), (x: XmlNode) -> string => x.innerText) if node.child("content") != nil: entry.content = node.child("content").innerText @@ -129,7 +129,7 @@ proc parseEntry( node: XmlNode) : AtomEntry = if node.child("source") != nil: let source = node.child("source") if node.child("author") != nil: entry.source.authors = source.parseAuthors() - if node.child("category") != nil: entry.source.category = map(source.findAll("category"), (x: XmlNode) -> string => x.innerText) + if node.child("category") != nil: entry.source.categories = map(source.findAll("category"), (x: XmlNode) -> string => x.innerText) if node.child("contributor") != nil: entry.source.contributors = source.parseAuthors(mode="contributor") if source.child("generator") != nil: entry.source.generator = source.child("generator").innerText if source.child("icon") != nil: entry.source.generator = source.child("icon").innerText @@ -169,7 +169,7 @@ proc parseAtom*(data: string): Atom = if node.child("author") != nil: atom.authors = node.parseAuthors() if node.child("category") != nil: - atom.category = map(node.findAll("category"), (x: XmlNode) -> string => x.innerText) + atom.categories = map(node.findAll("category"), (x: XmlNode) -> string => x.innerText) if node.child("contributor") != nil: atom.contributors = node.parseAuthors(mode="contributor") |
