File tree Expand file tree Collapse file tree 6 files changed +25
-6
lines changed
Expand file tree Collapse file tree 6 files changed +25
-6
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
55The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.0.0/ ) ,
66and 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
Original file line number Diff line number Diff line change 1- __version__ = "1.1.2 "
1+ __version__ = "1.1.3 "
Original file line number Diff line number Diff line change 99neoteroi.mkdocs.oad
1010"""
1111
12- from pathlib import Path
1312import re
13+ from pathlib import Path
1414
1515from mkdocs .config .config_options import Type
1616from mkdocs .plugins import BasePlugin
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ keywords = [
3232 " documentation" ,
3333]
3434dependencies = [
35- " essentials-openapi" ,
35+ " essentials-openapi>=1.2.1 " ,
3636 " mkdocs" ,
3737 " httpx" ,
3838 " click" ,
Original file line number Diff line number Diff line change 11pytest
22pytest-cov
3- essentials-openapi [full ]>= 1.0.2
3+ essentials-openapi [full ]>= 1.2.1
44mkdocs
55flake8
66black
Original file line number Diff line number Diff line change 11import textwrap
2+ from unittest .mock import Mock
23
34import pytest
45
78from . 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+
1020def 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
You can’t perform that action at this time.
0 commit comments