Skip to content

Commit

Permalink
Changed to Josiah Latex Utilities to Specify my Edits
Browse files Browse the repository at this point in the history
  • Loading branch information
josiahnross committed Apr 27, 2023
1 parent c106cfb commit db245b1
Show file tree
Hide file tree
Showing 9 changed files with 587 additions and 534 deletions.
84 changes: 42 additions & 42 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "latex-utilities",
"displayName": "LaTeX Utilities",
"name": "josiah-latex-utilities",
"displayName": "Josiah LaTeX Utilities",
"description": "An add-on to LaTeX Workshop that provides some fancy features that are less vital to the basic experience editing a LaTeX document, but can be rather nice to have.",
"icon": "icon.png",
"version": "0.4.11",
Expand Down Expand Up @@ -32,158 +32,158 @@
"contributes": {
"commands": [
{
"command": "latex-utilities.editLiveSnippetsFile",
"command": "josiah-latex-utilities.editLiveSnippetsFile",
"title": "Edit Live Snippets file",
"category": "LaTeX Utilities"
"category": "Josiah LaTeX Utilities"
},
{
"command": "latex-utilities.resetLiveSnippetsFile",
"command": "josiah-latex-utilities.resetLiveSnippetsFile",
"title": "Reset Live Snippets file",
"category": "LaTeX Utilities"
"category": "Josiah LaTeX Utilities"
},
{
"command": "latex-utilities.compareLiveSnippetsFile",
"command": "josiah-latex-utilities.compareLiveSnippetsFile",
"title": "Compare user Live Snippets file to default",
"category": "LaTeX Utilities"
"category": "Josiah LaTeX Utilities"
},
{
"command": "latex-utilities.formattedPaste",
"command": "josiah-latex-utilities.formattedPaste",
"title": "Paste formatted content",
"category": "LaTeX Utilities"
"category": "Josiah LaTeX Utilities"
},
{
"command": "latex-utilities.citeZotero",
"command": "josiah-latex-utilities.citeZotero",
"title": "Cite from Zotero",
"category": "LaTeX Utilities"
"category": "Josiah LaTeX Utilities"
},
{
"command": "latex-utilities.openInZotero",
"command": "josiah-latex-utilities.openInZotero",
"title": "Open in Zotero",
"category": "LaTeX Utilities"
"category": "Josiah LaTeX Utilities"
},
{
"command": "latex-utilities.selectWordcountFormat",
"command": "josiah-latex-utilities.selectWordcountFormat",
"title": "Select wordcount format",
"category": "LaTeX Utilities"
"category": "Josiah LaTeX Utilities"
}
],
"keybindings": [
{
"key": "ctrl+shift+v",
"mac": "cmd+shift+v",
"command": "latex-utilities.formattedPaste",
"when": "!config.latex-utilities.formattedPaste.useAsDefault && editorTextFocus && editorLangId == 'latex'"
"command": "josiah-latex-utilities.formattedPaste",
"when": "!config.josiah-latex-utilities.formattedPaste.useAsDefault && editorTextFocus && editorLangId == 'latex'"
},
{
"key": "ctrl+v",
"mac": "cmd+v",
"command": "latex-utilities.formattedPaste",
"when": "config.latex-utilities.formattedPaste.useAsDefault && editorTextFocus && editorLangId == 'latex'"
"command": "josiah-latex-utilities.formattedPaste",
"when": "config.josiah-latex-utilities.formattedPaste.useAsDefault && editorTextFocus && editorLangId == 'latex'"
}
],
"configuration": {
"title": "LaTeX Utils",
"title": "Josiah LaTeX Utils",
"properties": {
"latex-utilities.formattedPaste.tableColumnType": {
"josiah-latex-utilities.formattedPaste.tableColumnType": {
"type": "string",
"default": "l",
"markdownDescription": "Tabular column type to use, e.g. **`l`**/**`r`**/**`c`**…"
},
"latex-utilities.formattedPaste.tableBooktabsStyle": {
"josiah-latex-utilities.formattedPaste.tableBooktabsStyle": {
"type": "boolean",
"default": true,
"markdownDescription": "Use the booktabs commands `\\toprule`, `\\midrule`, and `\\bottomrule`"
},
"latex-utilities.formattedPaste.tableHeaderRows": {
"josiah-latex-utilities.formattedPaste.tableHeaderRows": {
"type": "integer",
"default": 1,
"markdownDescription": "Number of header rows to assume. Set to **`0`** to disable."
},
"latex-utilities.formattedPaste.customTableDelimiter": {
"josiah-latex-utilities.formattedPaste.customTableDelimiter": {
"type": "string",
"default": "\t",
"minLength": 1,
"markdownDescription": "A custom delimiter to try for tables (in addition to `\\t`, `,` and `|` which we always try)"
},
"latex-utilities.formattedPaste.tableDelimiterPrompt": {
"josiah-latex-utilities.formattedPaste.tableDelimiterPrompt": {
"type": "boolean",
"default": false,
"markdownDescription": "Whether to be prompted for a custom delimiter if the set table delimiters didn't work"
},
"latex-utilities.formattedPaste.maxLineLength": {
"josiah-latex-utilities.formattedPaste.maxLineLength": {
"type": "integer",
"default": 80,
"markdownDescription": "Try to fit within the given line length"
},
"latex-utilities.formattedPaste.image.template": {
"josiah-latex-utilities.formattedPaste.image.template": {
"type": [
"string",
"array"
],
"default": "\\includegraphics{${imageFilePath}}",
"markdownDescription": "The template to use for pasting the image (use an array for multiline strings), use `${imageFilePath}` to represent the image file. Can also use `${imageFileNameWithoutExt}`"
},
"latex-utilities.formattedPaste.imagePathOverride": {
"josiah-latex-utilities.formattedPaste.imagePathOverride": {
"type": "string",
"default": "",
"markdownDescription": "Override the image path to use for the image template. If empty, the path will be read automatically from the source file. You can use ${currentFileDir} to represent the current source file dir."
},
"latex-utilities.formattedPaste.useAsDefault": {
"josiah-latex-utilities.formattedPaste.useAsDefault": {
"type": "boolean",
"default": false,
"markdownDescription": "Make `ctrl`+`v` perform a formatted paste, and `ctrl`+`shift`+`v` perform a 'raw' (normal) paste."
},
"latex-utilities.liveReformat.enabled": {
"josiah-latex-utilities.liveReformat.enabled": {
"type": "boolean",
"default": false,
"markdownDescription": "Apply live text replacements to make writing latex maths easier (e.g. `xx` → `\\times`). Also see the command \"Edit Live Snippets File\""
},
"latex-utilities.countWord.path": {
"josiah-latex-utilities.countWord.path": {
"type": "string",
"default": "texcount",
"markdownDescription": "Define the location of TeXCount executive file/script.\nThis command will be joint with `latex-utilities.countWord.args` and required arguments to form a complete command of TeXCount."
"markdownDescription": "Define the location of TeXCount executive file/script.\nThis command will be joint with `josiah-latex-utilities.countWord.args` and required arguments to form a complete command of TeXCount."
},
"latex-utilities.countWord.docker.enabled": {
"josiah-latex-utilities.countWord.docker.enabled": {
"type": "boolean",
"default": false,
"markdownDescription": "Use Docker to run TeXCount. This requires Docker to be installed and running. We will use docker config from LaTeX-Workshop."
},
"latex-utilities.countWord.args": {
"josiah-latex-utilities.countWord.args": {
"type": "array",
"default": [],
"markdownDescription": "TeXCount arguments to count words in LaTeX document of the entire project from the root file, or the current document.\nArguments must be in separate strings in the array. Additional arguments, i.e., `-merge %DOC%` for the project and the current document path for counting current file will be appended when constructing the command."
},
"latex-utilities.countWord.format": {
"josiah-latex-utilities.countWord.format": {
"type": "string",
"default": "${words} Words",
"markdownDescription": "Format of the statusbar item. Set empty (`\"\"`) to disable."
},
"latex-utilities.message.update.show": {
"josiah-latex-utilities.message.update.show": {
"type": "boolean",
"default": "true",
"markdownDescription": "Notify you when the extension updates"
},
"latex-utilities.message.error.show": {
"josiah-latex-utilities.message.error.show": {
"type": "boolean",
"default": "true",
"markdownDescription": "Show error messages"
},
"latex-utilities.texdef.enabled": {
"josiah-latex-utilities.texdef.enabled": {
"type": "boolean",
"default": "true",
"markdownDescription": "Use `texdef` to find definitions for LaTeX macros"
},
"latex-utilities.zotero.zoteroUrl": {
"josiah-latex-utilities.zotero.zoteroUrl": {
"type": "string",
"default": "http://localhost:23119",
"markdownDescription": "URL for the Zotero HTTP server"
},
"latex-utilities.zotero.latexCommand": {
"josiah-latex-utilities.zotero.latexCommand": {
"type": "string",
"default": "autocite",
"markdownDescription": "LaTeX citation command to use (`cite`, `parencite`, `autocite`, etc.)"
},
"latex-utilities.zotero.citeMethod": {
"josiah-latex-utilities.zotero.citeMethod": {
"type": "string",
"enum": [
"zotero",
Expand Down
6 changes: 3 additions & 3 deletions src/components/completionWatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export class CompletionWatcher {
constructor(extension: Extension) {
this.extension = extension;
this.typeFinder = new TypeFinder();
this.enabled = vscode.workspace.getConfiguration('latex-utilities').get('liveReformat.enabled') as boolean;
this.enabled = vscode.workspace.getConfiguration('josiah-latex-utilities').get('liveReformat.enabled') as boolean;
this.configAge = +new Date();
vscode.workspace.onDidChangeTextDocument(this.watcher, this);
this.snippetFile = {
Expand Down Expand Up @@ -94,7 +94,7 @@ export class CompletionWatcher {

public async watcher(e: vscode.TextDocumentChangeEvent) {
if (+new Date() - this.configAge > this.MAX_CONFIG_AGE) {
this.enabled = vscode.workspace.getConfiguration('latex-utilities').get('liveReformat.enabled') as boolean;
this.enabled = vscode.workspace.getConfiguration('josiah-latex-utilities').get('liveReformat.enabled') as boolean;
this.configAge = +new Date();
}

Expand Down Expand Up @@ -316,7 +316,7 @@ export class CompletionWatcher {
)
.then(option => {
if (option === 'Keep using the extension snippet file') {
vscode.commands.executeCommand('latex-utilities.resetLiveSnippetsFile');
vscode.commands.executeCommand('josiah-latex-utilities.resetLiveSnippetsFile');
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export class Logger {
}

showErrorMessage(message: string, ...args: any): Thenable<any> | undefined {
const configuration = vscode.workspace.getConfiguration('latex-utilities');
const configuration = vscode.workspace.getConfiguration('josiah-latex-utilities');
if (configuration.get('message.error.show')) {
return vscode.window.showErrorMessage(message, ...args);
} else {
Expand Down
10 changes: 5 additions & 5 deletions src/components/paster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export class Paster {
this.reformatText(
clipboardContents,
true,
vscode.workspace.getConfiguration('latex-utilities.formattedPaste').get('maxLineLength') as number,
vscode.workspace.getConfiguration('josiah-latex-utilities.formattedPaste').get('maxLineLength') as number,
editor
)
);
Expand Down Expand Up @@ -117,7 +117,7 @@ export class Paster {

public async pasteTable(editor: vscode.TextEditor, content: string, delimiter?: string) {
this.extension.logger.addLogMessage('Pasting: Table');
const configuration = vscode.workspace.getConfiguration('latex-utilities.formattedPaste');
const configuration = vscode.workspace.getConfiguration('josiah-latex-utilities.formattedPaste');

const columnDelimiter: string = delimiter || configuration.customTableDelimiter;
const columnType: string = configuration.tableColumnType;
Expand Down Expand Up @@ -487,12 +487,12 @@ export class Paster {
}

public loadImageConfig(projectPath: string, filePath: string) {
const config = vscode.workspace.getConfiguration('latex-utilities.formattedPaste.image');
const config = vscode.workspace.getConfiguration('josiah-latex-utilities.formattedPaste.image');

// load other config
const pasteTemplate: string | string[] | undefined = config.get('template');
if (pasteTemplate === undefined) {
throw new Error('No config value found for latex-utilities.imagePaste.template');
throw new Error('No config value found for josiah-latex-utilities.imagePaste.template');
}
if (typeof pasteTemplate === 'string') {
this.pasteTemplate = pasteTemplate;
Expand Down Expand Up @@ -797,7 +797,7 @@ export class Paster {
let graphicsPath: string | string[] = this.extension.manager.getGraphicsPath(text);
graphicsPath = graphicsPath.length !== 0 ? graphicsPath[0] : this.graphicsPathFallback;
graphicsPath = path.resolve(currentFileDir, graphicsPath);
const override = vscode.workspace.getConfiguration('latex-utilities.formattedPaste').get('imagePathOverride') as string;
const override = vscode.workspace.getConfiguration('josiah-latex-utilities.formattedPaste').get('imagePathOverride') as string;
if (override.length !== 0) {
graphicsPath = override;
}
Expand Down
10 changes: 5 additions & 5 deletions src/components/wordCounter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class WordCounter {
constructor(extension: Extension) {
this.extension = extension;
this.status = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left, -10002);
this.status.command = 'latex-utilities.selectWordcountFormat';
this.status.command = 'josiah-latex-utilities.selectWordcountFormat';
this.setStatus();
}

Expand All @@ -44,7 +44,7 @@ export class WordCounter {
this.extension.logger.addLogMessage('A valid file was not give for TexCount');
return;
}
const configuration = vscode.workspace.getConfiguration('latex-utilities.countWord');
const configuration = vscode.workspace.getConfiguration('josiah-latex-utilities.countWord');
const args = (configuration.get('args') as string[]).slice();
const execFile = util.promisify(cp.execFile);
if (merge) {
Expand Down Expand Up @@ -180,7 +180,7 @@ export class WordCounter {
this.status.hide();
return;
} else {
const template = vscode.workspace.getConfiguration('latex-utilities.countWord').get('format') as string;
const template = vscode.workspace.getConfiguration('josiah-latex-utilities.countWord').get('format') as string;
if (template === '') {
this.status.hide();
return;
Expand Down Expand Up @@ -210,7 +210,7 @@ export class WordCounter {

let format = choice;
if (choice === 'custom') {
const currentFormat = vscode.workspace.getConfiguration('latex-utilities.countWord').get('format') as string;
const currentFormat = vscode.workspace.getConfiguration('josiah-latex-utilities.countWord').get('format') as string;
format = await vscode.window.showInputBox({
placeHolder: 'Template',
value: currentFormat,
Expand All @@ -232,7 +232,7 @@ export class WordCounter {

if (format !== undefined) {
vscode.workspace
.getConfiguration('latex-utilities.countWord')
.getConfiguration('josiah-latex-utilities.countWord')
.update('format', format, vscode.ConfigurationTarget.Global)
.then(() => {
setTimeout(() => {
Expand Down
Loading

0 comments on commit db245b1

Please sign in to comment.