Initial commit: Klammertext source distribution
Curated source subset assembled by klammertext-dev's doc/make_dist.sh: the Klammermachine (mac), the Standard Klammer Set (sks), the commands (com), editor plugins and install guides (doc), a test subset (tst), and lib/bin placeholders. Builds with 'make -C com'. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
23
sks/document/document.py
Normal file
23
sks/document/document.py
Normal file
@@ -0,0 +1,23 @@
|
||||
import kutil
|
||||
import html_util
|
||||
import tex_util
|
||||
|
||||
class Document(klammer_base.Klammer_base):
|
||||
def __init__(self, K):
|
||||
super().__init__(K)
|
||||
|
||||
def html(self):
|
||||
if self.include_css == "true":
|
||||
css_code, css_files = html_util.css(self.css, self._sks_enabled)
|
||||
head = html_util.head(self.title, css_files=css_files, css_code=css_code)
|
||||
else:
|
||||
head = head = html_util.head(self.title, include_fonts=self.include_fonts == "true")
|
||||
return html_util.page(head, self.body)
|
||||
|
||||
def tex(self):
|
||||
ragged_right = self.ragged_right in {"true", "True", "1"}
|
||||
return tex_util.page(
|
||||
self.title, self.subtitle, self.leading, self.pointsize, ragged_right, self.body)
|
||||
|
||||
def txt(self):
|
||||
return self.body
|
||||
Reference in New Issue
Block a user