sphinxcontrib-newsfeed -- News Feed extension for Sphinx
sphinxcontrib-newsfeed is a extension for adding a simple Blog, News or Announcements section to a Sphinx website.
- Makes feed entries from Sphinx documents.
- Generates a list of entries with teasers.
- Saves the feed to a file in RSS format.
- Supports comments via Disqus.
You can see this extension in action at http://htsql.org/blog/. For more examples, see demo directory in the source distribution.
This software is written by Kirill Simonov (Prometheus Research, LLC) and released under BSD license.
To enable this extension, add the following line to conf.py:
To add a comment form to news entries, you also need to specify the Disqus website identifier:
disqus_shortname = '...'
Now you can convert any Sphinx document to a news entry by using directive feed-entry. For example:
Welcome!!! ========== .. feed-entry:: :date: 2012-01-01 Welcome to the news feed of **Elvensense**. Here we will post release announcements and other project news.
Use cut directive to separate the entry teaser from the content:
Elvensense 96 is released ========================= .. feed-entry:: :date: 2012-12-31 We are proud to announce a new release of **Elvensense**. .. cut:: Specific changes since the last release: * An exciting feature was added. * An annoying bug was fixed.
To make a list of news entries and generate an RSS file, use feed directive:
.. feed:: :rss: index.rss :title: Elvensense News release welcome
The body of feed directive must list documents containing news entries (similar to toctree). The options of feed directive define the name of the RSS file and describe the feed metadata.
You need to manually update your HTML templates to add a link to the RSS feed:
<link rel="alternate" type="application/rss+xml" title="Elvensense News" href="/index.rss" />
Specifies an entry metadata.
This directive has no body.
- The author of the post (optional).
- The date of the post in YYYY-MM-DD format.
Inserts a list of entries with teasers at the current location.
This directive should contain a list of document names (similar to toctree). This directive adds the documents to the hierarchy, so that you don't need to add the to toctree.
- Where to write the RSS feed (optional).
- The name of the RSS channel.
- Description of the RSS channel.
- The website URL.
Separates the entry teaser from the rest of the text.
This directive has no options and no body.
Inserts a Disqus comment widget.
Normally you don't need to use this directive for news entries since, if disqus_shortname parameter is set, Disqus comment form is encluded automatically with every feed entry. This directive allows you to use Disqus with regular Sphinx documents.
- The website identifier. Use to override disqus_shortname configuration parameter.
- The page identifier. If not set, use the document name.
- The title of the page. If not set, use the document title.
- Sets the unique identifier for a Disqus website. To acquire one, you need to register the website on http://disqus.com/.
- Sets the developer mode (False or True).
- Wraps for the post metadata block.
- Wraps the author name.
- Wraps the post date.
- Wraps the Disqus comment widget.
- Wraps the post title in the list of posts.
- Wraps the Read more... link.