summaryrefslogtreecommitdiff
path: root/rakelib
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2026-02-10 00:13:05 +0100
committerEugen Wissner <belka@caraus.de>2026-02-10 00:13:05 +0100
commit2061fece3dc46f745cc983935ae930ce84092dfa (patch)
treee759b5cbe8f091433a77953f90627d965852a433 /rakelib
parente9bcd234e5256be30774369f13c07b38a5e97a82 (diff)
downloadelna-2061fece3dc46f745cc983935ae930ce84092dfa.tar.gz
Migrate documentation to LaTeX
Diffstat (limited to 'rakelib')
-rw-r--r--rakelib/doc.rake23
-rw-r--r--rakelib/ninja.rake1
2 files changed, 24 insertions, 0 deletions
diff --git a/rakelib/doc.rake b/rakelib/doc.rake
new file mode 100644
index 0000000..d719c80
--- /dev/null
+++ b/rakelib/doc.rake
@@ -0,0 +1,23 @@
+# This Source Code Form is subject to the terms of the Mozilla Public License,
+# v. 2.0. If a copy of the MPL was not distributed with this file, You can
+# obtain one at https://mozilla.org/MPL/2.0/.
+# frozen_string_literal: true
+
+require 'pathname'
+require 'rake/clean'
+
+CLEAN.include 'build/doc'
+
+directory 'build/doc'
+
+rule /build\/doc\/\w+.pdf/ => lambda { |t|
+ [
+ Pathname.new(t).relative_path_from('build').sub_ext('.tex').to_path,
+ 'build/doc'
+ ]
+} do |t|
+ sh 'pdflatex', '--output-directory', 'build/doc', t.prerequisites.first
+end
+
+desc 'Generate documentation'
+task doc: 'build/doc/language.pdf'
diff --git a/rakelib/ninja.rake b/rakelib/ninja.rake
index 702f9b5..de213ef 100644
--- a/rakelib/ninja.rake
+++ b/rakelib/ninja.rake
@@ -3,6 +3,7 @@
# obtain one at https://mozilla.org/MPL/2.0/.
# frozen_string_literal: true
+require 'pathname'
require 'rake/clean'
CLEAN.include 'build/boot', 'build/valid'