krz/orgstar

A native macOS editor for org-mode files. editor org-mode swift

Sources/OrgCore/Completion/CompletionData.swift

16086b4cf2caff5328774b2cd5ae3ffe1ab65ca4
orgstar/Sources/OrgCore/Completion/CompletionData.swift history · blame · raw

74 lines · 5722 bytes

 1// From Org 9.8.7 with the default export back-ends (ascii, html, icalendar, latex, odt).
 2
 3extension OrgCompletion {
 4    /// `org-options-keywords`, affiliated keywords, `org-block-keywords` and the back-ends'
 5    /// keywords, as `pcomplete/org-mode/file-option` offers them.
 6    static let fileOptions: [String] = {
 7        let options = ["ARCHIVE:", "AUTHOR:", "BIBLIOGRAPHY:", "BIND:", "CATEGORY:", "CITE_EXPORT:", "COLUMNS:", "CREATOR:", "DATE:", "DESCRIPTION:",
 8                       "DRAWERS:", "EMAIL:", "EXCLUDE_TAGS:", "FILETAGS:", "INCLUDE:", "INDEX:", "KEYWORDS:", "LANGUAGE:", "MACRO:", "OPTIONS:",
 9                       "PROPERTY:", "PRINT_BIBLIOGRAPHY:", "PRIORITIES:", "SELECT_TAGS:", "SEQ_TODO:", "SETUPFILE:", "STARTUP:", "TAGS:", "TITLE:",
10                       "TODO:", "TYP_TODO:", "EXPORT_FILE_NAME:"]
11        let affiliated = ["CAPTION", "DATA", "HEADER", "HEADERS", "LABEL", "NAME", "PLOT", "RESNAME", "RESULT", "RESULTS", "SOURCE", "SRCNAME", "TBLNAME"]
12        let blocks = ["CENTER", "COMMENT", "EXAMPLE", "EXPORT", "QUOTE", "SRC", "VERSE"].flatMap { name in
13            ["ATTR_\(name): ", "BEGIN_\(name)" + (name == "EXPORT" || name == "SRC" ? " " : ""), "END_\(name)"]
14        }
15        let export = ["SUBTITLE", "ATTR_ASCII", "ASCII", "LATEX_HEADER", "CREATOR", "INFOJS_OPT", "HTML_HEAD_EXTRA", "HTML_HEAD",
16                      "HTML_EQUATION_REFERENCE_FORMAT", "HTML_MATHJAX", "HTML_LINK_UP", "HTML_LINK_HOME", "KEYWORDS", "DESCRIPTION",
17                      "HTML_CONTENT_CLASS", "HTML_CONTAINER", "HTML_DOCTYPE", "ATTR_HTML", "HTML", "ICAL-TTL", "ICALENDAR_EXCLUDE_TAGS",
18                      "ATTR_ICALENDAR", "ICALENDAR", "DATE", "LATEX_COMPILER", "LATEX_ENGRAVED_THEME", "LATEX_FOOTNOTE_COMMAND",
19                      "LATEX_CLASS_PRE", "LATEX_HEADER_EXTRA", "LATEX_CLASS_OPTIONS", "LATEX_CLASS", "ATTR_LATEX", "LATEX", "ODT_STYLES_FILE",
20                      "ATTR_ODT", "ODT"]
21        return options.map { $0 + " " } + affiliated.map { $0 + ": " } + blocks + export.map { $0 + ": " }
22    }()
23
24    /// `org-startup-options`.
25    static let startupOptions = [
26        "align", "beamer", "constSI", "constcgs", "content", "customtime", "descriptivelinks", "entitiesplain", "entitiespretty", "fnadjust",
27        "fnanon", "fnauto", "fnconfirm", "fninline", "fnlocal", "fnplain", "fnprompt", "fold", "hideblocks", "hidedrawers", "hidestars", "indent",
28        "inlineimages", "latexpreview", "linkpreviews", "literallinks", "logdone", "logdrawer", "lognoteclock-out", "lognotedone",
29        "lognoteredeadline", "lognoterefile", "lognoterepeat", "lognotereschedule", "logredeadline", "logrefile", "logrepeat", "logreschedule",
30        "logstatesreversed", "noalign", "nofnadjust", "nofninline", "nofold", "nohideblocks", "nohidedrawers", "noindent", "noinlineimages",
31        "nolatexpreview", "nolinkpreviews", "nologdone", "nologdrawer", "nolognoteclock-out", "nologredeadline", "nologrefile", "nologrepeat",
32        "nologreschedule", "nologstatesreversed", "nonum", "noptag", "num", "odd", "oddeven", "overview", "show2levels", "show3levels",
33        "show4levels", "show5levels", "showall", "showeverything", "showstars", "shrink",
34    ]
35
36    /// `#+OPTIONS` items.
37    static let exportOptions = [
38        "H:", "\\n:", "num:", "timestamp:", "arch:", "author:", "c:", "creator:", "date:", "d:", "email:", "*:", "e:", "::", "f:", "inline:",
39        "tex:", "p:", "pri:", "':", "-:", "stat:", "^:", "toc:", "|:", "tags:", "tasks:", "<:", "todo:",
40        "html-self-link-headlines:", "html-scripts:", "html-style:", "html-preamble:", "html-postamble:", "html-link-use-abs-url:",
41        "html5-fancy:", "latex-use-sans:",
42    ]
43
44    /// The languages of `org-babel-load-languages`'s customization type.
45    static let languages = [
46        "awk", "C", "R", "calc", "clojure", "css", "ditaa", "dot", "emacs-lisp", "eshell", "forth", "fortran", "gnuplot", "groovy", "haskell",
47        "java", "js", "julia", "latex", "lilypond", "lisp", "lua", "makefile", "maxima", "ocaml", "octave", "org", "perl", "processing",
48        "plantuml", "python", "ruby", "sass", "scheme", "screen", "sed", "shell", "sql", "sqlite",
49    ]
50
51    /// `org-babel-common-header-args-w-values` and switches.
52    static let srcHeaders = [
53        ":cache", ":cmdline", ":colnames", ":comments", ":dir", ":eval", ":exports", ":epilogue", ":file", ":file-desc", ":file-ext",
54        ":file-mode", ":hlines", ":mkdirp", ":no-expand", ":noeval", ":noweb", ":noweb-ref", ":noweb-sep", ":noweb-prefix", ":output-dir",
55        ":padline", ":post", ":prologue", ":results", ":rownames", ":sep", ":session", ":shebang", ":tangle", ":tangle-mode", ":var", ":wrap",
56        "-n", "-r", "-l",
57    ]
58
59    static let clocktableOptions = [
60        ":maxlevel", ":scope", ":lang", ":tstart", ":tend", ":block", ":step", ":stepskip0", ":fileskip0", ":emphasize", ":link", ":narrow",
61        ":indent", ":hidefiles", ":tcolumns", ":level", ":compact", ":timestamp", ":formula", ":formatter", ":wstart", ":mstart",
62    ]
63
64    /// `org-default-properties`.
65    static let defaultProperties = [
66        "ARCHIVE", "CATEGORY", "SUMMARY", "DESCRIPTION", "CUSTOM_ID", "LOCATION", "LOGGING", "COLUMNS", "VISIBILITY", "TABLE_EXPORT_FORMAT",
67        "TABLE_EXPORT_FILE", "EXPORT_OPTIONS", "EXPORT_TEXT", "EXPORT_FILE_NAME", "EXPORT_TITLE", "EXPORT_AUTHOR", "EXPORT_DATE", "UNNUMBERED",
68        "ORDERED", "NOBLOCKING", "COOKIE_DATA", "LOG_INTO_DRAWER", "REPEAT_TO_STATE", "CLOCK_MODELINE_TOTAL", "STYLE", "HTML_CONTAINER_CLASS",
69        "ORG-IMAGE-ACTUAL-WIDTH",
70    ]
71
72    /// Link types offered after `[[` besides `#+LINK` abbreviations.
73    static let linkTypes = ["attachment", "doi", "file", "http", "https", "id", "mailto"]
74}