feat: support makeinfo customization variables
This commit is contained in:
parent
3f8c23d917
commit
ad685014d2
|
@ -457,6 +457,8 @@ are not validated. (@code{--no-validate})
|
|||
@item @code{texinfo.preview.variables}: Array of variables to define (as with
|
||||
@code{@@set}). If a variable has a value, use the ASCII space character to
|
||||
separate key and value.
|
||||
@item @code{texinfo.preview.customizationVariables}: Array of customization
|
||||
variables. (@code{-c KEY=VALUE})
|
||||
@end itemize
|
||||
|
||||
|
||||
|
|
|
@ -207,6 +207,11 @@
|
|||
"type": "array",
|
||||
"default": [],
|
||||
"description": "Define variables (as with @set)."
|
||||
},
|
||||
"texinfo.preview.customizationVariables": {
|
||||
"type": "array",
|
||||
"default": [],
|
||||
"description": "Set customization variables (format: KEY=VAL)"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
@ -80,6 +80,10 @@ export default class Options
|
|||
return this._getArray('preview.variables');
|
||||
}
|
||||
|
||||
get customizationVariables() {
|
||||
return this._getArray('preview.customizationVariables');
|
||||
}
|
||||
|
||||
private readonly _configuration
|
||||
= vscode.workspace.getConfiguration('texinfo');
|
||||
|
||||
|
|
|
@ -48,6 +48,8 @@ export default class Converter
|
|||
}
|
||||
this._addIncludePaths(this._options.includePaths, options);
|
||||
this._defineVariables(this._options.variables, options);
|
||||
this._setCustomizationVariables(
|
||||
this._options.customizationVariables, options);
|
||||
this._includeCustomCSS(this._options.customCSS, options);
|
||||
return await exec(
|
||||
this._options.makeinfo,
|
||||
|
@ -75,6 +77,13 @@ export default class Converter
|
|||
variables.forEach(varName => options.push('-D', varName));
|
||||
}
|
||||
|
||||
private _setCustomizationVariables(
|
||||
variables: readonly string[],
|
||||
options: string[],
|
||||
) {
|
||||
variables.forEach(varName => options.push('-c', varName));
|
||||
}
|
||||
|
||||
private _includeCustomCSS(cssFileURI: string, options: string[]) {
|
||||
if (!cssFileURI) {
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue