-
-
Notifications
You must be signed in to change notification settings - Fork 46.6k
Update DIRECTORY #1161
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
Update DIRECTORY #1161
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please run the script in the scripts directory instead of doing this by hand.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The backslashes worry me... do the URLs work? master/\digital_image_processing
The URLs do not seem to work.
Just saw the URL problem, will fix it |
@@ -36,7 +36,7 @@ def print_directory_md(top_dir: str = ".") -> None: | |||
if filepath != old_path: | |||
old_path = print_path(old_path, filepath) | |||
indent = (filepath.count(os.sep) + 1) if filepath else 0 | |||
url = "/".join((URL_BASE, filepath, filename)).replace(" ", "%20") | |||
url = "/".join((URL_BASE, filepath.split(os.sep)[1], filename)).replace(" ", "%20") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are URLs which always use slashes. os.sep on Windows is a backslash which is not a good idea in a URL.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used os.sep to remove the back slashes in filepath
Before that filepath were something like "\\folder" and that's why bad URLs were generated.
Revert #1161 because it broke our output: https://travis-ci.org/TheAlgorithms/Python/builds/592863893#L805
* Update DIRECTORY * Updated DIRECTORY * Fixed bug in directory build and re-build the directory.md * fixed url issue * fixed indentation in Directory.md
Index more problems from sections like