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

opening a markdown document from inside a zip archive. #159

Open
vpenades opened this issue Oct 16, 2024 · 0 comments
Open

opening a markdown document from inside a zip archive. #159

vpenades opened this issue Oct 16, 2024 · 0 comments

Comments

@vpenades
Copy link

vpenades commented Oct 16, 2024

Hi

I would like to be able to open .MD documents stored inside .ZIP archives... these .MD documents have images, also included inside the ZIP

Unfortunately AssetPathRoot only works for file system and network Urls, but not for markdown files opened as stream.

So, Is there a way to tell the library how to resolve the external references?

Ideally, I would like something like this:

markdown.AssetStreamRequest = (s,e) =>
{ 
  // this is an example code, in this case, e.MarkDownAbsoluteUri would be null because the source is a stream
  string assetPath = UserCombinePath( e.MarkDownAbsoluteUri, e.AssetRelativeUri );
  e.AssetStream = zip.GetEntry(imagePath).OpenStream();
}

Notice that this is a general solution for references stored anywhere, it could be used for file system, network, or any other location.

I am not sure if this is already possible using some other way...

@vpenades vpenades changed the title openinga markdown document from inside a zip archive. opening a markdown document from inside a zip archive. Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant