<!DOCTYPE html>
<html>

  <head>
    <link data-require="highlight.js@*" data-semver="0.7.3" rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/7.3/styles/solarized_dark.min.css" />
    <link data-require="highlight.js@*" data-semver="0.7.3" rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/7.3/styles/github.min.css" />
    <link data-require="highlight.js@*" data-semver="0.7.3" rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/7.3/styles/default.min.css" />
    <link rel="stylesheet" href="style.css" />
  </head>

  <body>
    <div id="app">
      <span v-html="style"></span>
    </div>
    <script data-require="jquery@2.2.4" data-semver="2.2.4" src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
    <script data-require="vue.js@*" data-semver="10.0.26" src="https://cdn.jsdelivr.net/vue/1.0.26/vue.min.js"></script>
    <script data-require="axios@*" data-semver="0.018.0" src="https://unpkg.com/axios@0.18.0/dist/axios.min.js"></script>
    <script data-require="marked@*" data-semver="0.3.5" src="https://cdnjs.cloudflare.com/ajax/libs/marked/0.3.5/marked.min.js"></script>
    <script data-require="highlight.js@*" data-semver="0.7.3" src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/7.3/highlight.min.js"></script>
    <script src="script.js"></script>
  </body>

</html>
(function(global, $) {
  marked.setOptions({
    langPrefix: '',
    highlight: function(code, lang) {
      return hljs.highlightAuto(code, [lang]).value;
    }
  });
  
  var app = new Vue({
    el: '#app',
    data: {
      style: 'It\'s default text',
      message: 'You loaded this page on ' + new Date().toLocaleString(),
      seen: false
    },
    methods: {
      set: function(data) {
        Vue.set(app, 'style', data);
      }
    }
  });

  axios.get('./style.css')
  .then(function (response) {
    var data = response.data.match(/\/\*docs[\s\S]*?\*\//gm);
    data.forEach(function(v,i,a) {
      a[i] = a[i].replace(/\/\*docs[\s\S]/, '').replace(/[\s\S]\*\//, '');
      a[i] = marked(a[i]);
    });
    app.set(data);
  })
  .catch(function (error) {
    console.log(error);
  });

})(window, jQuery);
/*docs
コメントコメントコメント

```html
<span>赤</span>
```
*/
span {
  color: #f66;
}

/*docs
コメントコメントコメント

```html
<span class="test">.test</span>
```
*/
.test {
  color: #0ff;
}