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
|
@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
|
@code{@@set}). If a variable has a value, use the ASCII space character to
|
||||||
separate key and value.
|
separate key and value.
|
||||||
|
@item @code{texinfo.preview.customizationVariables}: Array of customization
|
||||||
|
variables. (@code{-c KEY=VALUE})
|
||||||
@end itemize
|
@end itemize
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -207,6 +207,11 @@
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"default": [],
|
"default": [],
|
||||||
"description": "Define variables (as with @set)."
|
"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');
|
return this._getArray('preview.variables');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get customizationVariables() {
|
||||||
|
return this._getArray('preview.customizationVariables');
|
||||||
|
}
|
||||||
|
|
||||||
private readonly _configuration
|
private readonly _configuration
|
||||||
= vscode.workspace.getConfiguration('texinfo');
|
= vscode.workspace.getConfiguration('texinfo');
|
||||||
|
|
||||||
|
|
|
@ -48,6 +48,8 @@ export default class Converter
|
||||||
}
|
}
|
||||||
this._addIncludePaths(this._options.includePaths, options);
|
this._addIncludePaths(this._options.includePaths, options);
|
||||||
this._defineVariables(this._options.variables, options);
|
this._defineVariables(this._options.variables, options);
|
||||||
|
this._setCustomizationVariables(
|
||||||
|
this._options.customizationVariables, options);
|
||||||
this._includeCustomCSS(this._options.customCSS, options);
|
this._includeCustomCSS(this._options.customCSS, options);
|
||||||
return await exec(
|
return await exec(
|
||||||
this._options.makeinfo,
|
this._options.makeinfo,
|
||||||
|
@ -75,6 +77,13 @@ export default class Converter
|
||||||
variables.forEach(varName => options.push('-D', varName));
|
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[]) {
|
private _includeCustomCSS(cssFileURI: string, options: string[]) {
|
||||||
if (!cssFileURI) {
|
if (!cssFileURI) {
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user