Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor fixes and config updates #1

Merged
merged 7 commits into from
Jul 18, 2024
Merged

Minor fixes and config updates #1

merged 7 commits into from
Jul 18, 2024

Conversation

JWCook
Copy link

@JWCook JWCook commented Jul 17, 2024

This fixes the following minor issues I found while testing this out:

  • When specifying author in the fields list (rst) or frontmatter (markdown), it gets passed to feedgen as a string instead of as a dict:
    Traceback (most recent call last):
    File "sphinx/events.py", line 97, in emit
    results.append(listener.handler(self.app, *args))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "sphinxfeed.py", line 102, in create_feed_item
    item.author(author)
    File "feedgen/entry.py", line 363, in author
    self.__atom_author += ensure_format(author,
                          ^^^^^^^^^^^^^^^^^^^^^
    File "feedgen/util.py", line 61, in ensure_format
    raise ValueError('Invalid data (value is no dictionary)')
  • When using the sphinx-tags extension, its tags directive gets picked up as page metadata, as a list instead of a string:
    Traceback (most recent call last):
      File "sphinx/events.py", line 97, in emit
        results.append(listener.handler(self.app, *args))
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "sphinxfeed.py", line 107, in create_feed_item
        tags = tags.split()
               ^^^^^^^^^^
    AttributeError: 'list' object has no attribute 'split'

As well as a few other small changes I needed:

  • Use a sphinx config option feed_use_atom to generate an Atom feed instead of RSS
  • Use Sphinx config instead of rstgen (to avoid adding as a dependency) to get use_dirhtml config value
  • Log when a page is skipped due to a date in the future (using sphinx.util.logging like you suggested)
  • Updated the test output for Sphinx 7.4 and docutils 0.21

I did notice that in the HTML output, I no longer see the "generator" meta tag that docutils usually adds, but that isn't related to the RSS feed.

@lsaffre lsaffre merged commit 0f9f9f2 into lsaffre:master Jul 18, 2024
@JWCook JWCook deleted the dev branch July 18, 2024 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants