Compositor
Compositor copied to clipboard
Extensible package documentation
In the first iteration of code completion, there will be two categories of commands:
- Built-in commands (i.e., commands provided by LaTeX2e). These will have detailed manual documentation taken from the unofficial LaTeX2e manual showing in the code completions window.
- All other commands (i.e., commands provided by currently installed packages). These will have different levels of documentation information showing in the code completions window:
- Commands declared with one of
\newcommand
,\renewcommand
,\providecommand
, or\DeclareRobustCommand
will have basic documentation about the number of arguments, and the default value of an optional argument. - Commands declared in any way (which isn't uncommon, see e.g., the
\url
command ofurl.sty
) will not have any information about the number or structure of arguments.
- Commands declared with one of
To provide better code completion documentation for non built-in commands, an extensible package documentation mechanism would be nice. In the simplest case, a set of json files that can be discovered by a documentation scanner.
As an example, here's the documentation of a built-in LaTeX2e command (\section
) (this is Swift code, not json):
// \section[toc-title]{title}
CommandDescriptor(filename: "latex.ltx",
cmd: "\\section",
shortHelp: "Start a section. Can be used in the standard document classes article, book, and report.",
helpUrl: "https://latex2e.org/_005csection.html",
allowedIn: .documentBody,
numberOfArguments: 2,
arguments: [
CommandArgumentDescriptor(name: "short title",
optionality: .optional,
shortHelp: "The optional shorter title will appear as the section title in the table of contents and in running headers."),
CommandArgumentDescriptor(name: "title",
optionality: .required,
shortHelp: "The section title.")