module sphinxext.build_rss

Short summary

module pyquickhelper.sphinxext.build_rss

Buid the RSS stream.

source on GitHub

Functions

function

truncated documentation

build_rss

Build a RSS file, the function keeps the blog post (HTML format) from the last month. The summary will only contains …

Documentation

Buid the RSS stream.

source on GitHub

pyquickhelper.sphinxext.build_rss.build_rss(posts, blog_title='__BLOG_TITLE__', blog_root='__BLOG_ROOT__', blog_description='__BLOG_DESCRIPTION__', now=datetime.datetime(2023, 6, 3, 2, 37, 3, 430005), model_feed='<rss version="2.0">\n<channel>\n    <title>{0.blogtitle}</title>\n    <link>{0.root}/blog/main_0000.html</link>\n    <description>{0.description}</description>\n    ', model_row='<item>\n            <title>{0.title}</title>\n            <link>{0.root}/blog/{0.year}/{0.name}.html</link>\n            <guid isPermaLink="true">{0.root}/blog/{0.year}/{0.name}.html</guid>\n            <description>{0.decription}</description>\n            <pubDate>{0.date}</pubDate>\n        </item>', model_channel='\n</channel>\n</rss>\n')[source]

Build a RSS file, the function keeps the blog post (HTML format) from the last month. The summary will only contains the part included in those two comments.

Parameters:
  • posts – list of posts to include

  • blog_title – title of the blog

  • blog_description – description of the blog

  • blog_root – url root

  • now – date to use as a final date, only blog post between one month now and now will be kept

  • model_feed – see model_channel

  • model_row – see model_row

  • model_channel – the part related to a post in the rss stream is composed by the concatenation of the three stream: model_feed, model_row, model_channel. You should see the default value to see how you can replace them.

Returns:

2-uple: content of the file

source on GitHub