Reference GitHub file in jsFiddle

前端 未结 6 965
悲&欢浪女
悲&欢浪女 2020-11-30 18:36

Is there a possibility to misuse grab files from a github repo as external resources in jsFiddle?

6条回答
  •  囚心锁ツ
    2020-11-30 18:56

    If there is a git repo in following folder structure

    fiddletest/test1 (fiddletest is the repo name and test1 is a folder)

    then the corresponding jsfiddle link will be

    http://jsfiddle.net/gh/get////fiddletest/tree/master/test1/
    

    The folder and file structure must be like this

    fiddletest(the repo name)
    |____ test1
          |____ demo.html
          |____ demo.js
          |____ demo.css
          |____ demo.details 
    

    except these three files others will be ignored. the details file should hold the fiddle details and link of external resources(if any) as follows

    ---
    name: test fiddle repo
    description: this is a test repo
    resources: 
      - http://abc.xyz.com/abc.js
      - http://abc.xyz.com/abc2.js
    ...
    

    May be you have noticed the and in the fiddle link. If a fiddle is with pure js the the library name should be "library" and the version should be "pure"

    In a nutshell the fiddle link to reffer to github should be in following format

    http://jsfiddle.net/gh/get/////tree///
    

提交回复
热议问题