Skip to content

Add support for :glob: option to the feed directive#4

Open
bosonogi wants to merge 2 commits into
prometheusresearch:masterfrom
bosonogi:glob-support
Open

Add support for :glob: option to the feed directive#4
bosonogi wants to merge 2 commits into
prometheusresearch:masterfrom
bosonogi:glob-support

Conversation

@bosonogi

Copy link
Copy Markdown

It mimics the way :glob: works for the toctree directive.

It mimics the way `:glob:` works for the `toctree` directive.
@doismellburning

Copy link
Copy Markdown

Thank you! But I think this might have a bug around how paths are constructed.

The following in source/notebook/index.rst (adapted from a very very similar toctree directive where * just worked):

.. feed::
    :title: Notebook
    :rss: notebook.rss
    :glob:

    *

where e.g. I'm looking to include source/notebook/2025-04-28-whats-a-backlog-anyway.rst, gives me Sphinx build errors of the form:

/Users/me/git/bliki/source/notebook/index.rst:20: WARNING: feed contains a reference to nonexisting document 'notebook/notebook/2025-04-28-whats-a-backlog-anyway' [docutils]

(Note the double notebook/notebook)

I can't yet work out if you're accidentally adding something twice or not dropping something though...

If such names go through an additional `docname_join` call they might not be valid anymore.
@bosonogi

Copy link
Copy Markdown
Author

Somehow this did not affect my file layout, but I see the issue now. Documents are globed from a list of previously collected documents, and so those names should not be modified. Only the names that are not glob patterns need to be joined with env.docname.

@doismellburning

Copy link
Copy Markdown

@bosonogi That does the job nicely, thanks!

You might like to also grab doismellburning@840e981 which adds support for :reversed:!

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