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

we need a way to ":include" a remote markdown file, and all the relative URLs should be relative to that. #1977

Open
trusktr opened this issue Jan 26, 2023 · 0 comments

Comments

@trusktr
Copy link
Member

trusktr commented Jan 26, 2023

Feature request

What problem does this feature solve?

Currently, if you make an include with [include](//foo.com/foo.md ":include"), if the include has relative paths, they have a high chance of being wrong because Docsify treats them relative to the current site, not the site when the content came from.

I would consider Docsify's behavior incorrect, but it seems like a big enough breaking change to actually change the default behavior for v4.

Of course, we can always start releasing breaking changes, along with a really good migration guide, and start incrementing the major number. I'm all for that.

What does the proposed API look like?

maybe a new option linksRelativeToIncludeSource would make the new behavior when set to true. Name ideas?

How should this be implemented in your opinion?

Just track the URL of the included content, then any ./relative paths need to be resolved relative to the included location.

Are you willing to work on this yourself?

Yeah, time willing

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

No branches or pull requests

1 participant