Template Outline Configuration ExampleΒΆ

{
    "$schema": "http://json-schema.org/draft-04/schema",
    "$id": "latex-tplx",
    "description": "define segments to insert into the the template jinja template of id latex-tplx",
    "outline": [
        "((*- extends 'display_priority.tplx' -*))",
        "",
        "%% Latex Document Setup",
        "%% ====================",
        "",
        "((* block header *))",
        "% A latex document created by ipypublish {ipypub_version}",
        "((( '{meta_docstring}' | comment_lines('% ') )))",
        "%",
        "",
        "  ((*- block docclass *))",
        "%%%%%%%%%%%% DOCCLASS",
        "    {document_docclass}",
        "%%%%%%%%%%%%",
        "  ((* endblock docclass -*))",
        "",
        "  ((*- block packages *))",
        "%%%%%%%%%%%% PACKAGES",
        "    {document_packages}",
        "%%%%%%%%%%%%",
        "  ((* endblock packages *))",
        "",
        "  ((*- block definitions *))",
        "      ((* block date *))((* endblock date *))",
        "      ((* block author *))((* endblock author *))",
        "    ((* block title *))((* endblock title *))",
        "",
        "%%%%%%%%%%%% DEFINITIONS",
        "    {document_definitions}",
        "%%%%%%%%%%%%",
        "",
        "  ((* endblock definitions *))",
        "",
        "  ((*- block commands *))",
        "    ((* block margins *))",
        "%%%%%%%%%%%% MARGINS",
        "      {document_margins}",
        "%%%%%%%%%%%%",
        "    ((* endblock margins *))",
        "%%%%%%%%%%%% COMMANDS",
        "    {document_commands}",
        "%%%%%%%%%%%%",
        "  ((* endblock commands *))",
        "",
        "%%%%%%%%%%%% FINAL HEADER MATERIAL",
        "    {document_header_end}",
        "%%%%%%%%%%%%",
        "",
        "((* endblock header *))",
        "",
        "((* block body *))",
        "",
        "\\begin{{document}}",
        "",
        "  ((* block predoc *))",
        "    ((* block maketitle *))",
        "      {document_title}",
        "    ((* endblock maketitle *))",
        "    ((* block abstract *))",
        "      {document_abstract}",
        "    ((* endblock abstract *))",
        "    {document_predoc}",
        "  ((* endblock predoc *))",
        "",
        "  ((( super() )))",
        "",
        "  ((* block postdoc *))",
        "      ((* block bibliography *))",
        "      {document_bibliography}",
        "    ((* endblock bibliography *))",
        "    {document_postdoc}",
        "    ((* endblock postdoc *))",
        "",
        "\\end{{document}}",
        "",
        "((* endblock body *))",
        "",
        "%% Notebook Input",
        "%% ==============",
        "",
        "((*- block any_cell scoped *))",
        "  {notebook_input}",
        "((* endblock any_cell *))",
        "",
        "((* block input scoped *))",
        "  {notebook_input_code}",
        "((* endblock input *))",
        "",
        "((* block rawcell scoped *))",
        "  {notebook_input_raw}",
        "((* endblock rawcell *))",
        "",
        "((* block markdowncell scoped *))",
        "  {notebook_input_markdown}",
        "((* endblock markdowncell *))",
        "",
        "((* block unknowncell scoped *))",
        "  {notebook_input_unknown}",
        "((* endblock unknowncell *))",
        "",
        "%% Notebook Output",
        "%% ================",
        "",
        "% Redirect execute_result to display data priority.",
        "((*- block execute_result scoped *))",
        "    ((* block data_priority scoped *))",
        "    {notebook_output}",
        "    ((* endblock *))",
        "((* endblock execute_result *))",
        "",
        "((* block data_text *))",
        "  {notebook_output_text}",
        "((* endblock data_text *))",
        "",
        "((* block error *))",
        "  {notebook_output_error}",
        "((* endblock error *))",
        "",
        "((* block traceback_line *))",
        "    {notebook_output_traceback}",
        "((* endblock traceback_line *))",
        "",
        "((* block stream *))",
        "    {notebook_output_stream}",
        "((* endblock stream *))",
        "",
        "((* block data_latex -*))",
        "  {notebook_output_latex}",
        "((* endblock data_latex *))",
        "",
        "((*- block data_markdown -*))",
        "  {notebook_output_markdown}",
        "((* endblock data_markdown *))",
        "",
        "((*- block data_png -*))",
        "  {notebook_output_png}",
        "((*- endblock data_png -*))",
        "",
        "((*- block data_jpg -*))",
        "  {notebook_output_jpg}",
        "((*- endblock data_jpg -*))",
        "",
        "((*- block data_svg -*))",
        "  {notebook_output_svg}",
        "((*- endblock data_svg -*))",
        "",
        "((*- block data_pdf -*))",
        "  {notebook_output_pdf}",
        "((*- endblock -*))",
        "",
        "",
        "%% Jinja Macros",
        "%% ================",
        "",
        "{jinja_macros}"
    ],
    "type": "object",
    "additionalProperties": false,
    "definitions": {
        "append_after": {
            "description": "a segment of the template, each line should be a separate item",
            "type": "array",
            "items": {
                "type": "string"
            }
        }
    },
    "required": [
        "description",
        "identifier",
        "template",
        "segments"
    ],
    "properties": {
        "$schema": {
            "type": "string"
        },
        "identifier": {
            "description": "the identification of the segments",
            "type": "string"
        },
        "description": {
            "description": "the purpose of this group of segments",
            "type": "string"
        },
        "template": {
            "description": "the template identifier",
            "enum": ["latex-tplx"]
        },
        "segments": {
            "additionalProperties": false,
            "description": "the segments to insert",
            "properties": {
                "document_docclass": {
                    "$ref": "#/definitions/append_after"
                },
                "document_packages": {
                    "$ref": "#/definitions/append_after"
                },
                "document_definitions": {
                    "$ref": "#/definitions/append_after"
                },
                "document_margins": {
                    "$ref": "#/definitions/append_after"
                },
                "document_commands": {
                    "$ref": "#/definitions/append_after"
                },
                "document_header_end": {
                    "$ref": "#/definitions/append_after"
                },
                "document_title": {
                    "$ref": "#/definitions/append_after"
                },
                "document_abstract": {
                    "$ref": "#/definitions/append_after"
                },
                "document_predoc": {
                    "$ref": "#/definitions/append_after"
                },
                "document_bibliography": {
                    "$ref": "#/definitions/append_after"
                },
                "document_postdoc": {
                    "$ref": "#/definitions/append_after"
                },
                "notebook_input": {
                    "$ref": "#/definitions/append_after"
                },
                "notebook_input_code": {
                    "$ref": "#/definitions/append_after"
                },
                "notebook_input_raw": {
                    "$ref": "#/definitions/append_after"
                },
                "notebook_input_markdown": {
                    "$ref": "#/definitions/append_after"
                },
                "notebook_input_unknown": {
                    "$ref": "#/definitions/append_after"
                },
                "notebook_output": {
                    "$ref": "#/definitions/append_after"
                },
                "notebook_output_text": {
                    "$ref": "#/definitions/append_after"
                },
                "notebook_output_error": {
                    "$ref": "#/definitions/append_after"
                },
                "notebook_output_traceback": {
                    "$ref": "#/definitions/append_after"
                },
                "notebook_output_stream": {
                    "$ref": "#/definitions/append_after"
                },
                "notebook_output_latex": {
                    "$ref": "#/definitions/append_after"
                },
                "notebook_output_markdown": {
                    "$ref": "#/definitions/append_after"
                },
                "notebook_output_png": {
                    "$ref": "#/definitions/append_after"
                },
                "notebook_output_jpg": {
                    "$ref": "#/definitions/append_after"
                },
                "notebook_output_svg": {
                    "$ref": "#/definitions/append_after"
                },
                "notebook_output_pdf": {
                    "$ref": "#/definitions/append_after"
                },
                "jinja_macros": {
                    "$ref": "#/definitions/append_after"
                }
            }
        },
        "overwrite": {
            "description": "a list of segment keys that may overwrite previously defined entries",
            "type": "array",
            "items": {
                "enum": [
                    "meta_docstring",
                    "document_docclass",
                    "document_packages",
                    "document_definitions",
                    "document_margins",
                    "document_commands",
                    "document_header_end",
                    "document_title",
                    "document_abstract",
                    "document_predoc",
                    "document_bibliography",
                    "document_postdoc",
                    "notebook_input",
                    "notebook_input_code",
                    "notebook_input_raw",
                    "notebook_input_markdown",
                    "notebook_input_unknown",
                    "notebook_output",
                    "notebook_output_text",
                    "notebook_output_error",
                    "notebook_output_traceback",
                    "notebook_output_stream",
                    "notebook_output_latex",
                    "notebook_output_markdown",
                    "notebook_output_png",
                    "notebook_output_jpg",
                    "notebook_output_svg",
                    "notebook_output_pdf",
                    "jinja_macros"
                ]
            }
        }
    }
}