Skip to content

Commit

Permalink
Fix further documentation issues from the stuttering PR
Browse files Browse the repository at this point in the history
  • Loading branch information
mmcdole committed Apr 11, 2016
1 parent d4319ea commit 2b6fabf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ When using the `gofeed` library as a [universal feed parser](#universal-feed-par

![Diagram](https://raw.githubusercontent.com/mmcdole/gofeed/master/docs/sequence.png)

Default translators (`DefaultRSSTranslator` and `DefaultAtomTranslator`) have been provided for you and are used transparently behind the scenes when you use `gofeed.FeedParser` with its default settings. You can see how they translate fields from ```atom.Feed``` or ```rss.Feed``` to the universal ```gofeed.Feed``` struct in the [Default Mappings](#default-mappings) section. However, should you disagree with the way certain fields are translated you can easily supply your own `Translator` and override this behavior. See the [Advanced Usage](#advanced-usage) section for an example how to do this.
Default translators (`DefaultRSSTranslator` and `DefaultAtomTranslator`) have been provided for you and are used transparently behind the scenes when you use `gofeed.Parser` with its default settings. You can see how they translate fields from ```atom.Feed``` or ```rss.Feed``` to the universal ```gofeed.Feed``` struct in the [Default Mappings](#default-mappings) section. However, should you disagree with the way certain fields are translated you can easily supply your own `Translator` and override this behavior. See the [Advanced Usage](#advanced-usage) section for an example how to do this.

## Basic Usage

#### Universal Feed Parser

The most common usage scenario will be to use ```gofeed.FeedParser``` to parse an arbitrary RSS or Atom feed into the hybrid ```gofeed.Feed```. This is useful for when you don't know what feed type your feeds will be ahead of time. This hybrid struct has a lot of the common properties between the two formats (but does not have all the properties). See the [default mappings](#default-mappings) section for more details.
The most common usage scenario will be to use ```gofeed.Parser``` to parse an arbitrary RSS or Atom feed into the hybrid ```gofeed.Feed```. This is useful for when you don't know what feed type your feeds will be ahead of time. This hybrid struct has a lot of the common properties between the two formats (but does not have all the properties). See the [default mappings](#default-mappings) section for more details.

##### Parse a feed from an URL:

Expand Down Expand Up @@ -107,7 +107,7 @@ fmt.Println(atomFeed.Subtitle)

##### Parse a feed while using a custom translator

The mappings and precedence order that are outlined in the [Default Mappings](#default-mappings) section are provided by the following two structs: `DefaultRSSTranslator` and `DefaultAtomTranslator`. If you have fields that you think should have a different precedence, or if you want to make a translator that is aware of an unsupported extension you can do this by specifying your own RSS or Atom translator when using the `gofeed.FeedParser`.
The mappings and precedence order that are outlined in the [Default Mappings](#default-mappings) section are provided by the following two structs: `DefaultRSSTranslator` and `DefaultAtomTranslator`. If you have fields that you think should have a different precedence, or if you want to make a translator that is aware of an unsupported extension you can do this by specifying your own RSS or Atom translator when using the `gofeed.Parser`.

Here is a simple example of creating a custom `Translator` that makes the `/rss/channel/itunes:author` extension field have a higher precedence than the `/rss/channel/managingEditor` field in RSS feeds. We will wrap the existing `DefaultRSSTranslator` since we only want to change the behavior for a single field.

Expand Down

0 comments on commit 2b6fabf

Please sign in to comment.