summaryrefslogtreecommitdiff
path: root/rakelib
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2026-02-15 04:35:24 +0100
committerEugen Wissner <belka@caraus.de>2026-02-15 04:35:24 +0100
commit580bd7e8579f1de36d151249500de6601e43f4a1 (patch)
treee69d02bb786488aaf5cc6ba6671aa449f02223be /rakelib
parent5959fbb5524bbeb05a96eb15aba59e961a3efcb7 (diff)
downloadelna-580bd7e8579f1de36d151249500de6601e43f4a1.tar.gz
Add documentation
Diffstat (limited to 'rakelib')
-rw-r--r--rakelib/doc.rake32
1 files changed, 32 insertions, 0 deletions
diff --git a/rakelib/doc.rake b/rakelib/doc.rake
new file mode 100644
index 0000000..54f5d35
--- /dev/null
+++ b/rakelib/doc.rake
@@ -0,0 +1,32 @@
+# 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 '.bbl' => '.bcf' do |t|
+ task_target = Pathname.new t.name
+ chdir = 'doc'
+ output_directory = task_target.dirname.relative_path_from(chdir).to_path
+ source = task_target.basename('.bbl').to_path
+
+ sh 'biber', '-output-directory', output_directory, source, chdir:
+end
+
+namespace :doc do
+ task :tex do
+ sh 'pdflatex', '-output-directory', '../build/doc', 'report', chdir: 'doc'
+ end
+end
+
+desc 'Generate documentation'
+task doc: 'doc:tex' do
+ Rake::Task['build/doc/report.bbl'].invoke
+ Rake::Task['doc:tex'].reenable
+ Rake::Task['doc:tex'].invoke
+end