Skip to content

Commit

Permalink
Merge branch 'java7'
Browse files Browse the repository at this point in the history
  • Loading branch information
rjolly committed Mar 8, 2020
2 parents 1785476 + cb2c96a commit 16a6071
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 3 deletions.
39 changes: 39 additions & 0 deletions init.js
Original file line number Diff line number Diff line change
Expand Up @@ -464,3 +464,42 @@ function jarlister(path, out) {
}
Packages.scala.tools.nsc.JarLister$.MODULE$.process(opts.concat([pathToFile(path)]));
}

// requires net.sourceforge.jscl-meditor#txt2xhtml;2.0

function txt2xhtml(srcDir, destDir, stylesheet, feed, icon) {
if (stylesheet == undefined) {
stylesheet = "/mathmlc2p.xsl";
}
if (feed == undefined) {
feed = null;
}
if (icon == undefined) {
icon = null;
}
destDir = pathToFile(destDir);
srcDir = pathToFile(srcDir);
function callback(file) {
FileReader = java.io.FileReader;
FileWriter = java.io.FileWriter;
StringReader = java.io.StringReader;
Converter = Packages.jscl.converter.Converter;
var converter = new Converter();
var str = relativize(srcDir, file).getPath();
str = str.substring(0, str.lastIndexOf("."));
var out = new File(destDir, str + ".xhtml");
var parent = out.getParentFile();
if (parent != null) {
parent.mkdirs();
}
var reader = new BufferedReader(new FileReader(file));
var writer = new FileWriter(out);
try {
converter.pipe(new StringReader(converter.apply(reader, stylesheet, str, feed, icon, null, true)), writer);
} finally {
writer.close();
reader.close();
}
}
find(srcDir, ".*\.txt", callback)
}
3 changes: 2 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ List of applications
net.java.linoleum#jcterm;0.0.11 SSH2 Terminal Emulator in Pure Java
net.java.linoleum#media;1.6 Media Player (requires jmf)
net.java.linoleum#pdfview;1.6 PDF viewer (may require jai in some cases)
net.sourceforge.jscl-meditor#meditor;5.3.2 Java symbolic computing library and mathematical editor
net.sourceforge.jscl-meditor#meditor;5.3.3 Java symbolic computing library and mathematical editor


Useful libraries
Expand All @@ -77,6 +77,7 @@ Useful libraries
mstor#mstor;0.9.9 A JavaMail provider for persistent email storage
org.bouncycastle#bcpg-jdk15on;1.64 The Bouncy Castle Java API for handling the OpenPGP protocol
org.ghost4j#ghost4j;1.0.1 Ghost4J binds the Ghostscript C API to bring Ghostscript power to the Java world
net.sourceforge.jscl-meditor#txt2xhtml;2.0 Text to XHTML converter


Scala
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/META-INF/mime.types
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ application/xhtml+xml xhtml
application/java-archive jar
application/javascript js
application/mvr mvr
application/zip zip
application/zip zip epub
audio/basic au snd
audio/midi midi mid
audio/mpeg mp3 mp2 mpa
Expand All @@ -17,7 +17,7 @@ image/png png PNG
image/bmp bmp BMP
text/plain txt text TXT
text/html htm html
text/xml xml
text/xml xml svg
text/x-properties properties
text/x-java java
text/x-scala scala
Expand Down

0 comments on commit 16a6071

Please sign in to comment.