0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

ACDLを提唱します。その11

Posted at

概要

ACDLとは、アプリは、クラウド、大切なデータは、ローカルです。
アプリ作ったので、plunkerに上げてみた。

機能

markupで書いた文章をPDFにします。

写真

image.png

サンプルコード

<!DOCTYPE html>
<html>
  <head>
    <link rel="stylesheet" href="style.css">
    <script src="//cdnjs.cloudflare.com/ajax/libs/marked/0.2.9/marked.min.js"></script>
    <script src="//cdnjs.cloudflare.com/ajax/libs/html2canvas/0.4.1/html2canvas.js"></script>
    <script src="//cdnjs.cloudflare.com/ajax/libs/jspdf/1.0.272/jspdf.debug.js"></script>
    <script src="//code.jquery.com/jquery-2.0.3.min.js"></script>
  </head>
  <body>
    <textarea id="src" rows='20' cols='70'>
<br><br>
#アプリ名 三択コンパイラー<br>
##アプリ概要
三択問題を、マウスでクリックするだけで、pythonソースコードを生成する、webアプリケーションである。
<br><br>
##アプリによって実現された事
守備範囲は、限定的だが、ソースコードは、自動生成される。
<br><br>
##アピールポイント1
QUBO、イジング模型を理解できなくとも、ソースが書ける。
逆にソースコードから、理解が期待できる。
<br><br>
##アピールポイント2
評価関数の展開に、sympyを利用した。
<br><br>
##アピールポイント3
webアプリケーションである。
<br><br>
##想定問題
「看護師、aさん、bさん、cさん、から2人を選べ。」<br><br>
「aさんとbさんは、気が合うので、同じ事をすると、気分が良い。
bさんとcさんは、軋轢があり、違うことがしたい。
みんなが、気持ち良くなる組み合わせを求めよ。」
<br><br>
##アプリのurl
https://embed.plnkr.co/plunk/2nOl0AYjrVAbLJsK
<br><br>
##関連Qiita
https://qiita.com/ohisama@github/items/2890cb3c5ea2b54e3ef7
https://qiita.com/ohisama@github/items/5954b7f5a79b3c401877
https://qiita.com/ohisama@github/items/1eb4d7c95836fe921485
https://qiita.com/ohisama@github/items/0c6ed7c9d4d0fb03f0c8
https://qiita.com/ohisama@github/items/8edc64afc90169e485b2
<br><br>
    </textarea>       
    <button onClick="make()">make</button>
    <div id="out"></div>
    <script type='text/javascript'>
$(document).ready(function() {    
  $(window).on("load", function() {
    var target = $("#out");
    target.html(marked($("#src").val()));
  });
});
function make() {
  var pdf = new jsPDF('p', 'pt', 'a4')
  pdf.addHTML(document.body, {
    pagesplit: true
  }, function() {
    pdf.save('slides.pdf');
  });
}
    </script>
  </body>
</html>




成果物

以上

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?