diff options
| author | Kyle Javier (kj-sh604) | 2023-07-09 01:01:47 -0400 |
|---|---|---|
| committer | GitHub | 2023-07-09 01:01:47 -0400 |
| commit | 162c3e2e334fb0bd520f02b8da9626b351445381 (patch) | |
| tree | ef037d64767093844feab31b89ea5459c0c8d86c /download.php | |
| parent | 86533f412a4bea643d99a794fcf655827163decf (diff) | |
| parent | c3f58e4832ff0cafaeb616601a719b0a755fba2e (diff) | |
merge: pr #2 from kj-sh604/add-16_9-templates
feat. branch: add 16:9 themes amongst other things
Diffstat (limited to '')
| -rw-r--r-- | download.php | 493 |
1 files changed, 341 insertions, 152 deletions
diff --git a/download.php b/download.php index b6aa4cb..af207d5 100644 --- a/download.php +++ b/download.php @@ -1,217 +1,406 @@ <?php session_start(); ?> <!DOCTYPE html> <html lang=en> - <head> - <meta charset="UTF-8"> - <meta name="viewport" content="width=device-width, initial-scale=1"> - <link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet"> - <link rel="stylesheet" href="css/style.css"> - <link rel = "icon" href = "img/site-icon.webp" type = "image/x-icon"> - <link rel="stylesheet" href="https://cdn.rawgit.com/xcatliu/simplemde-theme-dark/master/dist/simplemde-theme-dark.min.css + +<head> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet"> + <link rel="stylesheet" href="css/style.css"> + <link rel="icon" href="img/site-icon.webp" type="image/x-icon"> + <link rel="stylesheet" href="https://cdn.rawgit.com/xcatliu/simplemde-theme-dark/master/dist/simplemde-theme-dark.min.css "> - <script src="https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.js"></script> - <title>procrastiSlides: great for procratinators who need to get a presentation out, quick! π</title> - <meta name="description" content="create presentations from markdown or plain text! π€ procrastiSlides is a simple presentation(s) site that respects your dark mode setting and has responsive web design. + <script src="https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.js"></script> + <title>procrastiSlides: great for procratinators who need to get a presentation out, quick! π</title> + <meta name="description" content="create presentations from markdown or plain text! π€ procrastiSlides is a simple presentation(s) site that respects your dark mode setting and has responsive web design. non-intruisive ads, no tracking, nothing but quick slides from plain text/markdown. π« try copy and pasting your school notes! that might even work π"> - </head> - <body> - <div class=banner> - <h1>π procrastiSlides v0.01 π¬</h1> - <hr/> - </div> - <p class="centered">this website is inspired from the suckless's presentation tool (<a target="_blank" href="https://tools.suckless.org/sent">sent</a>) - and Luke Smith's <a target="_blank" href="https://youtu.be/dum7q6UXiCE">video</a> on creating presentations using markdown and LaTeX beamer. - We would like to personally thank them for all the educational resources (for suckless, it's the source code π) that they have shared with the open - souce community throughout the yearsβ¦ <b>π Thank you! π€</b> </p> - <hr> - - <?php include "includes/nav-header.php" ?> - <br> - - <h3 class="centered">π your procrastiSlides .pdf presentation has been generated successfully!!! πΎ - </h3> - - <h3 class="centered">π your download link is below: π - </h3> - <div class="centered"> +</head> + +<body> + <div class=banner> + <h1>π procrastiSlides v0.02 π¬</h1> + <hr /> + </div> + <p class="centered">this website is inspired from the suckless's presentation tool (<a target="_blank" href="https://tools.suckless.org/sent">sent</a>). it uses pandoc and LaTeX beamer for the backend. <br><br><b>latest feature update:</b> addition of 16:9 themes</p> + <hr> + + <?php include "includes/nav-header.php"; ?> + <br> + + <h3 class="centered">π your procrastiSlides .pdf presentation has been generated successfully!!! πΎ + </h3> + + <h3 class="centered">π your download link is below: π + </h3> + <div class="centered"> + <?php if (isset($_POST["90sMakeUpCommercial"])) { + + $_SESSION["pres"] = uniqid("pres", true) . ".md"; + $_SESSION["push"] = uniqid("push", true) . ".md"; + $_SESSION["convert"] = uniqid("convert", true) . ".md"; + $_SESSION["filename"] = uniqid("procrastiSlides_", true) . ".pdf"; + + $pres = $_SESSION["pres"]; // filename of the template file with metadata + $push = $_SESSION["push"]; // filename of where the user data is stored + $convert = $_SESSION["convert"]; // concatanated file to be converted to .pdf + $filename = $_SESSION["filename"]; // output file name + + $userMarkdown = $_SESSION["user-input"]; // this used to be _POST['user-input'] + // $_SESSION['user-input'] = $_POST['user-input']; + $conversion = "pandoc -f markdown+hard_line_breaks output/'$convert' -t beamer -o output/'$filename' --pdf-engine=pdflatex"; + + shell_exec("echo '$userMarkdown' > output/'$push'"); + shell_exec( + "cat output/90sMakeUpCommercial.md output/'$push' > output/'$convert'" + ); + shell_exec($conversion); + + // sleep(1); + ?> + + <h2><a href="output/<?php echo $_SESSION["filename"]; ?>">download presentation</a></h2> + + <?php + } ?> + + <?php if (isset($_POST["chicagoOlives"])) { + + $_SESSION["pres"] = uniqid("pres", true) . ".md"; + $_SESSION["push"] = uniqid("push", true) . ".md"; + $_SESSION["convert"] = uniqid("convert", true) . ".md"; + $_SESSION["filename"] = uniqid("procrastiSlides_", true) . ".pdf"; + + $pres = $_SESSION["pres"]; // filename of the template file with metadata + $push = $_SESSION["push"]; // filename of where the user data is stored + $convert = $_SESSION["convert"]; // concatanated file to be converted to .pdf + $filename = $_SESSION["filename"]; // output file name + + $userMarkdown = $_SESSION["user-input"]; // this used to be _POST['user-input'] + // $_SESSION['user-input'] = $_POST['user-input']; + $conversion = "pandoc -f markdown+hard_line_breaks output/'$convert' -t beamer -o output/'$filename' --pdf-engine=pdflatex"; + + shell_exec("echo '$userMarkdown' > output/'$push'"); + shell_exec( + "cat output/chicagoOlives.md output/'$push' > output/'$convert'" + ); + shell_exec($conversion); + + // sleep(1); + ?> + + <h2><a href="output/<?php echo $_SESSION["filename"]; ?>">download presentation</a></h2> + + <?php + } ?> + + <?php if (isset($_POST["cleanMetropolis"])) { + + $_SESSION["pres"] = uniqid("pres", true) . ".md"; + $_SESSION["push"] = uniqid("push", true) . ".md"; + $_SESSION["convert"] = uniqid("convert", true) . ".md"; + $_SESSION["filename"] = uniqid("procrastiSlides_", true) . ".pdf"; + + $pres = $_SESSION["pres"]; // filename of the template file with metadata + $push = $_SESSION["push"]; // filename of where the user data is stored + $convert = $_SESSION["convert"]; // concatanated file to be converted to .pdf + $filename = $_SESSION["filename"]; // output file name + + $userMarkdown = $_SESSION["user-input"]; // this used to be _POST['user-input'] + // $_SESSION['user-input'] = $_POST['user-input']; + $conversion = "pandoc -f markdown+hard_line_breaks output/'$convert' -t beamer -o output/'$filename' --pdf-engine=pdflatex"; + + shell_exec("echo '$userMarkdown' > output/'$push'"); + shell_exec( + "cat output/cleanMetropolis.md output/'$push' > output/'$convert'" + ); + shell_exec($conversion); + + // sleep(1); + ?> + + <h2><a href="output/<?php echo $_SESSION["filename"]; ?>">download presentation</a></h2> + + <?php + } ?> + + <?php if (isset($_POST["ohioCustard"])) { + + $_SESSION["pres"] = uniqid("pres", true) . ".md"; + $_SESSION["push"] = uniqid("push", true) . ".md"; + $_SESSION["convert"] = uniqid("convert", true) . ".md"; + $_SESSION["filename"] = uniqid("procrastiSlides_", true) . ".pdf"; + + $pres = $_SESSION["pres"]; // filename of the template file with metadata + $push = $_SESSION["push"]; // filename of where the user data is stored + $convert = $_SESSION["convert"]; // concatanated file to be converted to .pdf + $filename = $_SESSION["filename"]; // output file name + + $userMarkdown = $_SESSION["user-input"]; // this used to be _POST['user-input'] + // $_SESSION['user-input'] = $_POST['user-input']; + $conversion = "pandoc -f markdown+hard_line_breaks output/'$convert' -t beamer -o output/'$filename' --pdf-engine=pdflatex"; + + shell_exec("echo '$userMarkdown' > output/'$push'"); + shell_exec( + "cat output/ohioCustard.md output/'$push' > output/'$convert'" + ); + shell_exec($conversion); + + // sleep(1); + ?> + + <h2><a href="output/<?php echo $_SESSION["filename"]; ?>">download presentation</a></h2> + <?php + } ?> - if(isset($_POST['defaultIsKing'])) - { - $_SESSION['pres'] = uniqid('pres', true) . '.md'; - $_SESSION['push'] = uniqid('push', true) . '.md'; - $_SESSION['convert'] = uniqid('convert', true) . '.md'; - $_SESSION['filename'] = uniqid('procrastiSlides_', true) . '.pdf'; + <?php if (isset($_POST["raleighAroundMe"])) { - $pres = $_SESSION['pres']; // filename of the template file with metadata - $push = $_SESSION['push']; // filename of where the user data is stored - $convert = $_SESSION['convert']; // concatanated file to be converted to .pdf - $filename = $_SESSION['filename']; // output file name + $_SESSION["pres"] = uniqid("pres", true) . ".md"; + $_SESSION["push"] = uniqid("push", true) . ".md"; + $_SESSION["convert"] = uniqid("convert", true) . ".md"; + $_SESSION["filename"] = uniqid("procrastiSlides_", true) . ".pdf"; + $pres = $_SESSION["pres"]; // filename of the template file with metadata + $push = $_SESSION["push"]; // filename of where the user data is stored + $convert = $_SESSION["convert"]; // concatanated file to be converted to .pdf + $filename = $_SESSION["filename"]; // output file name - $userMarkdown = $_SESSION['user-input']; // this used to be _POST['user-input'] - // $_SESSION['user-input'] = $_POST['user-input']; - $conversion = "pandoc -f markdown+hard_line_breaks output/'$convert' -t beamer -o output/'$filename' --pdf-engine=pdflatex"; + $userMarkdown = $_SESSION["user-input"]; // this used to be _POST['user-input'] + // $_SESSION['user-input'] = $_POST['user-input']; + $conversion = "pandoc -f markdown+hard_line_breaks output/'$convert' -t beamer -o output/'$filename' --pdf-engine=pdflatex"; + + shell_exec("echo '$userMarkdown' > output/'$push'"); + shell_exec( + "cat output/raleighAroundMe.md output/'$push' > output/'$convert'" + ); + shell_exec($conversion); + + // sleep(1); + ?> + + <h2><a href="output/<?php echo $_SESSION["filename"]; ?>">download presentation</a></h2> + + <?php + } ?> + + <?php if (isset($_POST["earlyCupertino"])) { + + $_SESSION["pres"] = uniqid("pres", true) . ".md"; + $_SESSION["push"] = uniqid("push", true) . ".md"; + $_SESSION["convert"] = uniqid("convert", true) . ".md"; + $_SESSION["filename"] = uniqid("procrastiSlides_", true) . ".pdf"; + + $pres = $_SESSION["pres"]; // filename of the template file with metadata + $push = $_SESSION["push"]; // filename of where the user data is stored + $convert = $_SESSION["convert"]; // concatanated file to be converted to .pdf + $filename = $_SESSION["filename"]; // output file name - shell_exec("echo '$userMarkdown' > output/'$push'"); - shell_exec("cat output/defaultIsKing.md output/'$push' > output/'$convert'"); - shell_exec($conversion); - // sleep(1); ?> + $userMarkdown = $_SESSION["user-input"]; // this used to be _POST['user-input'] + // $_SESSION['user-input'] = $_POST['user-input']; + $conversion = "pandoc -f markdown+hard_line_breaks output/'$convert' -t beamer -o output/'$filename' --pdf-engine=pdflatex"; + + shell_exec("echo '$userMarkdown' > output/'$push'"); + shell_exec( + "cat output/earlyCupertino.md output/'$push' > output/'$convert'" + ); + shell_exec($conversion); + + // sleep(1); + ?> - <h2><a href="output/<?php echo $_SESSION['filename']; ?>">download presentation</a></h2> + <h2><a href="output/<?php echo $_SESSION["filename"]; ?>">download presentation</a></h2> - <?php } ?> + <?php + } ?> - <?php - if(isset($_POST['strengthInNumbers'])) - { - $_SESSION['pres'] = uniqid('pres', true) . '.md'; - $_SESSION['push'] = uniqid('push', true) . '.md'; - $_SESSION['convert'] = uniqid('convert', true) . '.md'; - $_SESSION['filename'] = uniqid('procrastiSlides_', true) . '.pdf'; + <?php if (isset($_POST["defaultIsKing"])) { - $pres = $_SESSION['pres']; // filename of the template file with metadata - $push = $_SESSION['push']; // filename of where the user data is stored - $convert = $_SESSION['convert']; // concatanated file to be converted to .pdf - $filename = $_SESSION['filename']; // output file name + $_SESSION["pres"] = uniqid("pres", true) . ".md"; + $_SESSION["push"] = uniqid("push", true) . ".md"; + $_SESSION["convert"] = uniqid("convert", true) . ".md"; + $_SESSION["filename"] = uniqid("procrastiSlides_", true) . ".pdf"; + $pres = $_SESSION["pres"]; // filename of the template file with metadata + $push = $_SESSION["push"]; // filename of where the user data is stored + $convert = $_SESSION["convert"]; // concatanated file to be converted to .pdf + $filename = $_SESSION["filename"]; // output file name - $userMarkdown = $_SESSION['user-input']; // this used to be _POST['user-input'] - // $_SESSION['user-input'] = $_POST['user-input']; - $conversion = "pandoc -f markdown+hard_line_breaks output/'$convert' -t beamer -o output/'$filename' --pdf-engine=pdflatex"; + $userMarkdown = $_SESSION["user-input"]; // this used to be _POST['user-input'] + // $_SESSION['user-input'] = $_POST['user-input']; + $conversion = "pandoc -f markdown+hard_line_breaks output/'$convert' -t beamer -o output/'$filename' --pdf-engine=pdflatex"; - shell_exec("echo '$userMarkdown' > output/'$push'"); - shell_exec("cat output/strengthInNumbers.md output/'$push' > output/'$convert'"); - shell_exec($conversion); - // sleep(1); ?> + shell_exec("echo '$userMarkdown' > output/'$push'"); + shell_exec( + "cat output/defaultIsKing.md output/'$push' > output/'$convert'" + ); + shell_exec($conversion); - <h2><a href="output/<?php echo $_SESSION['filename']; ?>">download presentation</a></h2> + // sleep(1); + ?> - <?php } ?> + <h2><a href="output/<?php echo $_SESSION["filename"]; ?>">download presentation</a></h2> - <?php + <?php + } ?> - if(isset($_POST['thatMagazine'])) - { - $_SESSION['pres'] = uniqid('pres', true) . '.md'; - $_SESSION['push'] = uniqid('push', true) . '.md'; - $_SESSION['convert'] = uniqid('convert', true) . '.md'; - $_SESSION['filename'] = uniqid('procrastiSlides_', true) . '.pdf'; + <?php if (isset($_POST["strengthInNumbers"])) { - $pres = $_SESSION['pres']; // filename of the template file with metadata - $push = $_SESSION['push']; // filename of where the user data is stored - $convert = $_SESSION['convert']; // concatanated file to be converted to .pdf - $filename = $_SESSION['filename']; // output file name + $_SESSION["pres"] = uniqid("pres", true) . ".md"; + $_SESSION["push"] = uniqid("push", true) . ".md"; + $_SESSION["convert"] = uniqid("convert", true) . ".md"; + $_SESSION["filename"] = uniqid("procrastiSlides_", true) . ".pdf"; + $pres = $_SESSION["pres"]; // filename of the template file with metadata + $push = $_SESSION["push"]; // filename of where the user data is stored + $convert = $_SESSION["convert"]; // concatanated file to be converted to .pdf + $filename = $_SESSION["filename"]; // output file name - $userMarkdown = $_SESSION['user-input']; // this used to be _POST['user-input'] + $userMarkdown = $_SESSION["user-input"]; // this used to be _POST['user-input'] // $_SESSION['user-input'] = $_POST['user-input']; $conversion = "pandoc -f markdown+hard_line_breaks output/'$convert' -t beamer -o output/'$filename' --pdf-engine=pdflatex"; shell_exec("echo '$userMarkdown' > output/'$push'"); - shell_exec("cat output/thatMagazine.md output/'$push' > output/'$convert'"); + shell_exec( + "cat output/strengthInNumbers.md output/'$push' > output/'$convert'" + ); shell_exec($conversion); - // sleep(1); ?> - <h2><a href="output/<?php echo $_SESSION['filename']; ?>">download presentation</a></h2> + // sleep(1); + ?> - <?php } ?> + <h2><a href="output/<?php echo $_SESSION["filename"]; ?>">download presentation</a></h2> - <?php + <?php + } ?> + + <?php if (isset($_POST["thatMagazine"])) { + + $_SESSION["pres"] = uniqid("pres", true) . ".md"; + $_SESSION["push"] = uniqid("push", true) . ".md"; + $_SESSION["convert"] = uniqid("convert", true) . ".md"; + $_SESSION["filename"] = uniqid("procrastiSlides_", true) . ".pdf"; - if(isset($_POST['cuppertinoIsh'])) - { - $_SESSION['pres'] = uniqid('pres', true) . '.md'; - $_SESSION['push'] = uniqid('push', true) . '.md'; - $_SESSION['convert'] = uniqid('convert', true) . '.md'; - $_SESSION['filename'] = uniqid('procrastiSlides_', true) . '.pdf'; + $pres = $_SESSION["pres"]; // filename of the template file with metadata + $push = $_SESSION["push"]; // filename of where the user data is stored + $convert = $_SESSION["convert"]; // concatanated file to be converted to .pdf + $filename = $_SESSION["filename"]; // output file name + + $userMarkdown = $_SESSION["user-input"]; // this used to be _POST['user-input'] + // $_SESSION['user-input'] = $_POST['user-input']; + $conversion = "pandoc -f markdown+hard_line_breaks output/'$convert' -t beamer -o output/'$filename' --pdf-engine=pdflatex"; - $pres = $_SESSION['pres']; // filename of the template file with metadata - $push = $_SESSION['push']; // filename of where the user data is stored - $convert = $_SESSION['convert']; // concatanated file to be converted to .pdf - $filename = $_SESSION['filename']; // output file name + shell_exec("echo '$userMarkdown' > output/'$push'"); + shell_exec( + "cat output/thatMagazine.md output/'$push' > output/'$convert'" + ); + shell_exec($conversion); + // sleep(1); + ?> - $userMarkdown = $_SESSION['user-input']; // this used to be _POST['user-input'] - // $_SESSION['user-input'] = $_POST['user-input']; - $conversion = "pandoc -f markdown+hard_line_breaks output/'$convert' -t beamer -o output/'$filename' --pdf-engine=pdflatex"; + <h2><a href="output/<?php echo $_SESSION["filename"]; ?>">download presentation</a></h2> - shell_exec("echo '$userMarkdown' > output/'$push'"); - shell_exec("cat output/cuppertinoIsh.md output/'$push' > output/'$convert'"); - shell_exec($conversion); - // sleep(1); ?> + <?php + } ?> - <h2><a href="output/<?php echo $_SESSION['filename']; ?>">download presentation</a></h2> + <?php if (isset($_POST["cuppertinoIsh"])) { - <?php } ?> + $_SESSION["pres"] = uniqid("pres", true) . ".md"; + $_SESSION["push"] = uniqid("push", true) . ".md"; + $_SESSION["convert"] = uniqid("convert", true) . ".md"; + $_SESSION["filename"] = + uniqid("procrastiSlides_", true) . ".pdf"; - <?php + $pres = $_SESSION["pres"]; // filename of the template file with metadata + $push = $_SESSION["push"]; // filename of where the user data is stored + $convert = $_SESSION["convert"]; // concatanated file to be converted to .pdf + $filename = $_SESSION["filename"]; // output file name - if(isset($_POST['lazyProfessor'])) - { - $_SESSION['pres'] = uniqid('pres', true) . '.md'; - $_SESSION['push'] = uniqid('push', true) . '.md'; - $_SESSION['convert'] = uniqid('convert', true) . '.md'; - $_SESSION['filename'] = uniqid('procrastiSlides_', true) . '.pdf'; + $userMarkdown = $_SESSION["user-input"]; // this used to be _POST['user-input'] + // $_SESSION['user-input'] = $_POST['user-input']; + $conversion = "pandoc -f markdown+hard_line_breaks output/'$convert' -t beamer -o output/'$filename' --pdf-engine=pdflatex"; - $pres = $_SESSION['pres']; // filename of the template file with metadata - $push = $_SESSION['push']; // filename of where the user data is stored - $convert = $_SESSION['convert']; // concatanated file to be converted to .pdf - $filename = $_SESSION['filename']; // output file name + shell_exec("echo '$userMarkdown' > output/'$push'"); + shell_exec( + "cat output/cuppertinoIsh.md output/'$push' > output/'$convert'" + ); + shell_exec($conversion); + // sleep(1); + ?> - $userMarkdown = $_SESSION['user-input']; // this used to be _POST['user-input'] - // $_SESSION['user-input'] = $_POST['user-input']; - $conversion = "pandoc -f markdown+hard_line_breaks output/'$convert' -t beamer -o output/'$filename' --pdf-engine=pdflatex"; + <h2><a href="output/<?php echo $_SESSION["filename"]; ?>">download presentation</a></h2> - shell_exec("echo '$userMarkdown' > output/'$push'"); - shell_exec("cat output/lazyProfessor.md output/'$push' > output/'$convert'"); - shell_exec($conversion); - // sleep(1); ?> + <?php + } ?> - <h2><a href="output/<?php echo $_SESSION['filename']; ?>">download presentation</a></h2> + <?php if (isset($_POST["lazyProfessor"])) { - <?php } ?> + $_SESSION["pres"] = uniqid("pres", true) . ".md"; + $_SESSION["push"] = uniqid("push", true) . ".md"; + $_SESSION["convert"] = uniqid("convert", true) . ".md"; + $_SESSION["filename"] = + uniqid("procrastiSlides_", true) . ".pdf"; - <?php + $pres = $_SESSION["pres"]; // filename of the template file with metadata + $push = $_SESSION["push"]; // filename of where the user data is stored + $convert = $_SESSION["convert"]; // concatanated file to be converted to .pdf + $filename = $_SESSION["filename"]; // output file name - if(isset($_POST['redmond2003'])) - { - $_SESSION['pres'] = uniqid('pres', true) . '.md'; - $_SESSION['push'] = uniqid('push', true) . '.md'; - $_SESSION['convert'] = uniqid('convert', true) . '.md'; - $_SESSION['filename'] = uniqid('procrastiSlides_', true) . '.pdf'; + $userMarkdown = $_SESSION["user-input"]; // this used to be _POST['user-input'] + // $_SESSION['user-input'] = $_POST['user-input']; + $conversion = "pandoc -f markdown+hard_line_breaks output/'$convert' -t beamer -o output/'$filename' --pdf-engine=pdflatex"; - $pres = $_SESSION['pres']; // filename of the template file with metadata - $push = $_SESSION['push']; // filename of where the user data is stored - $convert = $_SESSION['convert']; // concatanated file to be converted to .pdf - $filename = $_SESSION['filename']; // output file name + shell_exec("echo '$userMarkdown' > output/'$push'"); + shell_exec( + "cat output/lazyProfessor.md output/'$push' > output/'$convert'" + ); + shell_exec($conversion); + // sleep(1); + ?> - $userMarkdown = $_SESSION['user-input']; // this used to be _POST['user-input'] - // $_SESSION['user-input'] = $_POST['user-input']; - $conversion = "pandoc -f markdown+hard_line_breaks output/'$convert' -t beamer -o output/'$filename' --pdf-engine=pdflatex"; + <h2><a href="output/<?php echo $_SESSION["filename"]; ?>">download presentation</a></h2> - shell_exec("echo '$userMarkdown' > output/'$push'"); - shell_exec("cat output/redmond2003.md output/'$push' > output/'$convert'"); - shell_exec($conversion); - // sleep(1); ?> + <?php + } ?> - <h2><a href="output/<?php echo $_SESSION['filename']; ?>">download presentation</a></h2> + <?php if (isset($_POST["redmond2003"])) { - <?php } ?> + $_SESSION["pres"] = uniqid("pres", true) . ".md"; + $_SESSION["push"] = uniqid("push", true) . ".md"; + $_SESSION["convert"] = uniqid("convert", true) . ".md"; + $_SESSION["filename"] = + uniqid("procrastiSlides_", true) . ".pdf"; + $pres = $_SESSION["pres"]; // filename of the template file with metadata + $push = $_SESSION["push"]; // filename of where the user data is stored + $convert = $_SESSION["convert"]; // concatanated file to be converted to .pdf + $filename = $_SESSION["filename"]; // output file name + $userMarkdown = $_SESSION["user-input"]; // this used to be _POST['user-input'] + // $_SESSION['user-input'] = $_POST['user-input']; + $conversion = "pandoc -f markdown+hard_line_breaks output/'$convert' -t beamer -o output/'$filename' --pdf-engine=pdflatex"; - </div> + shell_exec("echo '$userMarkdown' > output/'$push'"); + shell_exec( + "cat output/redmond2003.md output/'$push' > output/'$convert'" + ); + shell_exec($conversion); + // sleep(1); + ?> - <br><br> - <footer> + <h2><a href="output/<?php echo $_SESSION["filename"]; ?>">download presentation</a></h2> - <?php include "includes/nav-footer.php" ?> + <?php + } ?> + </div> + <br><br> + <footer> + <?php include "includes/nav-footer.php"; ?> + </footer> +</body> - </footer> - </body> </html> |
