Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Readme update for new vscode #27

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ Then choose from the list what document type you want to render and press `enter

## **Setting additional pandoc options**

1. choose 'Preference -> UserSettings'
1. Find: pandoc in Default Settings
1. Copy and paste
1. to settings.json
1. Choose 'File -> Preference -> Settings'
2. Open `settings.json` (button with three dots in the top right corner on the Settings screen)
3. Find `pandoc` in Default User Settings
4. Copy and paste to `settings.json`

example:
Example:

```json
//-------- Pandoc Option Configuration --------
Expand Down
26 changes: 22 additions & 4 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,33 @@ function setStatusBarText(what, docType){

function getPandocOptions(quickPickLabel) {
var pandocOptions;

var pandocConfiguration = vscode.workspace.getConfiguration('pandoc');
switch (quickPickLabel) {
case 'pdf':
pandocOptions = vscode.workspace.getConfiguration('pandoc').get('pdfOptString');
if (pandocConfiguration.has('pdfOptString')) {
pandocOptions = pandocConfiguration.get('pdfOptString');
}
else {
pandocOptions = '';
}
console.log('pdocOptstring = ' + pandocOptions);
break;
case 'docx':
pandocOptions = vscode.workspace.getConfiguration('pandoc').get('docxOptString');
if (pandocConfiguration.has('docxOptString')) {
pandocOptions = pandocConfiguration.get('docxOptString');
}
else {
pandocOptions = '';
}
console.log('pdocOptstring = ' + pandocOptions);
break;
case 'html':
pandocOptions = vscode.workspace.getConfiguration('pandoc').get('htmlOptString');
if (pandocConfiguration.has('htmlOptString')) {
pandocOptions = pandocConfiguration.get('htmlOptString');
}
else {
pandocOptions = '';
}
console.log('pdocOptstring = ' + pandocOptions);
break;
}
Expand Down Expand Up @@ -59,6 +74,9 @@ export function activate(context: vscode.ExtensionContext) {
setStatusBarText('Generating', qpSelection.label);

var pandocOptions = getPandocOptions(qpSelection.label);

if (pandocOptions === undefined)
pandocOptions = ''

// debug
console.log('debug: outFile = ' + inFile);
Expand Down