summaryrefslogtreecommitdiff
path: root/support/texplate
diff options
context:
space:
mode:
Diffstat (limited to 'support/texplate')
-rw-r--r--support/texplate/README.md6
-rw-r--r--support/texplate/doc/texplate-manual.pdfbin103721 -> 103717 bytes
-rw-r--r--support/texplate/doc/texplate-manual.tex4
-rw-r--r--support/texplate/scripts/templates/texplate-article.toml (renamed from support/texplate/scripts/templates/article.toml)0
-rw-r--r--support/texplate/scripts/templates/texplate-standalone.toml (renamed from support/texplate/scripts/templates/standalone.toml)0
-rw-r--r--support/texplate/source/main/java/org/islandoftex/texplate/util/MessageUtils.java2
-rw-r--r--support/texplate/source/main/java/org/islandoftex/texplate/util/PathUtils.java36
7 files changed, 27 insertions, 21 deletions
diff --git a/support/texplate/README.md b/support/texplate/README.md
index 19d0583ae6..7fea81da09 100644
--- a/support/texplate/README.md
+++ b/support/texplate/README.md
@@ -1,6 +1,6 @@
# TeXplate
-![Language: Kotlin](https://img.shields.io/badge/Language-Kotlin-blue.svg?style=flat-square) ![Minimum JRE: 8.0](https://img.shields.io/badge/Minimum_JRE-8.0-blue.svg?style=flat-square) ![Current version: 1.0.0](https://img.shields.io/badge/Current_version-1.0.0-blue.svg?style=flat-square)
+![Language: Kotlin](https://img.shields.io/badge/Language-Kotlin-blue.svg?style=flat-square) ![Minimum JRE: 8.0](https://img.shields.io/badge/Minimum_JRE-8.0-blue.svg?style=flat-square) ![Current version: 1.0.1](https://img.shields.io/badge/Current_version-1.0.1-blue.svg?style=flat-square)
TeXplate is a tool for creating document structures based on templates. The application name is a word play on _TeX_ and _template_, so the purpose seems quite obvious: we want to provide an easy and straightforward framework for reducing the typical code boilerplate when writing TeX documents. Also note that one can easily extrapolate the use beyond articles and theses: the application is powerful enough to generate _any_ text-based structure, given that a corresponding template exists.
@@ -20,7 +20,7 @@ $ texplate
\ \_\
\/_/
-TeXplate 1.0.0, a document structure creation tool
+TeXplate 1.0.1, a document structure creation tool
Copyright (c) 2020, Island of TeX
All rights reserved.
@@ -83,7 +83,7 @@ $ texplate -t article -o doc1.tex
\ \_\
\/_/
-TeXplate 1.0.0, a document structure creation tool
+TeXplate 1.0.1, a document structure creation tool
Copyright (c) 2020, Island of TeX
All rights reserved.
diff --git a/support/texplate/doc/texplate-manual.pdf b/support/texplate/doc/texplate-manual.pdf
index f74b875749..98d06b0ca4 100644
--- a/support/texplate/doc/texplate-manual.pdf
+++ b/support/texplate/doc/texplate-manual.pdf
Binary files differ
diff --git a/support/texplate/doc/texplate-manual.tex b/support/texplate/doc/texplate-manual.tex
index 215802ecd9..6fe19fb5e4 100644
--- a/support/texplate/doc/texplate-manual.tex
+++ b/support/texplate/doc/texplate-manual.tex
@@ -17,7 +17,7 @@
\newcommand{\shortopt}[1]{{\ttfamily-#1}}
\newcommand{\longopt}[1]{{\ttfamily{-}{-}#1}}
\newcommand{\macro}[1]{{\ttfamily\textbackslash#1}}
-\newcommand{\texplateversion}{1.0.0}
+\newcommand{\texplateversion}{1.0.1}
\title{A gentle introduction to \texplate:\\ a document structure creation tool}
\author{Island of \TeX}
@@ -396,7 +396,7 @@ The output (i.e., the template merged with the provided data) will be written to
\item When running \texplate, this is the expected output to be displayed in the command line (note that the layout is slightly modified due to space constraints in this user manual):
\begin{code}
-TeXplate 1.0.0, a document structure creation tool
+TeXplate 1.0.1, a document structure creation tool
Copyright (c) 2020, Island of TeX
All rights reserved.
diff --git a/support/texplate/scripts/templates/article.toml b/support/texplate/scripts/templates/texplate-article.toml
index 53f7796762..53f7796762 100644
--- a/support/texplate/scripts/templates/article.toml
+++ b/support/texplate/scripts/templates/texplate-article.toml
diff --git a/support/texplate/scripts/templates/standalone.toml b/support/texplate/scripts/templates/texplate-standalone.toml
index dd8daea65f..dd8daea65f 100644
--- a/support/texplate/scripts/templates/standalone.toml
+++ b/support/texplate/scripts/templates/texplate-standalone.toml
diff --git a/support/texplate/source/main/java/org/islandoftex/texplate/util/MessageUtils.java b/support/texplate/source/main/java/org/islandoftex/texplate/util/MessageUtils.java
index 948d18d953..7649a60e82 100644
--- a/support/texplate/source/main/java/org/islandoftex/texplate/util/MessageUtils.java
+++ b/support/texplate/source/main/java/org/islandoftex/texplate/util/MessageUtils.java
@@ -18,7 +18,7 @@ public class MessageUtils {
private static final int WIDTH = 60;
// the application version
- private static final String VERSION = "1.0.0";
+ private static final String VERSION = "1.0.1";
/**
* Prints a line in the terminal, without a line break.
diff --git a/support/texplate/source/main/java/org/islandoftex/texplate/util/PathUtils.java b/support/texplate/source/main/java/org/islandoftex/texplate/util/PathUtils.java
index 26e101b9ad..fa242c4980 100644
--- a/support/texplate/source/main/java/org/islandoftex/texplate/util/PathUtils.java
+++ b/support/texplate/source/main/java/org/islandoftex/texplate/util/PathUtils.java
@@ -2,11 +2,12 @@
package org.islandoftex.texplate.util;
import io.vavr.control.Try;
+import org.islandoftex.texplate.Main;
+
import java.io.FileNotFoundException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
-import org.islandoftex.texplate.Main;
/**
* Helper methods for path handling.
@@ -62,7 +63,6 @@ public class PathUtils {
*/
private static Path searchTemplatePath(String name)
throws FileNotFoundException {
-
// the file has to be a TOML format,
// so we add the extension
name = name.concat(".toml");
@@ -75,13 +75,11 @@ public class PathUtils {
// if the file actually exists,
// the search is done!
if (Files.exists(reference)) {
-
// return the template
// file reference
return reference;
} else {
-
// the reference was not found in the
// user location, so let us try the
// system counterpart
@@ -90,22 +88,30 @@ public class PathUtils {
// if the file actually exists,
// the search is done!
if (Files.exists(reference)) {
-
// return the template
// file reference
return reference;
} else {
-
- // the file reference could not be
- // found, so an exception is thrown
- throw new FileNotFoundException("I am sorry, but the template "
- + "file '" + name + "' could not be found in the "
- + "default template locations (system and user). Make "
- + "sure the reference is correct and try again. For "
- + "reference, these are the paths I searched: '"
- + getUserTemplatePath() + "' and '"
- + getDefaultTemplatePath() + "' (in this order).");
+ // in the system path, look for an `texplate` prefixed
+ // version as well
+ reference = getDefaultTemplatePath().resolve("texplate-" + name);
+
+ if (Files.exists(reference)) {
+ // return the template
+ // file reference
+ return reference;
+ } else {
+ // the file reference could not be
+ // found, so an exception is thrown
+ throw new FileNotFoundException("I am sorry, but the template "
+ + "file '" + name + "' could not be found in the "
+ + "default template locations (system and user). Make "
+ + "sure the reference is correct and try again. For "
+ + "reference, these are the paths I searched: '"
+ + getUserTemplatePath() + "' and '"
+ + getDefaultTemplatePath() + "' (in this order).");
+ }
}
}
}