Build documentation

This commit is contained in:
2025-11-25 16:20:48 +01:00
parent c20d9b7240
commit b5b129a90c
6 changed files with 100 additions and 1 deletions

4
.gitignore vendored
View File

@@ -1,3 +1,5 @@
/build/ /build/
a.out
/vendor/ /vendor/
/doc/*.html
/doc/*.pdf

8
Gemfile Normal file
View File

@@ -0,0 +1,8 @@
# frozen_string_literal: true
source 'https://rubygems.org'
gem 'asciidoctor', '~> 2.0'
gem 'asciidoctor-pdf', '~> 2.3'
gem "rake", "~> 13.3"

66
Gemfile.lock Normal file
View File

@@ -0,0 +1,66 @@
GEM
remote: https://rubygems.org/
specs:
Ascii85 (2.0.1)
addressable (2.8.8)
public_suffix (>= 2.0.2, < 8.0)
afm (1.0.0)
asciidoctor (2.0.26)
asciidoctor-pdf (2.3.24)
asciidoctor (~> 2.0)
concurrent-ruby (~> 1.3)
matrix (~> 0.4)
prawn (~> 2.4.0)
prawn-icon (~> 3.0.0)
prawn-svg (~> 0.34.0)
prawn-table (~> 0.2.0)
prawn-templates (~> 0.1.0)
treetop (~> 1.6.0)
ttfunk (~> 1.7.0)
concurrent-ruby (1.3.5)
css_parser (1.21.1)
addressable
hashery (2.1.2)
matrix (0.4.3)
pdf-core (0.9.0)
pdf-reader (2.15.0)
Ascii85 (>= 1.0, < 3.0, != 2.0.0)
afm (>= 0.2.1, < 2)
hashery (~> 2.0)
ruby-rc4
ttfunk
polyglot (0.3.5)
prawn (2.4.0)
pdf-core (~> 0.9.0)
ttfunk (~> 1.7)
prawn-icon (3.0.0)
prawn (>= 1.1.0, < 3.0.0)
prawn-svg (0.34.2)
css_parser (~> 1.6)
matrix (~> 0.4.2)
prawn (>= 0.11.1, < 3)
rexml (~> 3.2)
prawn-table (0.2.2)
prawn (>= 1.3.0, < 3.0.0)
prawn-templates (0.1.2)
pdf-reader (~> 2.0)
prawn (~> 2.2)
public_suffix (7.0.0)
rake (13.3.1)
rexml (3.4.4)
ruby-rc4 (0.1.5)
treetop (1.6.18)
polyglot (~> 0.3)
ttfunk (1.7.0)
PLATFORMS
ruby
x86_64-linux
DEPENDENCIES
asciidoctor (~> 2.0)
asciidoctor-pdf (~> 2.3)
rake (~> 13.3)
BUNDLED WITH
2.6.9

View File

@@ -9,3 +9,7 @@ representation for a such high-level hypothetical programming language.
## File extension ## File extension
.elna .elna
## Supported architectures
- RISC-V 32 bit.

View File

@@ -6,6 +6,7 @@
require 'open3' require 'open3'
require 'pathname' require 'pathname'
require 'rake/clean' require 'rake/clean'
require 'asciidoctor-pdf'
STAGES = Dir.glob('boot/stage*') STAGES = Dir.glob('boot/stage*')
.collect { |stage| File.basename stage } .collect { |stage| File.basename stage }
@@ -13,6 +14,7 @@ STAGES = Dir.glob('boot/stage*')
.drop(1) # First assembly stage does not count. .drop(1) # First assembly stage does not count.
CLEAN.include 'build/boot', 'build/valid' CLEAN.include 'build/boot', 'build/valid'
CLEAN.include 'doc/*.pdf'
def compile(*arguments) def compile(*arguments)
sh(ENV.fetch('CC', 'gcc'), '-fpie', '-g', *arguments) sh(ENV.fetch('CC', 'gcc'), '-fpie', '-g', *arguments)
@@ -126,3 +128,10 @@ file 'build/boot/stage1/cl' => ['build/boot/stage1', 'boot/stage1.s'] do |t|
compile('-nostdlib', '-o', t.name, *source) compile('-nostdlib', '-o', t.name, *source)
end end
rule '.pdf' => '.adoc' do |t|
Asciidoctor.convert_file t.source, backend: 'pdf', safe: :safe
end
desc 'Generate documentation'
task doc: 'doc/language.pdf'

10
doc/language.adoc Normal file
View File

@@ -0,0 +1,10 @@
= The programming language Elna
:toc:
== Introduction
Elna is a simple, imperative, low-level programming language.
It is intendet to accompany other languages in the areas, where a high-level
language doesn't fit well. It is also supposed to be an intermediate
representation for a such high-level hypothetical programming language.