Skip to content

Add button to preview HTML files #1096

Closed

Description

@benwaffle

very useful for .html files

Activity

  1. sindresorhus commented on Feb 17, 2018

    @sindresorhus
    Member

    Can you please elaborate a bit more about what you're looking for?

  2. fregante commented on Feb 18, 2018

    @fregante
    Member

    The difference is subtle:

    RawGit serves raw files directly from GitHub with proper Content-Type headers.
    

    I wouldn't add another Raw button that is only sometimes different.

    I probably wouldn't replace the current Raw button with one linked to rawgit (maybe? because it breaks expectations)

    Not sure how discoverable it would be to add a modifier+click on the Raw button to open rawgit instead

  3. fregante commented on Feb 20, 2018

    @fregante
    Member

    Perhaps we can add a View/Preview button for HTML files, I think that's the only case where rawgit links are visibly different.

  4. theel0ja commented on May 6, 2018

    @theel0ja

    Something like this in Gists when the file is HTML:

    image

  5. sgabler commented on Oct 13, 2018

    @sgabler

    I think this issue can be closed, as RawGit will soon shut down: https://rawgit.com/

    RawGit is now in a sunset phase and will soon shut down. It's been a fun five years, but all things must end.

    GitHub repositories that served content through RawGit within the last month will continue to be served until at least October of 2019. URLs for other repositories are no longer being served.

    If you're currently using RawGit, please stop using it as soon as you can.

  6. fregante commented on Oct 13, 2018

    @fregante
    Member

    Are there any alternative services?

  7. tanmayrajani commented on Oct 13, 2018

    @tanmayrajani
    Contributor

    There's always this option if someone's up for it

  8. fregante commented on Oct 14, 2018

    @fregante
    Member

    No way! They’re closing it because of spam, no one here is gonna clone the service (and its issues) just to preview HTML files 😃

  9. changed the title [-]Add button to open file with rawgit.com[/-] [+]Add button to open file with staticaly.com[/+] on Nov 2, 2018
  10. added
    small
    and removed on Dec 14, 2018
  11. changed the title [-]Add button to open file with staticaly.com[/-] [+]Add button to preview HTML files[/+] on Feb 15, 2019
  12. berezovskyi commented on Jun 17, 2019

    @berezovskyi
  13. fregante commented on Sep 7, 2019

    @fregante
    Member

    This seems really easy:

    const rawButton = select('#raw-url');
    if (rawButton && /\.html?/.test(rawButton.pathname)) {
    	rawButton.after(
    		<a href={rawButton.href.replace('https://github.com', 'https://cdn.staticaly.com/gh')}>Preview</a>
    	);
    }
    
    features.add({
    	...
    	include: [
    		isSingleFile
    	],
    	exclude: [
    		isEnterprise
    	]
    })

    Anyone who wants it, just needs to create a feature called html-preview-link and add documentation for it. Follow contribute.md

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedenhancementsmall

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions