diff --git a/.gitignore b/.gitignore index bc9d08b..62ccd0b 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,5 @@ Test* !Content.html Content.jira -.envrc \ No newline at end of file +.envrc +node_modules diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 5ab02cd..6c6fcdc 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -6,6 +6,8 @@ "davidanson.vscode-markdownlint", "notZaki.pandocciter", "naco-siren.gradle-language", - "richardwillis.vscode-gradle" + "richardwillis.vscode-gradle", + "koihik.vscode-lua-format", + "mathiasfrohlich.kotlin", ] } \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index eeea2cd..e3f9641 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,18 +1,15 @@ { "editor.formatOnPaste": true, "editor.formatOnType": true, - "search.exclude": { - "**/node_modules": true, - }, + "editor.tabSize": 4, "files.autoGuessEncoding": false, "files.encoding": "utf8", "files.exclude": { + "**/.DS_Store": true, "**/.git": true, - "**/.svn": true, "**/.hg": true, - "**/CVS": true, - "**/node_modules": true, - "**/.DS_Store": true, + "**/.svn": true, + "**/CVS": true }, "files.trimTrailingWhitespace": false, "latex-workshop.latex.autoBuild.run": "never", @@ -28,31 +25,39 @@ { "args": [ "-r", - "../.latexmkrc", + "../tools/.latexmkrc", "-xelatex", "-cd-", "%DOC%" ], "command": "latexmk", + "cwd": "", "env": {}, - "cwd":"", "name": "latexmk" } ], + "PandocCiter.DefaultBib": "literature/bibliography.bib", + "prettier.configPath": "tools/.prettierrc", "python.formatting.provider": "yapf", + "python.formatting.yapfArgs": [ + "--style", + "tools/.style.yapf" + ], "python.linting.enabled": true, "python.linting.flake8Enabled": false, "python.linting.pycodestyleEnabled": false, "python.linting.pylamaEnabled": true, "python.linting.pylintEnabled": false, - "editor.tabSize": 4, - "spellright.language": [ - "de" - ], + "search.exclude": { + "**/node_modules": true + }, "spellright.documentTypes": [ "latex", "plaintext", "markdown" ], - "PandocCiter.DefaultBib": "literature/bibliography.bib", -} + "spellright.language": [ + "de" + ], + "vscode-lua-format.configPath": "tools/.lua-format" +} \ No newline at end of file diff --git a/.yarnrc b/.yarnrc deleted file mode 100644 index 452cf70..0000000 --- a/.yarnrc +++ /dev/null @@ -1 +0,0 @@ ---modules-folder build/node_modules \ No newline at end of file diff --git a/Content.pdf b/Content.pdf index 1d14dc3..db68660 100644 Binary files a/Content.pdf and b/Content.pdf differ diff --git a/Readme.md b/Readme.md index 9f26345..21e1943 100644 --- a/Readme.md +++ b/Readme.md @@ -77,6 +77,15 @@ brew install java You should not need to install Gradle, since everything is setup by the checked-in `gradlew` Gradle wrapper. +### Yarn + +You should not need to install ``yarn`` since everything is handled by the dependent Gradle task `installFrontend`. If you experience problems with having the node modules not correctly setup, use + +``` +cd tools +../build/yarn/bin/yarn install --modules-path build/node_modules +``` + ### Pandoc Install [pandoc](https://pandoc.org/installing.html) (>= 2.9.2.1, tested with 2.11.0.4) @@ -84,19 +93,13 @@ Install [pandoc](https://pandoc.org/installing.html) (>= 2.9.2.1, tested with 2. For **Linux** and **macOs**: ```shell -export HOMEBREW_NO_INSTALL_CLEANUP=1 -cd Homebrew/Library/Taps/homebrew/homebrew-core && - git checkout 36b6c2d8cd71580a4fd3055375f87a8c52cd5846~20 && # installs 2.9.2.1 - HOMEBREW_NO_AUTO_UPDATE=1 brew install pandoc pandoc-citeproc pandoc-crossref && - brew install pandoc pandoc-citeproc pandoc-crossref # installs 2.10.1 +brew install pandoc pandoc-crossref ``` For **Windows**: ```shell choco install pandoc -git clone https://github.com/gabyx/chocolatey-packages.git@patch-1 temp -cd temp && choco install ./pandoc-crossref/pandoc-crossref.nuspec ``` ### Python @@ -104,7 +107,7 @@ cd temp && choco install ./pandoc-crossref/pandoc-crossref.nuspec Install a recent `python3` (>= 3.6) and the following packages: ```shell -pip3 install -r .requirements +pip3 install -r tools/.requirements ``` The best way is to setup a python environment `python venv` since `pandoc`. The VS Code config `python.pythonPath` path needs to be set. diff --git a/build.gradle.kts b/build.gradle.kts index 690adb9..d3ef20f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,7 +8,6 @@ plugins { @Suppress("unchecked_cast", "nothing_to_inline") inline fun uncheckedCast(target: Any?): T = target as T - apply(plugin = "java") apply(from = "gradle/runCommand.gradle.kts") val checkCmd = project.extensions.getByName("checkCommand") @@ -22,6 +21,8 @@ frontend { nodeInstallDirectory.set(file("${project.buildDir}/node")) yarnEnabled.set(true) yarnVersion.set("1.22.10") + packageJsonDirectory.set(file("${project.rootDir}/tools")) + installScript.set("install --modules-folder='${project.buildDir}/node_modules'") yarnInstallDirectory.set(file("${project.buildDir}/yarn")) } diff --git a/build/.gitignore b/build/.gitignore index f095f60..7b57367 100644 --- a/build/.gitignore +++ b/build/.gitignore @@ -1,4 +1,5 @@ * !.gitignore +!build.gradle.kts !output-tex !output-tex/input.tex \ No newline at end of file diff --git a/build/output-tex/input.tex b/build/output-tex/input.tex index fb19ab4..1278f7d 100644 --- a/build/output-tex/input.tex +++ b/build/output-tex/input.tex @@ -840,11 +840,27 @@ \subsection{HTML Table}\label{html-table}} >{\raggedright\arraybackslash}p{(\columnwidth - 6\tabcolsep) * \real{0.30}}@{}} \caption{Table by included \texttt{.html} file.}\tabularnewline \toprule -Fruits & Vegetables & Constraints & Properties \\ +\begin{minipage}[b]{\linewidth}\raggedright +Fruits +\end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright +Vegetables +\end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright +Constraints +\end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright +Properties +\end{minipage} \\ \midrule \endfirsthead \toprule -Fruits & Vegetables & Constraints & Properties \\ +\begin{minipage}[b]{\linewidth}\raggedright +Fruits +\end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright +Vegetables +\end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright +Constraints +\end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright +Properties +\end{minipage} \\ \midrule \endhead \textbf{First} & \begin{minipage}[t]{\linewidth}\raggedright @@ -913,11 +929,27 @@ \subsection{\texorpdfstring{\LaTeX~Table}{~Table}}\label{table}} >{\raggedright\arraybackslash}p{(\columnwidth - 6\tabcolsep) * \real{0.30}}@{}} \caption{Table by included \texttt{.html} file.}\tabularnewline \toprule -Fruits & Vegetables & Constraints & Properties \\ +\begin{minipage}[b]{\linewidth}\raggedright +Fruits +\end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright +Vegetables +\end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright +Constraints +\end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright +Properties +\end{minipage} \\ \midrule \endfirsthead \toprule -Fruits & Vegetables & Constraints & Properties \\ +\begin{minipage}[b]{\linewidth}\raggedright +Fruits +\end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright +Vegetables +\end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright +Constraints +\end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright +Properties +\end{minipage} \\ \midrule \endhead \textbf{First} & \begin{minipage}[t]{\linewidth}\raggedright @@ -995,11 +1027,23 @@ \subsection{Markdown Table}\label{sec:multi-line-table}} >{\raggedright\arraybackslash}p{(\columnwidth - 4\tabcolsep) * \real{0.26}}@{}} \caption{Sample grid table.}\tabularnewline \toprule -Fruit & Price & Advantages \\ +\begin{minipage}[b]{\linewidth}\raggedright +Fruit +\end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright +Price +\end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright +Advantages +\end{minipage} \\ \midrule \endfirsthead \toprule -Fruit & Price & Advantages \\ +\begin{minipage}[b]{\linewidth}\raggedright +Fruit +\end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright +Price +\end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright +Advantages +\end{minipage} \\ \midrule \endhead Bananas & \$1.34 & \begin{minipage}[t]{\linewidth}\raggedright diff --git a/chapters/tables-tex/TableExample.tex b/chapters/tables-tex/TableExample.tex index acdd7f6..6cca63c 100644 --- a/chapters/tables-tex/TableExample.tex +++ b/chapters/tables-tex/TableExample.tex @@ -5,11 +5,27 @@ >{\raggedright\arraybackslash}p{(\columnwidth - 6\tabcolsep) * \real{0.30}}@{}} \caption{Table by included \texttt{.html} file.}\tabularnewline \toprule -Fruits & Vegetables & Constraints & Properties \\ +\begin{minipage}[b]{\linewidth}\raggedright +Fruits +\end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright +Vegetables +\end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright +Constraints +\end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright +Properties +\end{minipage} \\ \midrule \endfirsthead \toprule -Fruits & Vegetables & Constraints & Properties \\ +\begin{minipage}[b]{\linewidth}\raggedright +Fruits +\end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright +Vegetables +\end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright +Constraints +\end{minipage} & \begin{minipage}[b]{\linewidth}\raggedright +Properties +\end{minipage} \\ \midrule \endhead \textbf{First} & \begin{minipage}[t]{\linewidth}\raggedright diff --git a/convert/pandoc/defaults/pandoc-latex.yaml b/convert/pandoc/defaults/pandoc-latex.yaml index d49d73e..2f4e977 100644 --- a/convert/pandoc/defaults/pandoc-latex.yaml +++ b/convert/pandoc/defaults/pandoc-latex.yaml @@ -39,7 +39,7 @@ pdf-engine: latexmk pdf-engine-opt: - "-xelatex" - "-r" - - ".latexmkrc" + - "tools/.latexmkrc" - "-gg" - "-outdir=build/output-tex" diff --git a/settings.gradle.kts b/settings.gradle.kts index 5638557..5d2d1b4 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1 +1 @@ -rootProject.name = "TechnicalMarkdown" \ No newline at end of file +rootProject.name = "TechnicalMarkdown" diff --git a/.latexmkrc b/tools/.latexmkrc similarity index 100% rename from .latexmkrc rename to tools/.latexmkrc diff --git a/.lua-format b/tools/.lua-format similarity index 100% rename from .lua-format rename to tools/.lua-format diff --git a/.prettierrc b/tools/.prettierrc similarity index 100% rename from .prettierrc rename to tools/.prettierrc diff --git a/.requirements b/tools/.requirements similarity index 100% rename from .requirements rename to tools/.requirements diff --git a/.style.yapf b/tools/.style.yapf similarity index 100% rename from .style.yapf rename to tools/.style.yapf diff --git a/package.json b/tools/package.json similarity index 100% rename from package.json rename to tools/package.json diff --git a/yarn.lock b/tools/yarn.lock similarity index 100% rename from yarn.lock rename to tools/yarn.lock