textile to slides

    @@ -1,6 +1,6 @@ /* * @title textile to slide - * @description textileフォーマットのテキストをHTML5SLIDEにするブックマークレット + * @description textileフォーマットのテキストをhtml5slidesにするブックマークレット * @include http://* * @license MIT License * @require http://www.ben-daglish.net/textile/textile.js
  • /*
     * @title textile to slide
     * @description textileフォーマットのテキストをhtml5slidesにするブックマークレット
     * @include http://*
     * @license MIT License
     * @require http://www.ben-daglish.net/textile/textile.js
     * @require http://html5slides.googlecode.com/svn/trunk/slides.js
     */
    
    function textiletoslide(){
      var content = document.getElementsByTagName('pre')[0];
      content.innerHTML = convert(content.innerHTML);
      content.style.display = "none";
    
      var slides = document.createElement('section');
      slides.className = "slides layout-regular template-default";
      document.body.appendChild(slides);
    
      var article = null;
    
      for(var c=0; c<content.childNodes.length; c++){
        var child = content.childNodes[c];
        if( ["H1", "H2", "H3"].indexOf(child.tagName) > -1 ){ // is H1,2,3
          if( article != null ){
            slides.appendChild(article);
          }
          article = document.createElement('article');
          article.appendChild(child);
        } else {
          if( article == null ){
            article = document.createElement('article');
          }
          article.appendChild(child);
        }
      }
    
      handleDomLoaded();
    }
    
    textiletoslide();
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2012/06/02 13:51:39 - 2012-06-02
  2. 2012/06/02 13:31:19 - 2012-06-02
  3. 2012/06/02 00:56:28 - 2012-06-02
  4. 2012/06/02 00:49:31 - 2012-06-02
  5. 2012/06/02 00:49:07 - 2012-06-02
  6. 2012/06/02 00:46:59 - 2012-06-02
  7. 2012/06/02 00:34:17 - 2012-06-02
  8. 2012/06/02 00:33:31 - 2012-06-02