KScript Dokumentation
DE

Sprache

Automatisch aus dem Englischen übersetzt; das englische Original ist maßgeblich.

Dokumente: KScript.Document

Struktur

<KScript.Document template="report" title="Annual Report" author="The team" to="'report.pdf'">
  <Contents />

  <Section title="Summary" id="summary">
    <Paragraph>Visits rose every quarter.</Paragraph>

    <Section title="Details">
      <List style="number">
        <Item>First point.</Item>
        <Item>Second point.</Item>
        <List>
          <Item>A point under the second.</Item>
        </List>
      </List>
    </Section>
  </Section>

  <Section title="Appendix" numbered="false" new_page="true">
    <Quote by="John Conway">I'm not a mathematician who's interested in applications.</Quote>
    <Code language="python">print('hello')</Code>
  </Section>
</KScript.Document>
import KScript.Document

Document(template: report, title: 'Annual Report', author: 'The team', to: 'report.pdf') {
  Contents

  Section(title: 'Summary', id: 'summary') {
    Paragraph "Visits rose every quarter."

    Section(title: 'Details') {
      List(style: number) {
        Item "First point."
        Item "Second point."
        List {
          Item "A point under the second."
        }
      }
    }
  }

  Section(title: 'Appendix', numbered: false, new_page: true) {
    Quote(by: 'John Conway') "I'm not a mathematician who's interested in applications."
    Code(language: 'python') "print('hello')"
  }
}
Element Was es ist
Author(affiliation, email) Ein Autor. Sein Text ist der Name. Oder gib author: "Ada Lovelace; Alan Turing" am Dokument an.
Abstract Die Zusammenfassung unter dem Titel.
Section(title, id, numbered, new_page) Ein Abschnitt. Ein Abschnitt innerhalb eines Abschnitts ist ein Unterabschnitt, bis zu sechs Ebenen; eine siebte ist ein Fehler.
Paragraph(id, align, lines) Ein Absatz.
List(style, start) und Item Eine Liste: bullet, number, letter oder roman. Ein List direkt nach einem Item ist darin verschachtelt.
Quote(by) Ein Blockzitat.
Code(language) Code, in einer nichtproportionalen Schrift, genau so belassen, wie geschrieben.
Contents(title, depth) Ein Inhaltsverzeichnis, mit Seitenzahlen im PDF.
Markdown(path) Markdown aus seinem Text oder einer Datei: siehe unten.
Latex(path, value) LaTeX aus seinem Text, einem latex-Wert oder einer .tex-Datei: siehe unten.
PageBreak, VSpace(height), Rule Eine neue Seite, ein Abstand wie VSpace(height: '1cm') und eine Linie quer über die Seite.

Edit this page on GitHub