Skip to content
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

relative path in docs incorrect on when build on windows #1708

Closed
mikaelkaron opened this issue Jul 3, 2019 · 4 comments
Closed

relative path in docs incorrect on when build on windows #1708

mikaelkaron opened this issue Jul 3, 2019 · 4 comments
Labels

Comments

@mikaelkaron
Copy link

Stencil version:

I'm submitting a:

[x] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://stencil-worldwide.herokuapp.com/ or https://forum.ionicframework.com/

Current behavior:

Links to other components use system path separator instead of URL path separator.

Take this readme as an example. Because it was built on windows it uses \ as a path separator instead of the correct /.

I'm making an assumption here that the separator is reversed because I use a windows machine. I have not looked at the code or verified with other generated readme.md files from a linux system.

In some way I guess it's my own fault for using windows as a dev system (it's not the first time I report path related bugs in a project) but I'm sure I'm not the only one.

Expected behavior:

Paths in .md files can safely be assumed to be intended to be consumed on the internet, so the path separator should always be /.

Steps to reproduce:

Build a multi-component stencil project on a windows system and check the generated readme.md files.

Related code:

// insert any relevant code here

Other information:

@ionitron-bot ionitron-bot bot added the triage label Jul 3, 2019
@mikaelkaron
Copy link
Author

After changing my setup to run the build inside a Docker container during development I can confirm that the separator is correct when built on a Linux system. This points to earlier assumption that this is an OS related problem.

Funnily enough the problem is usually reversed (as in generated paths are not using path.sep and that screws things up) but in this case we always want the separator to be /.

¯\_(ツ)_/¯

@dutscher
Copy link

dutscher commented Jul 11, 2019

i had the problem aswell, my collegues are on mac and linux. iam the dude with windows.
now i got all components readme's as changed and only the pathes are with backslash instead of slash.

i found the code:
https://github.com/ionic-team/stencil/blob/master/src/compiler/docs/readme/markdown-dependencies.ts getCmpLink -> cmpRelPath should get a simple .replace(/\\/g,"\/") and then its fine!

cheers

@mikaelkaron
Copy link
Author

i found the code:
https://github.com/ionic-team/stencil/blob/master/src/compiler/docs/readme/markdown-dependencies.ts getCmpLink -> cmpRelPath should get a simple .replace(/\/g,"/") and then its fine!

PR!

rtpHarry added a commit to rtpHarry/stencil that referenced this issue Aug 24, 2019
fixes stenciljs#1708 

I was just trying to make some Ionic docs changes and ended up down a rabbit hole. I'm submitting this one line fix in case that's all that needs to be done, but I have only tested it on my own Windows 10 computer and it resolved the issue.
@mikaelkaron
Copy link
Author

Think this can be closed by 22d9c93

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants