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

Doc extensions: use StringList instead of ViewList #2141

Merged
merged 4 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/ext/operations_user_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from docutils import nodes
from docutils.nodes import Node
from docutils.statemachine import ViewList
from docutils.statemachine import StringList
from docutils.parsers.rst import Directive
from sphinx.util.nodes import nested_parse_with_titles
"""Custom extension to add nicely formatted documentation for the operations.
Expand Down Expand Up @@ -81,7 +81,7 @@ def run(self) -> list[Node]:
rst_lines.append(f":class:`{op.filter_name} API docs<mantidimaging.core.operations.{op.__module__}>`")
rst_lines.append("")

rst = ViewList()
rst = StringList()
for n, rst_line in enumerate(rst_lines):
rst.append(rst_line, "generated.rst", n)

Expand Down
6 changes: 3 additions & 3 deletions docs/ext/release_notes.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from typing import Iterable

from docutils import nodes
from docutils.statemachine import ViewList
from docutils.statemachine import StringList
from docutils.parsers.rst import Directive
from sphinx.errors import SphinxError
from sphinx.util.nodes import nested_parse_with_titles
Expand All @@ -24,10 +24,10 @@ class ReleaseNotes(Directive):
has_content = True

@classmethod
def make_rst(cls, note_type: str) -> ViewList:
def make_rst(cls, note_type: str) -> StringList:
note_paths: Iterable[Path] = (Path() / 'docs' / 'release_notes' / 'next').glob(note_type + '*')

rst = ViewList()
rst = StringList()
try:
note_paths = sorted(note_paths, key=lambda p: int(p.name.split('-')[1]))
except ValueError as exc:
Expand Down
3 changes: 3 additions & 0 deletions docs/release_notes/2.7.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Mantid Imaging 2.7
==================

New Features
------------
- #1912 : Support sub-directories in Live viewer
Expand Down
1 change: 1 addition & 0 deletions docs/release_notes/next/dev-2139-use-stringlist
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#2139 : Doc extensions: use StringList instead of ViewList
16 changes: 0 additions & 16 deletions docs/release_notes/next/next.rst

This file was deleted.

2 changes: 1 addition & 1 deletion environment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dependencies:
- mypy==1.8
- types-requests
- types-PyYAML
- types-docutils==0.20.0.20240311 # https://github.com/mantidproject/mantidimaging/issues/2139
- types-docutils
- pytest==7.4.*
- pytest-cov==4.1.*
- pytest-randomly==3.15.*
Expand Down
Loading