Skip to content

Commit ee10205

Browse files
committed
OPML import/export user guide, screenshots, and changelog. #165
1 parent d46aae0 commit ee10205

7 files changed

Lines changed: 68 additions & 27 deletions

File tree

CHANGES.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ Version 3.23
1111

1212
Unreleased
1313

14-
* Add basic support for OPML subscription list import/export:
15-
:mod:`reader.opml`.
16-
(:issue:`165`)
14+
* Add support for :ref:`opml`. (:issue:`165`)
15+
16+
* Add support for import / export in the web app; :ref:`screenshots <screenshots-import>`.
17+
1718

1819
* Deprecate the :func:`~reader.utils.archive_entries` ``feed_user_title`` argument.
1920

docs/app.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,18 @@ Screenshots
6262

6363
article view (light mode)
6464

65+
.. _screenshots-import:
66+
67+
.. figure:: screenshots/import-select.png
68+
:width: 240px
69+
70+
import feeds (select)
71+
72+
.. figure:: screenshots/import-result.png
73+
:width: 240px
74+
75+
import feeds (result)
76+
6577

6678

6779
Serving the web app

docs/dev.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ in my spare time,
3232
but I will prioritize supporting :doc:`contributors <contributing>`
3333
(discussions, reviews and so on).
3434

35-
* OPML support, :issue:`165`
3635
* :ref:`deleting entries <deleting entries>`
3736

3837
* archiving important entries of deleted feeds, :issue:`290`

docs/guide.rst

Lines changed: 52 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -705,35 +705,32 @@ you can delete entries using the low-level
705705

706706

707707

708-
.. _pagination:
708+
.. _opml:
709709

710-
Pagination
711-
----------
710+
OPML import / export
711+
--------------------
712712

713-
:meth:`~Reader.get_feeds`, :meth:`~Reader.get_entries`,
714-
and :meth:`~Reader.search_entries`
715-
can be used in a paginated fashion.
713+
You can import and export feeds from and to an `OPML subscription list`_
714+
by using the :meth:`~Reader.import_feeds`
715+
and :meth:`~Reader.export_feeds` methods::
716716

717-
The ``limit`` argument allows limiting the number of results returned;
718-
the ``starting_after`` argument allows skipping results until after
719-
a specific one.
720-
721-
To get the first page, use only ``limit``::
722-
723-
>>> for entry in reader.get_entries(limit=2):
724-
... print(entry.title)
717+
>>> export = reader.export_feeds()
718+
>>> export.filename
719+
'reader-feeds-2026-04-24-10-00-00.opml'
720+
>>> with open(export.filename, 'wb') as f:
721+
... f.write(export.content)
725722
...
726-
H.I. #136: Dog Bingo
727-
H.I. #135: Place Your Bets
723+
>>> # with another reader instance
724+
>>> reader = make_reader(':memory:')
725+
>>> with open(export.filename, 'rb') as f:
726+
... reader.import_feeds(f)
728727

729-
To get the next page, use the last result from a call as
730-
``starting_after`` in the next call::
728+
For more detailed control over which feeds are imported,
729+
see :meth:`~Reader.import_feeds_iter` and the :mod:`reader.opml` module.
731730

732-
>>> for entry in reader.get_entries(limit=2, starting_after=entry):
733-
... print(entry.title)
734-
...
735-
# H.I. 134: Boxing Day
736-
Star Wars: The Rise of Skywalker, Hello Internet Christmas Special
731+
.. _OPML subscription list: https://opml.org/spec2.opml#subscriptionLists
732+
733+
.. versionadded:: 3.23
737734

738735

739736

@@ -831,6 +828,38 @@ Some examples of how this is useful:
831828

832829

833830

831+
.. _pagination:
832+
833+
Pagination
834+
----------
835+
836+
:meth:`~Reader.get_feeds`, :meth:`~Reader.get_entries`,
837+
and :meth:`~Reader.search_entries`
838+
can be used in a paginated fashion.
839+
840+
The ``limit`` argument allows limiting the number of results returned;
841+
the ``starting_after`` argument allows skipping results until after
842+
a specific one.
843+
844+
To get the first page, use only ``limit``::
845+
846+
>>> for entry in reader.get_entries(limit=2):
847+
... print(entry.title)
848+
...
849+
H.I. #136: Dog Bingo
850+
H.I. #135: Place Your Bets
851+
852+
To get the next page, use the last result from a call as
853+
``starting_after`` in the next call::
854+
855+
>>> for entry in reader.get_entries(limit=2, starting_after=entry):
856+
... print(entry.title)
857+
...
858+
# H.I. 134: Boxing Day
859+
Star Wars: The Rise of Skywalker, Hello Internet Christmas Special
860+
861+
862+
834863
.. _reserved names:
835864

836865
Reserved names

docs/screenshots/feeds.png

-74.3 KB
Loading

docs/screenshots/import-result.png

20.6 KB
Loading

docs/screenshots/import-select.png

19.8 KB
Loading

0 commit comments

Comments
 (0)