Skip to content

Fix SyntaxWarning: invalid escape sequence '\.' #7

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
6 changes: 3 additions & 3 deletions mkdocs_include_dir_to_nav/include_dir_to_nav.py
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ class IncludeDirToNav(BasePlugin):

config_scheme = (
("flat", config_options.Type(bool, default=False)),
("file_pattern", config_options.Type(str, default='.*\.md$')),
("file_pattern", config_options.Type(str, default=r'.*\.md$')),
("file_name_as_title", config_options.Type(bool, default=True)),
("recurse", config_options.Type(bool, default=True)),
("sort_file", config_options.Type(bool, default=True)),
@@ -48,7 +48,7 @@ def on_files(self, files, config):
#### If Yes, get direct files and direct directory, and insert it to nav
#### If direct directory was finding, recall parse with current index, in order to subCheck needsted folder
#### Take care of direct notation ( - myFolder ) and page title notation ( - my folder : myFolder)
def parse(ori_nav,config, pattern: str = '.*\.md$', flat: bool = False, previous=None, file_name_as_title: bool=False, recurse: bool=True, reverse_sort_file: bool=False, reverse_sort_directory: bool=False, sort_file: bool=True, sort_directory: bool=True, include_empty_dir: bool=False):
def parse(ori_nav,config, pattern: str = r'.*\.md$', flat: bool = False, previous=None, file_name_as_title: bool=False, recurse: bool=True, reverse_sort_file: bool=False, reverse_sort_directory: bool=False, sort_file: bool=True, sort_directory: bool=True, include_empty_dir: bool=False):
log.debug("IncludeDirToNav : ##START Parse state###")
log.debug(f"IncludeDirToNav : ori_nav = {ori_nav} | previous = {previous} | type of ori_nav {type(ori_nav)}")

@@ -176,4 +176,4 @@ def _check_subitem(item_to_check: str, pattern: str):
log.debug(f"IncludeDirToNav_generate_nav : Dir have concerned subfile ({item_to_check})")
return True
log.debug(f"IncludeDirToNav_generate_nav : Dir not have subfile, do not add it ({item_to_check})")
return False
return False