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

Readme Matching #22

Closed
seanmcbreen opened this issue Nov 3, 2015 · 9 comments
Closed

Readme Matching #22

seanmcbreen opened this issue Nov 3, 2015 · 9 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug

Comments

@seanmcbreen
Copy link

This is not working as expected. The RegExp does not get the correct 2nd match:

Something more like:
github\.com\/([^]+)\/([^]+)\/([\w-_]*|$) is required

for:
https://github.com/Microsoft/vscode-spell-check.git

@seanmcbreen seanmcbreen added the bug Issue identified by VS Code Team member as probable bug label Nov 3, 2015
@seanmcbreen
Copy link
Author

Looking at this a little more. The format for the URL must be:
https://github.com/user/repository/raw/branch/filename

With that format GitHub will redirect to the tokenized CDN link. As a working example...
https://github.com/Microsoft/vscode-MDTools/raw/master/images/Commands.gif
https://github.com/Microsoft/vscode-MDTools/raw/master/LICENSE.md

We seam to use:
return "https://raw.githubusercontent.com/${ match[1] }/${ match[2] }/master"

With the updated regex that will result in and this will 404 with no token etc.
https://raw.githubusercontent.com/Microsoft/vscode-MDTools/master

When we really want is to prefix links with:
https://github.com/Microsoft/vscode-MDTools/raw/master

This should be true for all content types e.g. LICENSE as well.

@seanmcbreen
Copy link
Author

The link in the gallery for licence is however working.

@seanmcbreen
Copy link
Author

I still can't see this working - if I look in the package the MD is still the same.

I also got some additional options - if we detect relative links to files in the project then we can use a mapping format to let the gallery load them (from the extensions sub-folder). I manually hacked my VSIX as follows....

    <Asset Type="images/SpellDemo1.gif" Path="extension/images/SpellDemo1.gif" Addressable="true" />
    <Asset Type="images/SpellDemo2.gif" Path="extension/images/SpellDemo2.gif" Addressable="true" />
    <Asset Type="images/SpellDemo3.gif" Path="extension/images/SpellDemo3.gif" Addressable="true" />

This lets you address the files with a link like htis for testing:
https://seanmcbreen.gallery.vsassets.io/_apis/public/gallery/publisher/seanmcbreen/extension/Spell/latest/assetbyname/images/SpellDemo1.gif

the Gallery is actually not working as expected here but I did want to share the syntax.

You can also get to the RAW source MD file with a link like this which could help for debug:
https://seanmcbreen.gallery.vsassets.io/_apis/public/gallery/publisher/seanmcbreen/extension/Spell/latest/assetbyname/Microsoft.VisualStudio.Services.Content.Details

@joaomoreno
Copy link
Member

@seanmcbreen give it another try

@seanmcbreen
Copy link
Author

Unfortunately no luck on either MDTools or Spell-Check. Both published but the readme images did not work. In the VSIC there were no asset mapping tags and in the source Readme.

@seanmcbreen seanmcbreen reopened this Nov 6, 2015
@seanmcbreen
Copy link
Author

Oops my bad I did not first update to 0.7.1.

I was successful w/ https://app.market.visualstudio.com/items/seanmcbreen.MDTools

I did need to massage a few errors I had. I will now try spell..

@joaomoreno
Copy link
Member

👍

@seanmcbreen
Copy link
Author

It's early but you so go get yourself a beer :)

https://app.market.visualstudio.com/items/seanmcbreen.Spell

@joaomoreno
Copy link
Member

Nah, we're having something better:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

3 participants