diff options
| -rw-r--r-- | .gitignore | 6 | ||||
| -rw-r--r-- | download.php | 55 | ||||
| -rw-r--r-- | index.php | 4 | ||||
| -rw-r--r-- | output/test169.md | 7 |
4 files changed, 72 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9bd4030 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +# Ignore files starting with "procrastiSlides" +procrastiSlides*.pdf + +# Ignore the conversion files +push*.md +convert*.md diff --git a/download.php b/download.php index ea08e52..405c6d8 100644 --- a/download.php +++ b/download.php @@ -36,6 +36,61 @@ <div class="centered"> <?php + if(isset($_POST['test169'])) + { + $_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/test169.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['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'; + + $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/defaultIsKing.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['defaultIsKing'])) { $_SESSION['pres'] = uniqid('pres', true) . '.md'; @@ -47,6 +47,10 @@ <h2>select</h2> </th> <tr> + <td>placeHolderImage<br></td> + <td><button type="submit" name="test169">test169</button></td> + </tr> + <tr> <td><img class=theme-select src="img/defaultIsKing.webp" alt="defaultIsKing"><br></td> <td><button type="submit" name="defaultIsKing">defaultIsKing</button></td> </tr> diff --git a/output/test169.md b/output/test169.md new file mode 100644 index 0000000..d434e10 --- /dev/null +++ b/output/test169.md @@ -0,0 +1,7 @@ +--- +theme: Nord +colortheme: Nord +aspectratio: 169 +fontsize: 17pt +fontfamily: libertine +--- |
