Skip to content

Commit

Permalink
Git release only for 1.0.99 == 2.0.0 preview1
Browse files Browse the repository at this point in the history
  • Loading branch information
joaompinto committed Nov 16, 2018
1 parent dd41282 commit 26547ea
Show file tree
Hide file tree
Showing 17 changed files with 666 additions and 182 deletions.
3 changes: 1 addition & 2 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ wkhtmltopdf-bin/**
**/*.vsix
**/*.pdf
out/src/wkhtmltopdf*
extension.webpack.config.js
media/*.js
webpack.config.js
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changes

## 1.0.99
* Rebuilt using vscode-1.28.2/extensions/markdown* from Microsoft

## 1.0.x
* Test release

## 0.15.1

* asciidoctor_command can have arguments (closes #103)
Expand Down
31 changes: 31 additions & 0 deletions asciidoc-language-configuration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"comments": {
"lineComment": "//",
"blockComment": [ "////", "////" ]
},
"brackets": [
["{", "}"],
["[", "]"],
["(", ")"],
["<", ">"]
],
"autoClosingPairs": [
{ "open": "{", "close": "}" },
{ "open": "[", "close": "]" },
{ "open": "(", "close": ")" },
{ "open": "'", "close": "'", "notIn": ["string", "comment"] },
{ "open": "\"", "close": "\"", "notIn": ["string"] },
{ "open": "`", "close": "`", "notIn": ["string", "comment"] },
{ "open": "/**", "close": " */", "notIn": ["string"] },
{ "open": "////", "close": " ////", "notIn": ["string", "comment"] }
],
"surroundingPairs": [
["{", "}"],
["[", "]"],
["(", ")"],
["<", ">"],
["'", "'"],
["\"", "\""],
["`", "`"]
]
}
Binary file modified images/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 24 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
"name": "asciidoctor-vscode",
"displayName": "%displayName%",
"description": "%description%",
"version": "1.0.0",
"version": "1.0.99",
"publisher": "joaompinto",
"author": "João Pinto <lamego.pinto@gmail.com>",
"license": "MIT",
"readme": "README.md",
"repository": {
"type": "git",
"url": "https://github.com/joaompinto/asciidoctor-vscode"
"url": "https://github.com/asciidoctor/asciidoctor-vscode"
},
"galleryBanner": {
"color": "#78d6f0",
"theme": "light"
},
"bugs": "https://github.com/joaompinto/asciidoctor-vscode/issues",
"homepage": "https://github.com/joaompinto/asciidoctor-vscode/blob/master/README.md",
"bugs": "https://github.com/asciidoctor/asciidoctor-vscode/issues",
"homepage": "https://github.com/asciidoctor/asciidoctor-vscode/blob/master/README.md",
"icon": "images/icon.png",
"main": "./out/src/extension",
"engines": {
Expand All @@ -26,15 +26,16 @@
"Programming Languages"
],
"activationEvents": [
"onLanguage:asciidoc",
"onLanguage:asciidoc",
"onCommand:asciidoc.exportAsPDF",
"onCommand:asciidoc.pasteImage",
"onCommand:asciidoc.preview.toggleLock",
"onCommand:asciidoc.preview.refresh",
"onCommand:asciidoc.showPreview",
"onCommand:asciidoc.showPreviewToSide",
"onCommand:asciidoc.showLockedPreviewToSide",
"onCommand:asciidoc.showSource",
"onCommand:asciidoc.showPreviewSecuritySelector",
"onCommand:asciidoc.exportAsPDF",
"onWebviewPanel:asciidoc.preview"
],
"contributes": {
Expand All @@ -48,7 +49,8 @@
"extensions": [
".adoc",
".ad",
".asciidoc"
".asciidoc",
".asc"
],
"configuration": "./asciidoc-language-configuration.json"
}
Expand All @@ -69,6 +71,15 @@
"light": "./media/Preview.svg",
"dark": "./media/Preview_inverse.svg"
}
},
{
"command": "asciidoc.pasteImage",
"title": "%asciidoc.pasteImage.title%",
"category": "AsciiDoc",
"icon": {
"light": "./media/Preview.svg",
"dark": "./media/Preview_inverse.svg"
}
},
{
"command": "asciidoc.showPreview",
Expand Down Expand Up @@ -219,6 +230,11 @@
"title": "asciidoc",
"order": 20,
"properties": {
"asciidoc.asciidoctor_command": {
"type": "string",
"default": "asciidoctor",
"description": "Full path for the asciidoctor binary/executable"
},
"asciidoc.styles": {
"type": "array",
"default": [],
Expand Down Expand Up @@ -322,7 +338,7 @@
"asciidoc.use_asciidoctor_js": {
"type": "boolean",
"default": true,
"description": "Use asciidoctor js instead of the 'html_generator'"
"description": "Use asciidoctor js instead of the 'asciidoctor_command'"
}
}
},
Expand Down Expand Up @@ -371,8 +387,6 @@
"ts-loader": "^4.0.1"
},
"dependencies": {
"highlight.js": "9.12.0",
"markdown-it": "^8.4.1",
"asciidoctor.js": "^1.5.6-preview.5",
"copy-paste": "^1.2.0",
"file-url": "^1.0.1",
Expand Down
3 changes: 2 additions & 1 deletion package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@
"asciidoc.preview.toggleLock.title": "Toggle Preview Locking",
"configuration.asciidoc.preview.openMarkdownLinks.description": "How should clicking on links to markdown files be handled in the preview.",
"configuration.asciidoc.preview.openMarkdownLinks.inEditor": "Try to open links in the editor",
"configuration.asciidoc.preview.openMarkdownLinks.inPreview": "Try to open links in the the markdown preview"
"configuration.asciidoc.preview.openMarkdownLinks.inPreview": "Try to open links in the the markdown preview",
"asciidoc.pasteImage.title" : "Paste Image"
}
28 changes: 0 additions & 28 deletions schemas/package.schema.json

