Skip to content

Commit

Permalink
Hotfix for 13 (#19)
Browse files Browse the repository at this point in the history
* Update page.file source path with original source, fixes #12

* Fix edgecase where monorepo does not copy any files to temp docs dir

* Bump version and add unit tests for git related plugins

* Fix git related unit tests

* Fix keyerrors when docs contained folders

* Fix unit test that was moved

* bump version to 0.4.7

* Python 3.5 compatibility when after using rglob
  • Loading branch information
timvink committed Jun 4, 2020
1 parent 6b53d8f commit e45a108
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# hello

sdf
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ plugins:

nav:
- Home: README.md
- Another: folder/test.md
16 changes: 9 additions & 7 deletions mkdocs_monorepo_plugin/merger.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

import logging
import os
from os import listdir
from os.path import isfile, join
from os.path import join
from pathlib import Path

from mkdocs.utils import warning_filter

Expand Down Expand Up @@ -60,11 +60,13 @@ def merge(self):

if os.path.exists(source_dir):
copy_tree(source_dir, dest_dir)
files = [f for f in listdir(source_dir) if isfile(join(source_dir, f))]
for f in files:
src = join(source_dir, f)
dest = join(dest_dir, f)
self.files_source_dir[dest] = src
for file_abs_path in Path(source_dir).rglob('*.md'):
file_abs_path = str(file_abs_path) # python 3.5 compatibility
if os.path.isfile(file_abs_path):
file_rel_path = os.path.relpath(file_abs_path, source_dir)
dest = join(dest_dir, file_rel_path)
self.files_source_dir[dest] = file_abs_path

else:
log.critical(
"[mkdocs-monorepo] The {} path is not valid. ".format(source_dir) +
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

setuptools.setup(
name='mkdocs-monorepo-plugin',
version='0.4.6',
version='0.4.7',
description='Plugin for adding monorepository support in Mkdocs.',
long_description="""
This introduces support for the !include syntax in mkdocs.yml, allowing you to import additional Mkdocs navigation.
Expand Down

0 comments on commit e45a108

Please sign in to comment.