فهرست منبع

Add in support for markdown files

James Allen 12 سال پیش
والد
کامیت
129cf0bf62

+ 3 - 3
services/clsi/app/coffee/LatexRunner.coffee

@@ -12,9 +12,9 @@ module.exports = LatexRunner =
 
 		logger.log directory: directory, compiler: compiler, timeout: timeout, mainFile: mainFile, "starting compile"
 
-		# We want to run latexmk on the tex file which we it will automatically
-		# generate from the Rtex file.
-		mainFile = mainFile.replace(/\.Rtex$/, ".tex")
+		# We want to run latexmk on the tex file which we will automatically
+		# generate from the Rtex/Rmd/md file.
+		mainFile = mainFile.replace(/\.(Rtex|md|Rmd)$/, ".tex")
 
 		if compiler == "pdflatex"
 			command = LatexRunner._pdflatexCommand mainFile

+ 17 - 0
services/clsi/test/acceptance/fixtures/examples/markdown-included/chapters/chapter1.md

@@ -0,0 +1,17 @@
+Section Title
+-------------
+
+* List item one
+* List item two
+
+: Sample grid table.
+
++---------------+---------------+--------------------+
+| Fruit         | Price         | Advantages         |
++===============+===============+====================+
+| Bananas       | $1.34         | - built-in wrapper |
+|               |               | - bright color     |
++---------------+---------------+--------------------+
+| Oranges       | $2.10         | - cures scurvy     |
+|               |               | - tasty            |
++---------------+---------------+--------------------+

+ 9 - 0
services/clsi/test/acceptance/fixtures/examples/markdown-included/main.tex

@@ -0,0 +1,9 @@
+\documentclass{article}
+\usepackage{longtable}
+\usepackage{booktabs, multicol, multirow}
+
+\begin{document}
+
+\input{chapters/chapter1}
+
+\end{document}

BIN
services/clsi/test/acceptance/fixtures/examples/markdown-included/output.pdf


+ 23 - 0
services/clsi/test/acceptance/fixtures/examples/markdown-standalone/main.md

@@ -0,0 +1,23 @@
+% Title
+% Author
+% Date
+
+Chapter title
+=============
+
+Section Title
+-------------
+
+Hello world. Have a nice table:
+
+: Sample grid table.
+
++---------------+---------------+--------------------+
+| Fruit         | Price         | Advantages         |
++===============+===============+====================+
+| Bananas       | $1.34         | - built-in wrapper |
+|               |               | - bright color     |
++---------------+---------------+--------------------+
+| Oranges       | $2.10         | - cures scurvy     |
+|               |               | - tasty            |
++---------------+---------------+--------------------+

BIN
services/clsi/test/acceptance/fixtures/examples/markdown-standalone/output.pdf