Skip to content

Commit

Permalink
Only exclude mkdocs config YAML files. (#117)
Browse files Browse the repository at this point in the history
* Only exclude mkdocs config YAML files.

There was a blanket exclusion of all YAML files introduced to fix
issue #9. There are certain use-cases where non-mkdocs YAML files
should be included in the documentation - e.g. OpenAPI spec files.

This change only excludes YAML files that are marked as mkdocs
config file for the repo being imported.

This passes the existing test "Make sure imported repo's mkdocs.yml
isn't in build output".

Fix for issue #107

* Dummy commit to force PR check re-runs

* Revert dummy commit

* Update version and changelog

---------

Co-authored-by: Joseph Doiron <[email protected]>
  • Loading branch information
garthompson and jdoiro3 authored Sep 7, 2023
1 parent f5a6114 commit edb63a3
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 0.6.3

### Prs in Release

- [Only exclude mkdocs config YAML files.](https://github.com/jdoiro3/mkdocs-multirepo-plugin/pull/117)

## 0.6.2

### Prs in Release
Expand Down
5 changes: 4 additions & 1 deletion mkdocs_multirepo_plugin/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,11 @@ def on_files(self, files: Files, config: Config) -> Files:
repo_files: List[File]
for repo in self.repos.values():
repo_files = get_files(config, repo)
repo_config_path = repo.config_path
for f in repo_files:
if not is_yaml_file(f):
if f.src_path == repo_config_path:
log.info(f"Multirepo plugin is not copying config file: {f.src_path}")
else:
# the file needs to know about the repo it belongs to
f.repo = repo
files.append(f)
Expand Down
4 changes: 4 additions & 0 deletions mkdocs_multirepo_plugin/structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,10 @@ def __eq__(self, other):
def name_length(self):
return len(Path(self.name).parts)

@property
def config_path(self):
return os.path.join(self.name, self.config)

def keep_docs_dir(self, global_keep_docs_dir: bool = False):
if self._keep_docs_dir is None:
return global_keep_docs_dir
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "mkdocs-multirepo-plugin"
version = "0.6.2"
version = "0.6.3"
description = "Build documentation in multiple repos into one site."
authors = ["jdoiro3 <[email protected]>"]
license = "MIT"
Expand Down

0 comments on commit edb63a3

Please sign in to comment.