Skip to content

make update_docu_links independet on the location it is called from#5583

Open
5ila5 wants to merge 1 commit into
mampfes:masterfrom
5ila5:update_docu_links_location_independent
Open

make update_docu_links independet on the location it is called from#5583
5ila5 wants to merge 1 commit into
mampfes:masterfrom
5ila5:update_docu_links_location_independent

Conversation

@5ila5

@5ila5 5ila5 commented Mar 6, 2026

Copy link
Copy Markdown
Collaborator

This can wait until #5577 is through

@bbr111

bbr111 commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Thanks for making the script independent of the current working directory. The general approach of resolving paths relative to file looks good.

There is one cross-platform regression compared with the previous implementation:

@Property
def relative_file_path_name(self):
return "/" + str(self._file.relative_to(PROJECT_ROOT))

The previous implementation constructed documentation links explicitly with /, for example:

filename = f"/doc/source/{file}.md"

With the new implementation, str(Path(...)) uses the platform-specific path separator. On Windows this can generate links such as:

/doc\source\example.md

Since this value is used for Markdown links and GitHub documentation URLs, it should always use POSIX separators:

@Property
def relative_file_path_name(self) -> str:
return "/" + self._file.relative_to(PROJECT_ROOT).as_posix()

Apart from this cross-platform issue, the path refactoring looks good.

@bbr111

bbr111 commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

but maybe we should wait until the BaseSource PR is merged.

@markvp markvp added this to the 3.1.0 milestone Jul 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tooling Build tools, scripts, CI/CD

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants