Section headings under txt are numbered inside a @document only; @typeface gains :middle and :lift and its :scale now means the same in html and pdf; NewGardinerOmni ships (OFL 1.1, Mark-Jan Nederhof) and @egyptian / @chinese replace @cjk; @table :leading and :colsep reach html; kdesc --typeface help names the flag; @document.txt is a Python class. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
34 lines
1.1 KiB
Python
34 lines
1.1 KiB
Python
import kutil
|
|
import klammer_base
|
|
import phases
|
|
|
|
class Document(klammer_base.Klammer_base):
|
|
def __init__(self, K):
|
|
super().__init__(K)
|
|
if self.files:
|
|
raise Exception("The :files option is not defined for the 'txt' target")
|
|
|
|
def html(self):
|
|
raise Exception("Implemented by document.cpp")
|
|
|
|
def tex(self):
|
|
raise Exception("Implemented by document.cpp")
|
|
|
|
def txt(self):
|
|
# The document marker: section numbering under txt is a document
|
|
# service, and the numbering phase numbers only when it finds this
|
|
# at the head of the text (a fragment, as kdesc renders, has none).
|
|
result = phases.txt_document_marker() + "\n"
|
|
if self.title:
|
|
result += f"@b {self.title} @ @nl@\n"
|
|
if self.subtitle:
|
|
result += f"@b {self.subtitle} @ @nl@\n"
|
|
result += "\n"
|
|
if self.author:
|
|
result += f"@i {self.author} @ @nl@\n"
|
|
if self.date:
|
|
result += f"@i {self.date} @ @nl@\n"
|
|
result += "\n"
|
|
result += self.text
|
|
return result
|