KScript ドキュメント
JA

言語

英語から自動翻訳されています。原文は英語です。

ドキュメント: KScript.Document

構造

<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')"
  }
}
要素 概要
Author(affiliation, email) 作成者です。テキストは名前になります。または文書にauthor: "Ada Lovelace; Alan Turing"を指定してください。
Abstract タイトルの下の概要です。
Section(title, id, numbered, new_page) セクションです。セクションの中にあるセクションはサブセクションとなり、六階層まで使えます。七階層目はエラーになります。
Paragraph(id, align, lines) 段落です。
List(style, start) と Item リスト: bullet、number、letter、またはroman。Itemの直後にあるListは、その中にネストされます。
Quote(by) ブロック引用です。
Code(language) 書かれたとおりに保持される、等幅フォントのコードです。
Contents(title, depth) PDF内のページ番号を付けた目次です。
Markdown(path) テキストまたはファイルからMarkdownを変換します: 詳しくは以下をご覧ください。
Latex(path, value) テキスト、latex の値、または .tex ファイルからの LaTeX:以下を参照してください。
PageBreak, VSpace(height), Rule 新しいページ、VSpace(height: '1cm')のような隙間、そしてページを横切る線。