This file was deleted.

2 changes: 1 addition & 1 deletion src/commands/exportAsPDF.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export class ExportAsPDF implements Command {
// cancellable: true
}, async(progress) => {
progress.report({ message: 'Downloading wkhtmltopdf...'});
const download_url = `https://github.com/joaompinto/asciidoctor-vscode/raw/master/wkhtmltopdf-bin/wkhtmltopdf-${platform}-${arch}${ext}.gz`
const download_url = `https://github.com/asciidoctor/asciidoctor-vscode/raw/master/wkhtmltopdf-bin/wkhtmltopdf-${platform}-${arch}${ext}.gz`
await download_file(download_url, binary_path+".gz", progress).then( () => {
progress.report({ message: 'Unzipping wkhtmltopdf...'})
const ungzip = zlib.createGunzip()
Expand Down
2 changes: 2 additions & 0 deletions src/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ export { ShowPreviewSecuritySelectorCommand } from './showPreviewSecuritySelecto
export { MoveCursorToPositionCommand } from './moveCursorToPosition';
export { ToggleLockCommand } from './toggleLock';
export { ExportAsPDF } from './exportAsPDF';
export { PasteImage} from './pasteImage';

17 changes: 17 additions & 0 deletions src/commands/pasteImage.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { Command } from '../commandManager';
import * as path from 'path';
import { Logger, Paster } from '../image-paste';


export class PasteImage implements Command {
public readonly id = 'asciidoc.pasteImage';

public execute() {
try {
Paster.paste();
} catch (e) {
Logger.showErrorMessage(e)
}
}

}
6 changes: 4 additions & 2 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,11 @@ export function activate(context: vscode.ExtensionContext) {
commandManager.register(new commands.RefreshPreviewCommand(previewManager));
commandManager.register(new commands.MoveCursorToPositionCommand());
commandManager.register(new commands.ShowPreviewSecuritySelectorCommand(previewSecuritySelector, previewManager));
commandManager.register(new commands.OpenDocumentLinkCommand(engine));
commandManager.register(new commands.ToggleLockCommand(previewManager));
commandManager.register(new commands.OpenDocumentLinkCommand(engine));
commandManager.register(new commands.ExportAsPDF(engine));
commandManager.register(new commands.PasteImage());
commandManager.register(new commands.ToggleLockCommand(previewManager));
commandManager.register(new commands.ShowPreviewCommand(previewManager));

context.subscriptions.push(vscode.workspace.onDidChangeConfiguration(() => {
logger.updateConfiguration();
Expand Down
5 changes: 2 additions & 3 deletions src/features/foldingProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { Token } from 'markdown-it';
import * as vscode from 'vscode';
import { MarkdownEngine } from '../markdownEngine';
import { TableOfContentsProvider } from '../tableOfContentsProvider';
Expand All @@ -21,7 +20,7 @@ export default class MarkdownFoldingProvider implements vscode.FoldingRangeProvi
const isStartRegion = (t: string) => /^\s*<!--\s*#?region\b.*-->/.test(t);
const isEndRegion = (t: string) => /^\s*<!--\s*#?endregion\b.*-->/.test(t);

const isRegionMarker = (token: Token) => token.type === 'html_block' &&
const isRegionMarker = (token: any) => token.type === 'html_block' &&
(isStartRegion(token.content) || isEndRegion(token.content));


Expand Down Expand Up @@ -70,7 +69,7 @@ export default class MarkdownFoldingProvider implements vscode.FoldingRangeProvi

private async getBlockFoldingRanges(document: vscode.TextDocument): Promise<vscode.FoldingRange[]> {

const isFoldableToken = (token: Token) => {
const isFoldableToken = (token: any) => {
switch (token.type) {
case 'fence':
case 'list_item_open':
Expand Down
2 changes: 1 addition & 1 deletion src/features/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ export class MarkdownPreview {
}

private async onDidClickPreviewLink(path: string, fragment: string | undefined) {
const config = vscode.workspace.getConfiguration('markdown', this.resource);
const config = vscode.workspace.getConfiguration('asciidoc', this.resource);
const openLinks = config.get<string>('preview.openMarkdownLinks', 'inPreview');
if (openLinks === 'inPreview') {
const markdownLink = await resolveLinkToMarkdownFile(path);
Expand Down
4 changes: 2 additions & 2 deletions src/features/previewConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ export class MarkdownPreviewConfiguration {

private constructor(resource: vscode.Uri) {
const editorConfig = vscode.workspace.getConfiguration('editor', resource);
const markdownConfig = vscode.workspace.getConfiguration('markdown', resource);
const markdownEditorConfig = vscode.workspace.getConfiguration('[markdown]', resource);
const markdownConfig = vscode.workspace.getConfiguration('asciidoc', resource);
const markdownEditorConfig = vscode.workspace.getConfiguration('[asciidoc]', resource);

this.scrollBeyondLastLine = editorConfig.get<boolean>('scrollBeyondLastLine', false);

Expand Down
Loading

0 comments on commit 26547ea

Please sign in to comment.