From 500a32967a5db1155a7c2b63cd599b54c35d9158 Mon Sep 17 00:00:00 2001 From: Chris Chinchilla Date: Sun, 23 Jan 2022 16:48:10 +0100 Subject: [PATCH] Update version --- dist/extension.js | 234 +--------------------------------------------- package.json | 4 +- 2 files changed, 3 insertions(+), 235 deletions(-) diff --git a/dist/extension.js b/dist/extension.js index af5a165..607245a 100644 --- a/dist/extension.js +++ b/dist/extension.js @@ -1,233 +1 @@ -/******/ (() => { // webpackBootstrap -/******/ "use strict"; -/******/ var __webpack_modules__ = ({ - -/***/ "./src/extension.ts": -/*!**************************!*\ - !*** ./src/extension.ts ***! - \**************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - - -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.activate = void 0; -const vscode = __importStar(__webpack_require__(/*! vscode */ "vscode")); -const child_process_1 = __webpack_require__(/*! child_process */ "child_process"); -const path = __importStar(__webpack_require__(/*! path */ "path")); -var pandocOutputChannel = vscode.window.createOutputChannel('Pandoc'); -function setStatusBarText(what, docType) { - var date = new Date(); - var text = what + ' [' + docType + '] ' + date.toLocaleTimeString(); - vscode.window.setStatusBarMessage(text, 1500); -} -function getPandocOptions(quickPickLabel) { - var pandocOptions; - switch (quickPickLabel) { - case 'pdf': - pandocOptions = vscode.workspace.getConfiguration('pandoc').get('pdfOptString'); - console.log('pdocOptstring = ' + pandocOptions); - break; - case 'docx': - pandocOptions = vscode.workspace.getConfiguration('pandoc').get('docxOptString'); - console.log('pdocOptstring = ' + pandocOptions); - break; - case 'html': - pandocOptions = vscode.workspace.getConfiguration('pandoc').get('htmlOptString'); - console.log('pdocOptstring = ' + pandocOptions); - break; - case 'asciidoc': - pandocOptions = vscode.workspace.getConfiguration('pandoc').get('asciidocOptString'); - console.log('pdocOptstring = ' + pandocOptions); - break; - case 'docbook': - pandocOptions = vscode.workspace.getConfiguration('pandoc').get('docbookOptString'); - console.log('pdocOptstring = ' + pandocOptions); - break; - case 'epub': - pandocOptions = vscode.workspace.getConfiguration('pandoc').get('epubOptString'); - console.log('pdocOptstring = ' + pandocOptions); - break; - case 'rst': - pandocOptions = vscode.workspace.getConfiguration('pandoc').get('rstOptString'); - console.log('pdocOptstring = ' + pandocOptions); - break; - } - return pandocOptions; -} -function openDocument(outFile) { - switch (process.platform) { - case 'darwin': - (0, child_process_1.exec)('open ' + outFile); - break; - case 'linux': - (0, child_process_1.exec)('xdg-open ' + outFile); - break; - default: - (0, child_process_1.exec)(outFile); - } -} -function getPandocExecutablePath() { - // By default pandoc executable should be in the PATH environment variable. - var pandocExecutablePath; - console.log(vscode.workspace.getConfiguration('pandoc').get('executable')); - if (vscode.workspace.getConfiguration('pandoc').has('executable') && - vscode.workspace.getConfiguration('pandoc').get('executable') !== '') { - pandocExecutablePath = vscode.workspace.getConfiguration('pandoc').get('executable'); - } - return pandocExecutablePath; -} -function activate(context) { - // console.log('Congratulations, your extension "vscode-pandoc" is now active!'); - var disposable = vscode.commands.registerCommand('pandoc.render', () => { - const editor = vscode.window.activeTextEditor; - if (!editor) { - return; - } - let fullName = path.normalize(editor.document.fileName); - var filePath = path.dirname(fullName); - var fileName = path.basename(fullName); - var fileNameOnly = path.parse(fileName).name; - let items = []; - items.push({ label: 'pdf', description: 'Render as pdf document' }); - items.push({ label: 'docx', description: 'Render as word document' }); - items.push({ label: 'html', description: 'Render as html document' }); - items.push({ label: 'asciidoc', description: 'Render as asciidoc document' }); - items.push({ label: 'docbook', description: 'Render as docbook document' }); - items.push({ label: 'epub', description: 'Render as epub document' }); - items.push({ label: 'rst', description: 'Render as rst document' }); - vscode.window.showQuickPick(items).then((qpSelection) => { - if (!qpSelection) { - return; - } - var inFile = path.join(filePath, fileName).replace(/(^.*$)/gm, "\"" + "$1" + "\""); - var outFile = (path.join(filePath, fileNameOnly) + '.' + qpSelection.label).replace(/(^.*$)/gm, "\"" + "$1" + "\""); - setStatusBarText('Generating', qpSelection.label); - var pandocOptions = getPandocOptions(qpSelection.label); - // debug - console.log('debug: outFile = ' + inFile); - console.log('debug: inFile = ' + outFile); - console.log('debug: pandoc ' + inFile + ' -o ' + outFile + pandocOptions); - var space = '\x20'; - var pandocExecutablePath = getPandocExecutablePath(); - console.log('debug: pandoc executable path = ' + pandocExecutablePath); - var targetExec = '"' + pandocExecutablePath + '"' + space + inFile + space + '-o' + space + outFile + space + pandocOptions; - console.log('debug: exec ' + targetExec); - var child = (0, child_process_1.exec)(targetExec, { cwd: filePath }, function (error, stdout, stderr) { - if (stdout !== null) { - console.log(stdout.toString()); - pandocOutputChannel.append(stdout.toString() + '\n'); - } - if (stderr !== null) { - console.log(stderr.toString()); - if (stderr !== "") { - vscode.window.showErrorMessage('stderr: ' + stderr.toString()); - pandocOutputChannel.append('stderr: ' + stderr.toString() + '\n'); - } - } - if (error !== null) { - console.log('exec error: ' + error); - vscode.window.showErrorMessage('exec error: ' + error); - pandocOutputChannel.append('exec error: ' + error + '\n'); - } - else { - var openViewer = vscode.workspace.getConfiguration('pandoc').get('render.openViewer'); - if (openViewer) { - setStatusBarText('Launching', qpSelection.label); - openDocument(outFile); - } - } - }); - }); - }); - context.subscriptions.push(disposable); -} -exports.activate = activate; - - -/***/ }), - -/***/ "vscode": -/*!*************************!*\ - !*** external "vscode" ***! - \*************************/ -/***/ ((module) => { - -module.exports = require("vscode"); - -/***/ }), - -/***/ "child_process": -/*!********************************!*\ - !*** external "child_process" ***! - \********************************/ -/***/ ((module) => { - -module.exports = require("child_process"); - -/***/ }), - -/***/ "path": -/*!***********************!*\ - !*** external "path" ***! - \***********************/ -/***/ ((module) => { - -module.exports = require("path"); - -/***/ }) - -/******/ }); -/************************************************************************/ -/******/ // The module cache -/******/ var __webpack_module_cache__ = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ // Check if module is in cache -/******/ var cachedModule = __webpack_module_cache__[moduleId]; -/******/ if (cachedModule !== undefined) { -/******/ return cachedModule.exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = __webpack_module_cache__[moduleId] = { -/******/ // no module.id needed -/******/ // no module.loaded needed -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/************************************************************************/ -/******/ -/******/ // startup -/******/ // Load entry module and return exports -/******/ // This entry module is referenced by other modules so it can't be inlined -/******/ var __webpack_exports__ = __webpack_require__("./src/extension.ts"); -/******/ module.exports = __webpack_exports__; -/******/ -/******/ })() -; \ No newline at end of file +(()=>{"use strict";var e={112:function(e,o,t){var n=this&&this.__createBinding||(Object.create?function(e,o,t,n){void 0===n&&(n=t),Object.defineProperty(e,n,{enumerable:!0,get:function(){return o[t]}})}:function(e,o,t,n){void 0===n&&(n=t),e[n]=o[t]}),r=this&&this.__setModuleDefault||(Object.create?function(e,o){Object.defineProperty(e,"default",{enumerable:!0,value:o})}:function(e,o){e.default=o}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var o={};if(null!=e)for(var t in e)"default"!==t&&Object.prototype.hasOwnProperty.call(e,t)&&n(o,e,t);return r(o,e),o};Object.defineProperty(o,"__esModule",{value:!0}),o.activate=void 0;const c=a(t(496)),i=t(81),s=a(t(17));var p=c.window.createOutputChannel("Pandoc");function d(e,o){var t=e+" ["+o+"] "+(new Date).toLocaleTimeString();c.window.setStatusBarMessage(t,1500)}o.activate=function(e){var o=c.commands.registerCommand("pandoc.render",(()=>{const e=c.window.activeTextEditor;if(!e)return;let o=s.normalize(e.document.fileName);var t=s.dirname(o),n=s.basename(o),r=s.parse(n).name;let a=[];a.push({label:"pdf",description:"Render as pdf document"}),a.push({label:"docx",description:"Render as word document"}),a.push({label:"html",description:"Render as html document"}),a.push({label:"asciidoc",description:"Render as asciidoc document"}),a.push({label:"docbook",description:"Render as docbook document"}),a.push({label:"epub",description:"Render as epub document"}),a.push({label:"rst",description:"Render as rst document"}),c.window.showQuickPick(a).then((e=>{if(e){var o=s.join(t,n).replace(/(^.*$)/gm,'"$1"'),a=(s.join(t,r)+"."+e.label).replace(/(^.*$)/gm,'"$1"');d("Generating",e.label);var l=function(e){var o;switch(e){case"pdf":o=c.workspace.getConfiguration("pandoc").get("pdfOptString"),console.log("pdocOptstring = "+o);break;case"docx":o=c.workspace.getConfiguration("pandoc").get("docxOptString"),console.log("pdocOptstring = "+o);break;case"html":o=c.workspace.getConfiguration("pandoc").get("htmlOptString"),console.log("pdocOptstring = "+o);break;case"asciidoc":o=c.workspace.getConfiguration("pandoc").get("asciidocOptString"),console.log("pdocOptstring = "+o);break;case"docbook":o=c.workspace.getConfiguration("pandoc").get("docbookOptString"),console.log("pdocOptstring = "+o);break;case"epub":o=c.workspace.getConfiguration("pandoc").get("epubOptString"),console.log("pdocOptstring = "+o);break;case"rst":o=c.workspace.getConfiguration("pandoc").get("rstOptString"),console.log("pdocOptstring = "+o)}return o}(e.label);console.log("debug: outFile = "+o),console.log("debug: inFile = "+a),console.log("debug: pandoc "+o+" -o "+a+l);var u=function(){var e;return console.log(c.workspace.getConfiguration("pandoc").get("executable")),c.workspace.getConfiguration("pandoc").has("executable")&&""!==c.workspace.getConfiguration("pandoc").get("executable")&&(e=c.workspace.getConfiguration("pandoc").get("executable")),e}();console.log("debug: pandoc executable path = "+u);var g='"'+u+'" '+o+" -o "+a+" "+l;console.log("debug: exec "+g),(0,i.exec)(g,{cwd:t},(function(o,t,n){null!==t&&(console.log(t.toString()),p.append(t.toString()+"\n")),null!==n&&(console.log(n.toString()),""!==n&&(c.window.showErrorMessage("stderr: "+n.toString()),p.append("stderr: "+n.toString()+"\n"))),null!==o?(console.log("exec error: "+o),c.window.showErrorMessage("exec error: "+o),p.append("exec error: "+o+"\n")):c.workspace.getConfiguration("pandoc").get("render.openViewer")&&(d("Launching",e.label),function(e){switch(process.platform){case"darwin":(0,i.exec)("open "+e);break;case"linux":(0,i.exec)("xdg-open "+e);break;default:(0,i.exec)(e)}}(a))}))}}))}));e.subscriptions.push(o)}},496:e=>{e.exports=require("vscode")},81:e=>{e.exports=require("child_process")},17:e=>{e.exports=require("path")}},o={},t=function t(n){var r=o[n];if(void 0!==r)return r.exports;var a=o[n]={exports:{}};return e[n].call(a.exports,a,a.exports,t),a.exports}(112);module.exports=t})(); \ No newline at end of file diff --git a/package.json b/package.json index 2118d6d..7fe5593 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "vscode-pandoc", "description": "Renders markdown through pandoc", - "version": "0.4.0", + "version": "0.4.1", "publisher": "ChrisChinchilla", "icon": "images/logo.png", "license": "SEE LICENSE", @@ -15,7 +15,7 @@ "url": "https://github.com/chrischinchilla/vscode-pandoc.git" }, "engines": { - "vscode": "^1.43.0" + "vscode": "^1.63.1" }, "categories": [ "Other"