Skip to main content

sphinxcontrib-newsfeed – News Feed extension for Sphinx

Overview

sphinxcontrib-newsfeed is a extension for adding a simple Blog, News or Announcements section to a Sphinx website.

Features:

  • 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.

Usage

To enable this extension, add the following line to conf.py:

extensions.append('sphinxcontrib.newsfeed')

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" />

Reference

Directives

feed-entry

Specifies an entry metadata.

This directive has no body.

Options:

author

The author of the post (optional).

date

The date of the post in YYYY-MM-DD format.

feed

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.

Options:

rss

Where to write the RSS feed (optional).

title

The name of the RSS channel.

description

Description of the RSS channel.

link

The website URL.

cut

Separates the entry teaser from the rest of the text.

This directive has no options and no body.

disqus

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.

Options:

shortname

The website identifier. Use to override disqus_shortname configuration parameter.

identifier

The page identifier. If not set, use the document name.

title

The title of the page. If not set, use the document title.

Configuration parameters

disqus_shortname

Sets the unique identifier for a Disqus website. To acquire one, you need to register the website on http://disqus.com/.

disqus_developer

Sets the developer mode (False or True).

CSS classes

feed-meta

Wraps for the post metadata block.

feed-author

Wraps the author name.

feed-date

Wraps the post date.

feed-disqus

Wraps the Disqus comment widget.

feed-ref

Wraps the post title in the list of posts.

feed-more

Wraps the Read more… link.

Metadata

Release files for sphinxcontrib-newsfeed 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sphinxcontrib-newsfeed 0.1.4
File Size Uploaded
sphinxcontrib-newsfeed-0.1.4.tar.gz 10.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sphinxcontrib-newsfeed 0.1.4
File Interpreter ABI Platform
sphinxcontrib_newsfeed-0.1.4-py2-none-any.whl Python 2 none any Details

Total release size: 20.8 kB

Release files / sphinxcontrib-newsfeed-0.1.4.tar.gz

Download URL sphinxcontrib-newsfeed-0.1.4.tar.gz
Size 10.9 kB
Tags Source
SHA-256 checksum
How to use checksums
f78c865b1a32d249644a9c46f395b547df0dc21ed69b70898d64235b4755efb4
BLAKE2b-256 checksum
How to use checksums
2b5e8bc839b5c4ef030bf26eede24208a49f25d00033cbd4969b3895264f14db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / sphinxcontrib_newsfeed-0.1.4-py2-none-any.whl

Download URL sphinxcontrib_newsfeed-0.1.4-py2-none-any.whl
Size 10.0 kB
Tags Python 2
SHA-256 checksum
How to use checksums
6556e6cb4b4d060c5795f30bc2630589c720ec3678861473155172901f295a9b
BLAKE2b-256 checksum
How to use checksums
2adc47314ad0fd1d0eb77f005481cffeb872eb0d13b049a6b40f1fec9da1fb33
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page