Skip to content

Commit 3c56f0e

Browse files
v1.1.3 (#75)
1 parent b3f0228 commit 3c56f0e

File tree

6 files changed

+25
-6
lines changed

6 files changed

+25
-6
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.1.3] 2025-07-30
9+
10+
- Improve `read_from_source()` to support an optional CWD parameter used to
11+
look for the OpenAPI spec. The OpenAPI plugin should supply that CWD relative
12+
to the current markdown file being processed. Markdown customarily uses
13+
paths relative to the document itself. Existing relative paths will not break,
14+
since this will attempt paths relative to both working directories, by
15+
@joewlambeth.
16+
817
## [1.1.2] 2025-04-22
918

1019
- Correct the contribs plugin to use the `--follow` option when obtaining

neoteroi/mkdocs/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.1.2"
1+
__version__ = "1.1.3"

neoteroi/mkdocs/oad/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
neoteroi.mkdocs.oad
1010
"""
1111

12-
from pathlib import Path
1312
import re
13+
from pathlib import Path
1414

1515
from mkdocs.config.config_options import Type
1616
from mkdocs.plugins import BasePlugin

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ keywords = [
3232
"documentation",
3333
]
3434
dependencies = [
35-
"essentials-openapi",
35+
"essentials-openapi>=1.2.1",
3636
"mkdocs",
3737
"httpx",
3838
"click",

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
pytest
22
pytest-cov
3-
essentials-openapi[full]>=1.0.2
3+
essentials-openapi[full]>=1.2.1
44
mkdocs
55
flake8
66
black

tests/test_mkdocsoad.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import textwrap
2+
from unittest.mock import Mock
23

34
import pytest
45

@@ -7,6 +8,15 @@
78
from . import get_resource_file_path
89

910

11+
def make_mock_page(src_dir="docs", src_path="index.md"):
12+
mock_file = Mock()
13+
mock_file.src_dir = src_dir
14+
mock_file.src_path = src_path
15+
mock_page = Mock()
16+
mock_page.file = mock_file
17+
return mock_page
18+
19+
1020
def test_markdown_without_oad():
1121
handler = MkDocsOpenAPIDocumentationPlugin()
1222

@@ -20,7 +30,7 @@ def test_markdown_without_oad():
2030
)
2131
)
2232

23-
result = handler.on_page_markdown(example)
33+
result = handler.on_page_markdown(example, make_mock_page())
2434
assert result == example
2535

2636

@@ -39,7 +49,7 @@ def test_markdown_with_oad(file_name):
3949
)
4050
)
4151

42-
result = handler.on_page_markdown(example)
52+
result = handler.on_page_markdown(example, make_mock_page())
4353

4454
# Note: not testing the full output since this responsibility belongs to the
4555
# essentials-openapi package

0 commit comments

Comments
 (0)