├── .coffeelintignore ├── .gitignore ├── fonts ├── NotoSerif-Bold.ttf ├── NotoSerif-Italic.ttf ├── NotoSerif-Regular.ttf ├── NotoSerif-BoldItalic.ttf └── LICENSE ├── bundle ├── droid-sans │ ├── DroidSans.ttf │ ├── DroidSans-Bold.ttf │ └── LICENSE.txt ├── open-sans │ ├── OpenSans-Bold.ttf │ ├── OpenSans-Italic.ttf │ ├── OpenSans-Light.ttf │ ├── OpenSans-Regular.ttf │ ├── OpenSans-ExtraBold.ttf │ ├── OpenSans-Semibold.ttf │ ├── OpenSans-BoldItalic.ttf │ ├── OpenSans-LightItalic.ttf │ ├── OpenSans-SemiboldItalic.ttf │ ├── OpenSans-ExtraBoldItalic.ttf │ └── LICENSE.txt └── noto-serif │ ├── NotoSerif-Bold.ttf │ ├── NotoSerif-Italic.ttf │ ├── NotoSerif-Regular.ttf │ ├── NotoSerif-BoldItalic.ttf │ └── LICENSE ├── .editorconfig ├── .github ├── ISSUE_TEMPLATE.md └── PULL_REQUEST_TEMPLATE.md ├── spec ├── asciidoc-preview-spec.coffee ├── highlights-helper-spec.coffee ├── fixtures │ ├── include.adoc │ └── test.asciidoc ├── worker-blocks-positions-spec.coffee └── configuration-builder-spec.coffee ├── styles ├── _droid-sans.less ├── font-awesome.less ├── _noto-serif.less ├── _open-sans.less └── asciidoc-preview.less ├── lib ├── std-stream-hook.coffee ├── configuration-builder.coffee ├── worker.coffee ├── highlights-helper.coffee ├── highlights.coffee ├── pdf-converter.coffee ├── renderer.coffee ├── main.coffee └── asciidoc-preview-view.coffee ├── appveyor.yml ├── coffeelint.json ├── .travis.yml ├── LICENSE.md ├── keymaps └── asciidoc-preview.cson ├── templates └── default.html ├── menus └── asciidoc-preview.cson ├── README.md ├── CONTRIBUTING.adoc ├── package.json └── CHANGELOG.md /.coffeelintignore: -------------------------------------------------------------------------------- 1 | spec/fixtures 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | npm-debug.log 3 | node_modules 4 | -------------------------------------------------------------------------------- /fonts/NotoSerif-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asciidoctor/atom-asciidoc-preview/HEAD/fonts/NotoSerif-Bold.ttf -------------------------------------------------------------------------------- /fonts/NotoSerif-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asciidoctor/atom-asciidoc-preview/HEAD/fonts/NotoSerif-Italic.ttf -------------------------------------------------------------------------------- /fonts/NotoSerif-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asciidoctor/atom-asciidoc-preview/HEAD/fonts/NotoSerif-Regular.ttf -------------------------------------------------------------------------------- /bundle/droid-sans/DroidSans.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asciidoctor/atom-asciidoc-preview/HEAD/bundle/droid-sans/DroidSans.ttf -------------------------------------------------------------------------------- /fonts/NotoSerif-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asciidoctor/atom-asciidoc-preview/HEAD/fonts/NotoSerif-BoldItalic.ttf -------------------------------------------------------------------------------- /bundle/open-sans/OpenSans-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asciidoctor/atom-asciidoc-preview/HEAD/bundle/open-sans/OpenSans-Bold.ttf -------------------------------------------------------------------------------- /bundle/droid-sans/DroidSans-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asciidoctor/atom-asciidoc-preview/HEAD/bundle/droid-sans/DroidSans-Bold.ttf -------------------------------------------------------------------------------- /bundle/noto-serif/NotoSerif-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asciidoctor/atom-asciidoc-preview/HEAD/bundle/noto-serif/NotoSerif-Bold.ttf -------------------------------------------------------------------------------- /bundle/open-sans/OpenSans-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asciidoctor/atom-asciidoc-preview/HEAD/bundle/open-sans/OpenSans-Italic.ttf -------------------------------------------------------------------------------- /bundle/open-sans/OpenSans-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asciidoctor/atom-asciidoc-preview/HEAD/bundle/open-sans/OpenSans-Light.ttf -------------------------------------------------------------------------------- /bundle/open-sans/OpenSans-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asciidoctor/atom-asciidoc-preview/HEAD/bundle/open-sans/OpenSans-Regular.ttf -------------------------------------------------------------------------------- /bundle/noto-serif/NotoSerif-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asciidoctor/atom-asciidoc-preview/HEAD/bundle/noto-serif/NotoSerif-Italic.ttf -------------------------------------------------------------------------------- /bundle/noto-serif/NotoSerif-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asciidoctor/atom-asciidoc-preview/HEAD/bundle/noto-serif/NotoSerif-Regular.ttf -------------------------------------------------------------------------------- /bundle/open-sans/OpenSans-ExtraBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asciidoctor/atom-asciidoc-preview/HEAD/bundle/open-sans/OpenSans-ExtraBold.ttf -------------------------------------------------------------------------------- /bundle/open-sans/OpenSans-Semibold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asciidoctor/atom-asciidoc-preview/HEAD/bundle/open-sans/OpenSans-Semibold.ttf -------------------------------------------------------------------------------- /bundle/noto-serif/NotoSerif-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asciidoctor/atom-asciidoc-preview/HEAD/bundle/noto-serif/NotoSerif-BoldItalic.ttf -------------------------------------------------------------------------------- /bundle/open-sans/OpenSans-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asciidoctor/atom-asciidoc-preview/HEAD/bundle/open-sans/OpenSans-BoldItalic.ttf -------------------------------------------------------------------------------- /bundle/open-sans/OpenSans-LightItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asciidoctor/atom-asciidoc-preview/HEAD/bundle/open-sans/OpenSans-LightItalic.ttf -------------------------------------------------------------------------------- /bundle/open-sans/OpenSans-SemiboldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asciidoctor/atom-asciidoc-preview/HEAD/bundle/open-sans/OpenSans-SemiboldItalic.ttf -------------------------------------------------------------------------------- /bundle/open-sans/OpenSans-ExtraBoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asciidoctor/atom-asciidoc-preview/HEAD/bundle/open-sans/OpenSans-ExtraBoldItalic.ttf -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: http://EditorConfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | 12 | [*.md] 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## Description 2 | 3 | Your description. 4 | 5 | - Atom version: 6 | - OS: 7 | - `asciidoc-preview` version: 8 | - `language-asciidoc` version: 9 | 10 | ## Screenshots 11 | 12 | Your screenshot. 13 | 14 | ## Syntax example 15 | 16 | ```adoc 17 | Your syntax example. 18 | ``` 19 | -------------------------------------------------------------------------------- /spec/asciidoc-preview-spec.coffee: -------------------------------------------------------------------------------- 1 | describe 'AsciiDoc preview', -> 2 | pack = null 3 | 4 | beforeEach -> 5 | waitsForPromise -> 6 | atom.packages.activatePackage 'asciidoc-preview' 7 | .then (p) -> 8 | pack = p 9 | 10 | it 'should load the package', -> 11 | expect(pack.name).toBe 'asciidoc-preview' 12 | -------------------------------------------------------------------------------- /spec/highlights-helper-spec.coffee: -------------------------------------------------------------------------------- 1 | {scopeForFenceName} = require '../lib/highlights-helper' 2 | 3 | describe 'Highlights helper', -> 4 | 5 | describe 'scopeForFenceName', -> 6 | 7 | it 'should return grammar name "source.shell" when fence name is "bash"', -> 8 | scope = scopeForFenceName('bash') 9 | expect(scope).toBe 'source.shell' 10 | -------------------------------------------------------------------------------- /spec/fixtures/include.adoc: -------------------------------------------------------------------------------- 1 | [source,javascript] 2 | ---- 3 | var content = "http://asciidoctor.org[*Asciidoctor*] " + 4 | "running on http://opalrb.org[_Opal_] " + 5 | "brings AsciiDoc to the browser!"; 6 | var options = Opal.hash2(['doctype', 'attributes'], {doctype: 'inline', attributes: ['showtitle']}); 7 | var html = Opal.Asciidoctor.$convert(asciidoc, options); 8 | console.log(html); 9 | ---- 10 | -------------------------------------------------------------------------------- /styles/_droid-sans.less: -------------------------------------------------------------------------------- 1 | @droid-font-path: 'atom://asciidoc-preview/bundle/droid-sans'; 2 | 3 | @font-face { 4 | font-family: 'Noto Serif'; 5 | src: url('@{droid-font-path}/DroidSans.ttf'); 6 | font-weight: normal; 7 | font-style: normal; 8 | } 9 | @font-face { 10 | font-family: 'Noto Serif'; 11 | src: url('@{droid-font-path}/DroidSans-Bold.ttf'); 12 | font-weight: bold; 13 | font-style: normal; 14 | } 15 | -------------------------------------------------------------------------------- /styles/font-awesome.less: -------------------------------------------------------------------------------- 1 | @asciidoc-preview-fa-font-path: 'atom://asciidoc-preview/node_modules/font-awesome/fonts'; 2 | 3 | @font-face { 4 | font-family: 'AsciidocPreview-FontAwesome'; 5 | src: url('@{asciidoc-preview-fa-font-path}/fontawesome-webfont.woff2') format('woff2'); 6 | font-weight: normal; 7 | font-style: normal; 8 | } 9 | 10 | .asciidoc-preview { 11 | @import '../node_modules/font-awesome/less/font-awesome.less'; 12 | 13 | .fa { 14 | font-family: 'AsciidocPreview-FontAwesome'; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 15 | 16 | ## Description 17 | 18 | Your description. 19 | 20 | ## Syntax example 21 | 22 | ```adoc 23 | Your syntax example. 24 | ``` 25 | 26 | ## Screenshots 27 | 28 | Your screenshot. 29 | -------------------------------------------------------------------------------- /lib/std-stream-hook.coffee: -------------------------------------------------------------------------------- 1 | # Hook to prevent errors occurs on Windows with Asciidoctor.js when syntax within a document is invalid. 2 | # See #159 and #174. 3 | # 4 | module.exports = 5 | oldStdoutWrite: process.stdout.write 6 | oldStderrWrite: process.stderr.write 7 | 8 | hook: -> 9 | if process.platform is 'win32' 10 | process.stdout.write = (string, encoding, fd) -> console.log string 11 | process.stderr.write = (string, encoding, fd) -> console.error string 12 | 13 | restore: -> 14 | if process.platform is 'win32' 15 | process.stdout.write = @oldStdoutWrite 16 | process.stderr.write = @oldStderrWrite 17 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | ### Project specific config ### 2 | environment: 3 | APM_TEST_PACKAGES: language-asciidoc 4 | ATOM_LINT_WITH_BUNDLED_NODE: "true" 5 | 6 | matrix: 7 | - ATOM_CHANNEL: stable 8 | - ATOM_CHANNEL: beta 9 | 10 | # NOTE: AppVeyor automatically skips the build if the commit contains [ci skip] or [skip ci] or [skip appveyor] 11 | skip_commits: 12 | author: asciidoctor-docbot 13 | 14 | ### Generic setup follows ### 15 | build_script: 16 | - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/atom/ci/master/build-package.ps1')) 17 | 18 | branches: 19 | only: 20 | - master 21 | 22 | version: "{build}" 23 | platform: x64 24 | clone_depth: 10 25 | skip_tags: true 26 | test: off 27 | deploy: off 28 | -------------------------------------------------------------------------------- /coffeelint.json: -------------------------------------------------------------------------------- 1 | { 2 | "max_line_length": { 3 | "level": "ignore" 4 | }, 5 | "no_empty_param_list": { 6 | "level": "error" 7 | }, 8 | "arrow_spacing": { 9 | "level": "error" 10 | }, 11 | "no_interpolation_in_single_quotes": { 12 | "level": "error" 13 | }, 14 | "no_debugger": { 15 | "level": "error" 16 | }, 17 | "prefer_english_operator": { 18 | "level": "error" 19 | }, 20 | "colon_assignment_spacing": { 21 | "spacing": { 22 | "left": 0, 23 | "right": 1 24 | }, 25 | "level": "error" 26 | }, 27 | "braces_spacing": { 28 | "spaces": 0, 29 | "level": "error" 30 | }, 31 | "spacing_after_comma": { 32 | "level": "error" 33 | }, 34 | "no_stand_alone_at": { 35 | "level": "error" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /styles/_noto-serif.less: -------------------------------------------------------------------------------- 1 | @noto-font-path: 'atom://asciidoc-preview/bundle/noto-serif'; 2 | 3 | @font-face { 4 | font-family: 'Noto Serif'; 5 | src: url('@{noto-font-path}/NotoSerif-Regular.ttf'); 6 | font-weight: normal; 7 | font-style: normal; 8 | } 9 | @font-face { 10 | font-family: 'Noto Serif'; 11 | src: url('@{noto-font-path}/NotoSerif-Italic.ttf'); 12 | font-weight: normal; 13 | font-style: italic; 14 | } 15 | @font-face { 16 | font-family: 'Noto Serif'; 17 | src: url('@{noto-font-path}/NotoSerif-Bold.ttf'); 18 | font-weight: bold; 19 | font-style: normal; 20 | } 21 | @font-face { 22 | font-family: 'Noto Serif'; 23 | src: url('@{noto-font-path}/NotoSerif-BoldItalic.ttf'); 24 | font-weight: bold; 25 | font-style: italic; 26 | } 27 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | ### Project specific config ### 2 | language: generic 3 | 4 | dist: trusty 5 | 6 | env: 7 | global: 8 | - APM_TEST_PACKAGES="language-asciidoc" 9 | - ATOM_LINT_WITH_BUNDLED_NODE="true" 10 | 11 | matrix: 12 | - ATOM_CHANNEL=stable 13 | - ATOM_CHANNEL=beta 14 | 15 | os: 16 | - linux 17 | - osx 18 | 19 | ### Generic setup follows ### 20 | script: 21 | - curl -s -O https://raw.githubusercontent.com/atom/ci/master/build-package.sh 22 | - chmod u+x build-package.sh 23 | - ./build-package.sh 24 | 25 | notifications: 26 | email: 27 | on_success: never 28 | on_failure: change 29 | 30 | branches: 31 | only: 32 | - master 33 | 34 | git: 35 | depth: 10 36 | 37 | sudo: false 38 | 39 | addons: 40 | apt: 41 | packages: 42 | - build-essential 43 | - git 44 | - libsecret-1-dev 45 | - libgnome-keyring-dev 46 | - fakeroot 47 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014 Anthonny Quérouil 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /keymaps/asciidoc-preview.cson: -------------------------------------------------------------------------------- 1 | '.platform-win32 atom-workspace, .platform-win32 atom-workspace atom-text-editor': 2 | 'ctrl-shift-a': 'asciidoc-preview:toggle' 3 | 'ctrl-alt-a': 'asciidoc-preview:toggle-render-on-save-only' 4 | 5 | '.platform-linux atom-workspace, .platform-linux atom-workspace atom-text-editor': 6 | 'ctrl-shift-a': 'asciidoc-preview:toggle' 7 | 'ctrl-alt-a': 'asciidoc-preview:toggle-render-on-save-only' 8 | 9 | '.platform-darwin atom-workspace, .platform-darwin atom-workspace atom-text-editor': 10 | 'cmd-shift-a': 'asciidoc-preview:toggle' 11 | 'cmd-ctrl-a': 'asciidoc-preview:toggle-render-on-save-only' 12 | 13 | '.platform-darwin .asciidoc-preview': 14 | 'cmd-+': 'asciidoc-preview:zoom-in' 15 | 'cmd-=': 'asciidoc-preview:zoom-in' 16 | 'cmd--': 'asciidoc-preview:zoom-out' 17 | 'cmd-_': 'asciidoc-preview:zoom-out' 18 | 'cmd-0': 'asciidoc-preview:reset-zoom' 19 | 20 | '.platform-win32 .asciidoc-preview, .platform-linux .asciidoc-preview': 21 | 'ctrl-+': 'asciidoc-preview:zoom-in' 22 | 'ctrl-=': 'asciidoc-preview:zoom-in' 23 | 'ctrl--': 'asciidoc-preview:zoom-out' 24 | 'ctrl-_': 'asciidoc-preview:zoom-out' 25 | 'ctrl-0': 'asciidoc-preview:reset-zoom' 26 | -------------------------------------------------------------------------------- /styles/_open-sans.less: -------------------------------------------------------------------------------- 1 | @open-font-path: 'atom://asciidoc-preview/bundle/open-sans'; 2 | 3 | @font-face { 4 | font-family: 'Open Sans'; 5 | font-weight: 300; 6 | font-style: normal; 7 | src: url('@{open-font-path}/OpenSans-Light.ttf'); 8 | } 9 | @font-face { 10 | font-family: 'Open Sans'; 11 | font-weight: 300; 12 | font-style: italic; 13 | src: url('@{open-font-path}/OpenSans-LightItalic.ttf'); 14 | } 15 | @font-face { 16 | font-family: 'Open Sans'; 17 | src: url('@{open-font-path}/OpenSans-Regular.ttf'); 18 | font-weight: normal; 19 | font-style: normal; 20 | } 21 | @font-face { 22 | font-family: 'Open Sans'; 23 | src: url('@{open-font-path}/OpenSans-Italic.ttf'); 24 | font-weight: normal; 25 | font-style: italic; 26 | } 27 | @font-face { 28 | font-family: 'Open Sans'; 29 | src: url('@{open-font-path}/OpenSans-Semibold.ttf'); 30 | font-weight: 600; 31 | font-style: normal; 32 | } 33 | @font-face { 34 | font-family: 'Open Sans'; 35 | src: url('@{open-font-path}/OpenSans-SemiboldItalic.ttf'); 36 | font-weight: 600; 37 | font-style: italic; 38 | } 39 | @font-face { 40 | font-family: 'Open Sans'; 41 | src: url('@{open-font-path}/OpenSans-Bold.ttf'); 42 | font-weight: bold; 43 | font-style: normal; 44 | } 45 | @font-face { 46 | font-family: 'Open Sans'; 47 | src: url('@{open-font-path}/OpenSans-BoldItalic.ttf'); 48 | font-weight: bold; 49 | font-style: italic; 50 | } 51 | @font-face { 52 | font-family: 'Open Sans'; 53 | src: url('@{open-font-path}/OpenSans-ExtraBold.ttf'); 54 | font-weight: 800; 55 | font-style: normal; 56 | } 57 | @font-face { 58 | font-family: 'Open Sans'; 59 | src: url('@{open-font-path}/OpenSans-ExtraBoldItalic.ttf'); 60 | font-weight: 800; 61 | font-style: italic; 62 | } 63 | -------------------------------------------------------------------------------- /lib/configuration-builder.coffee: -------------------------------------------------------------------------------- 1 | path = require 'path' 2 | 3 | module.exports = 4 | makeAttributes: -> 5 | attributes = 6 | defaultAttributes: atom.config.get 'asciidoc-preview.defaultAttributes' 7 | sectnums: sectionNumbering() 8 | skipFrontMatter: if atom.config.get 'asciidoc-preview.frontMatter' then '' else 'skip-front-matter' 9 | showTitle: if atom.config.get 'asciidoc-preview.showTitle' then 'showtitle' else 'showtitle!' 10 | compatMode: if atom.config.get 'asciidoc-preview.compatMode' then 'compat-mode=@' else '' 11 | forceExperimental: if atom.config.get 'asciidoc-preview.forceExperimental' then 'experimental' else '' 12 | tocType: calculateTocType() 13 | 14 | makeOptions: (filePath) -> 15 | options = 16 | baseDir: (makeBaseDirectory filePath if filePath) 17 | safeMode: atom.config.get 'asciidoc-preview.safeMode' or 'safe' 18 | scrollMode: atom.config.get 'asciidoc-preview.scrollMode' 19 | 20 | calculateTocType = -> 21 | tocType = atom.config.get 'asciidoc-preview.tocType' 22 | if tocType is 'none' 23 | '' 24 | else if tocType is 'auto' 25 | # NOTE: 'auto' (blank option in asciidoctor) is currently not supported but 26 | # this section is left as a reminder of the expected behaviour 27 | 'toc=toc! toc2!' 28 | else 29 | "toc=#{tocType} toc2!" 30 | 31 | sectionNumbering = -> 32 | sectnumsOption = atom.config.get 'asciidoc-preview.sectionNumbering' 33 | if sectnumsOption is 'always-enabled' 34 | 'sectnums' 35 | else if sectnumsOption is 'always-disabled' 36 | 'sectnums!' 37 | else if sectnumsOption is 'enabled-by-default' 38 | 'sectnums=@' 39 | else 40 | '' 41 | 42 | makeBaseDirectory = (filePath) -> 43 | baseBir = atom.config.get 'asciidoc-preview.baseDir' 44 | if baseBir is '{docdir}' 45 | path.dirname filePath 46 | else if baseBir isnt '-' 47 | baseBir 48 | -------------------------------------------------------------------------------- /lib/worker.coffee: -------------------------------------------------------------------------------- 1 | asciidoctorRuntimeConfig = 2 | runtime: 3 | platform: 'node' 4 | engine: 'v8' 5 | framework: 'electron' 6 | Asciidoctor = require('@asciidoctor/core')(asciidoctorRuntimeConfig) 7 | path = require 'path' 8 | stdStream = require './std-stream-hook' 9 | 10 | module.exports = (text, attributes, options) -> 11 | callback = @async() 12 | 13 | concatAttributes = [ 14 | attributes.defaultAttributes 15 | 'icons=font@' 16 | attributes.numbered 17 | attributes.skipFrontMatter 18 | attributes.showTitle 19 | attributes.compatMode 20 | attributes.tocType 21 | attributes.forceExperimental 22 | ].join(' ').trim() 23 | 24 | asciidoctorOptions = 25 | base_dir: options.baseDir 26 | safe: options.safeMode 27 | doctype: 'article' 28 | # Force backend to html5 29 | backend: 'html5' 30 | attributes: concatAttributes 31 | sourcemap: options.scrollMode 32 | 33 | try 34 | stdStream.hook() 35 | doc = Asciidoctor.load text, asciidoctorOptions 36 | 37 | if options.scrollMode 38 | blockPositions = registerBlockPositions doc 39 | emit 'asciidoctor-load:success', blockPositions: blockPositions 40 | 41 | html = doc.convert() 42 | stdStream.restore() 43 | emit 'asciidoctor-render:success', html: html 44 | catch error 45 | console.error error 46 | {code, errno, syscall, stack} = error 47 | console.error stack 48 | emit 'asciidoctor-render:error', 49 | code: code 50 | errno: errno 51 | syscall: syscall 52 | stack: stack 53 | 54 | callback() 55 | 56 | registerBlockPositions = (doc) -> 57 | blockId = 0 58 | if doc.header? 59 | # Make sure the document header node and the document node share the same ID. 60 | if typeof doc.id isnt 'string' 61 | doc.id = "__asciidoctor-preview-#{blockId}__" 62 | blockId += 1 63 | doc.header.id = doc.id 64 | 65 | blocks = doc.findBy((b) -> b.getLineNumber()?) 66 | 67 | linesMapping = {} 68 | for block in blocks 69 | id = block.id 70 | if typeof id isnt 'string' 71 | id = "__asciidoctor-preview-#{blockId}__" 72 | blockId += 1 73 | block.id = id 74 | 75 | lineno = block.getLineNumber() 76 | linesMapping[lineno] = id 77 | 78 | linesMapping 79 | -------------------------------------------------------------------------------- /lib/highlights-helper.coffee: -------------------------------------------------------------------------------- 1 | scopesByFenceName = 2 | # support from Highlights https://github.com/atom/highlights/tree/master/deps 3 | 'bash': 'source.shell' 4 | 'c': 'source.c' 5 | 'c++': 'source.cpp' 6 | 'clojure': 'source.clojure' 7 | 'coffee': 'source.coffee' 8 | 'coffeescript': 'source.coffee' 9 | 'coffee-script': 'source.coffee' 10 | 'cpp': 'source.cpp' 11 | 'cs': 'source.cs' 12 | 'csharp': 'source.cs' 13 | 'css': 'source.css' 14 | 'erlang': 'source.erl' 15 | 'go': 'source.go' 16 | 'golang': 'source.go' 17 | 'html': 'text.html.basic' 18 | 'java': 'source.java' 19 | 'javascript': 'source.js' 20 | 'js': 'source.js' 21 | 'json': 'source.json' 22 | 'less': 'source.css.less' 23 | 'make': 'source.makefile' 24 | 'makefile': 'source.makefile' 25 | 'markdown': 'source.gfm' 26 | 'md': 'source.gfm' 27 | 'mdown': 'source.gfm' 28 | 'mustache': 'text.html.mustache' 29 | 'objc': 'source.objc' 30 | 'objective-c': 'source.objc' 31 | 'perl': 'source.perl' 32 | 'php': 'text.html.php' 33 | 'plist': 'text.xml.plist' 34 | 'properties': 'source.git-config' 35 | 'py': 'source.python' 36 | 'python': 'source.python' 37 | 'rb': 'source.ruby' 38 | 'ruby': 'source.ruby' 39 | 'sass': 'source.sass' 40 | 'scss': 'source.css.scss' 41 | 'sh': 'source.shell' 42 | 'shell': 'source.shell' 43 | 'sql': 'source.sql' 44 | 'text': 'text.plain' 45 | 'todo': 'text.todo' 46 | 'toml': 'source.toml' 47 | 'xml': 'text.xml' 48 | 'yaml': 'source.yaml' 49 | 'yml': 'source.yaml' 50 | # support for others packages 51 | 'csv': 'text.csv' 52 | 'diff': 'source.diff' 53 | 'docker': 'source.dockerfile' 54 | 'dockerfile': 'source.dockerfile' 55 | 'elixir': 'source.elixir' 56 | 'elm': 'source.elm' 57 | 'groovy': 'source.groovy' 58 | 'haskell': 'source.haskell' 59 | 'jsx': 'source.js.jsx' 60 | 'julia': 'source.julia' 61 | 'ocaml': 'source.ocaml' 62 | 'patch': 'source.diff' 63 | 'r': 'source.r' 64 | 'rej': 'source.diff' 65 | 'rs': 'source.rust' 66 | 'rust': 'source.rust' 67 | 'scala': 'source.scala' 68 | 'swift': 'source.swift' 69 | 'typescript': 'source.ts' 70 | 'ts': 'source.ts' 71 | 72 | module.exports = 73 | scopeForFenceName: (fenceName, blockText) -> 74 | fenceName = fenceName.toLowerCase() 75 | if fenceName is 'php' and not blockText.startsWith ' 6 | scopeStack.push(scope) 7 | html += "" 8 | 9 | popScope = (scopeStack, html) -> 10 | scopeStack.pop() 11 | html += '' 12 | 13 | updateScopeStack = (scopeStack, desiredScopes, html) -> 14 | excessScopes = scopeStack.length - desiredScopes.length 15 | if excessScopes > 0 16 | html = popScope(scopeStack, html) while excessScopes-- 17 | 18 | # pop until common prefix 19 | for i in [scopeStack.length..0] 20 | break if _.isEqual(scopeStack[0...i], desiredScopes[0...i]) 21 | html = popScope(scopeStack, html) 22 | 23 | # push on top of common prefix until scopeStack is desiredScopes 24 | for j in [i...desiredScopes.length] 25 | html = pushScope(scopeStack, desiredScopes[j], html) 26 | 27 | html 28 | 29 | module.exports = 30 | highlightSync = (options = {}) -> 31 | registry = atom.grammars 32 | {fileContents, scopeName, lineDivs, editorDiv, wrapCode, editorDivTag, editorDivClass, nullScope} = options 33 | lineDivs ?= false 34 | editorDiv ?= false 35 | wrapCode ?= false 36 | editorDivTag ?= 'div' 37 | editorDivClass ?= 'editor editor-colors' 38 | nullScope ?= 'text.plain.null-grammar' 39 | 40 | grammar = registry.grammarForScopeName(scopeName) ? (registry.grammarForScopeName(nullScope) if nullScope) 41 | 42 | throw new Error("Grammar #{scopeName} not found, and no #{nullScope} grammar") unless grammar? 43 | 44 | lineTokens = grammar.tokenizeLines fileContents 45 | 46 | # Remove trailing newline 47 | if lineTokens.length > 0 48 | lastLineTokens = lineTokens[lineTokens.length - 1] 49 | 50 | if lastLineTokens.length is 1 and lastLineTokens[0].value is '' 51 | lineTokens.pop() 52 | 53 | html = '' 54 | html = "<#{editorDivTag} class=\"#{editorDivClass}\">" if editorDiv 55 | html += "" if wrapCode 56 | for tokens in lineTokens 57 | scopeStack = [] 58 | html += '
' if lineDivs 59 | for {value, scopes} in tokens 60 | value = ' ' unless value 61 | scopes = scopes.map (scope) -> "syntax--#{scope.replace(/\./g, '.syntax--')}" 62 | html = updateScopeStack scopeStack, scopes, html 63 | value = value.replace(/&/, '&').replace(/#{value}" 65 | html = popScope(scopeStack, html) while scopeStack.length > 0 66 | html += '\n' 67 | html += '
' if lineDivs 68 | html += "
" if wrapCode 69 | html += "" if editorDiv 70 | html 71 | -------------------------------------------------------------------------------- /templates/default.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{ title }} 5 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 |
33 |
34 | {{{ content }}} 35 |
36 |
37 | 38 | 39 | -------------------------------------------------------------------------------- /styles/asciidoc-preview.less: -------------------------------------------------------------------------------- 1 | @import 'syntax-variables'; 2 | 3 | // Fonts 4 | @import '_droid-sans.less'; 5 | @import '_noto-serif.less'; 6 | @import '_open-sans.less'; 7 | @asciidoc-preview-font-family: 'Noto Serif', 'DejaVu Serif', 'Serif', serif; 8 | 9 | .asciidoc-preview { 10 | @import (less) '../node_modules/@asciidoctor/core/dist/css/asciidoctor.css'; 11 | } 12 | 13 | .asciidoc-preview { 14 | font-family: @asciidoc-preview-font-family; 15 | font-size: 16px; 16 | line-height: 1.6; 17 | background-color: #fff; 18 | overflow-y: scroll; 19 | overflow-x: auto; 20 | box-sizing: border-box; 21 | padding: 20px; 22 | color: rgba(0,0,0,.8); 23 | 24 | :not(.atom-text-editor) > code { 25 | color: #333; 26 | } 27 | } 28 | 29 | .asciidoc-spinner { 30 | margin: auto; 31 | background-image: url('images/octocat-spinner-128.gif'); 32 | background-repeat: no-repeat; 33 | background-size: 64px; 34 | background-position: top center; 35 | padding-top: 70px; 36 | text-align: center; 37 | height: 128px 38 | } 39 | 40 | /* Atom style overrides */ 41 | .asciidoc-preview { 42 | blockquote:after, 43 | blockquote:before { 44 | content: none; 45 | } 46 | 47 | .admonitionblock td.icon [class^='fa icon-'] { 48 | font-style: normal; 49 | } 50 | 51 | .admonitionblock td.content > .title, 52 | .audioblock > .title, 53 | .dlist > .title, 54 | .exampleblock > .title, 55 | .hdlist > .title, 56 | .imageblock > .title, 57 | .listingblock > .title, 58 | .literalblock > .title, 59 | .olist > .title, 60 | .openblock > .title, 61 | .paragraph > .title, 62 | .qlist > .title, 63 | .quoteblock > .title, 64 | .stemblock > .title, 65 | .ulist > .title, 66 | .verseblock > .title, 67 | .videoblock > .title, 68 | table.tableblock > .title { 69 | font-size: 1em; 70 | } 71 | 72 | .quoteblock blockquote, 73 | .quoteblock blockquote p { 74 | font-size: 1.15em; 75 | } 76 | 77 | .verseblock pre { 78 | font-size: 1.15em; 79 | } 80 | 81 | blockquote, 82 | dt, 83 | p, 84 | td.content { 85 | font-size: 1.0625em; 86 | } 87 | 88 | .listingblock pre.highlights { 89 | background: contrast(@syntax-background-color, lighten(@syntax-background-color, 4%), darken(@syntax-background-color, 4%)); 90 | } 91 | 92 | pre.highlights { 93 | // background: contrast(@syntax-background-color, lighten(@syntax-background-color, 4%), darken(@syntax-background-color, 4%)) !important; 94 | color: @syntax-text-color; 95 | word-break: break-word; 96 | } 97 | 98 | .verseblock, 99 | .verseblock > pre { 100 | border: none !important; 101 | color: inherit !important; 102 | background-color: #FFF !important; 103 | font-weight: 300 !important; 104 | } 105 | 106 | } 107 | -------------------------------------------------------------------------------- /lib/pdf-converter.coffee: -------------------------------------------------------------------------------- 1 | path = require 'path' 2 | opn = require 'opn' 3 | 4 | module.exports = 5 | 6 | convert: ({target}) -> 7 | convertToPdf target.dataset.path 8 | 9 | convertFromPath: (sourceFilePath) -> 10 | convertToPdf sourceFilePath 11 | 12 | convertToPdf = (sourceFilePath) -> 13 | if atom.config.get 'asciidoc-preview.exportAsPdf.enabled' 14 | 15 | cmd = executeAsciiDoctorPdf sourceFilePath 16 | 17 | cmd.stdout.on 'data', (data) -> 18 | atom.notifications.addInfo 'Export as PDF:', detail: data.toString() or '', dismissable: true 19 | 20 | cmd.stderr.on 'data', (data) -> 21 | console.error "stderr: #{data}" 22 | atom.notifications.addError 'Error:', detail: data.toString() or '', dismissable: true 23 | 24 | cmd.on 'close', (code) -> 25 | basename = path.basename(sourceFilePath, path.extname(sourceFilePath)) 26 | pdfFilePath = path.join(path.dirname(sourceFilePath), basename) + '.pdf' 27 | 28 | if code is 0 29 | atom.notifications.addSuccess 'Export as PDF completed!', detail: pdfFilePath or '', dismissable: false 30 | 31 | if atom.config.get 'asciidoc-preview.exportAsPdf.openWithExternal' 32 | opn(pdfFilePath).catch (error) -> 33 | atom.notifications.addError error.toString(), detail: error?.stack or '', dismissable: true 34 | console.error error 35 | else 36 | atom.notifications.addWarning 'Export as PDF completed with errors.', detail: pdfFilePath or '', dismissable: false 37 | 38 | else 39 | message = ''' 40 | This feature is experimental. 41 | You must manually activate this feature in the package settings. 42 | `asciidoctor-pdf` must be installed on your computer. 43 | ''' 44 | atom.notifications.addWarning 'Export as PDF:', detail: message or '', dismissable: true 45 | 46 | executeAsciiDoctorPdf = (sourceFilePath) -> 47 | {spawn} = require 'child_process' 48 | 49 | asciidoctorPdfArguments = makeAsciiDoctorPdfArguments() 50 | 51 | if process.platform is 'win32' 52 | shell = process.env['SHELL'] or 'cmd.exe' 53 | spawn 'asciidoctor-pdf.bat', [asciidoctorPdfArguments, "\"#{sourceFilePath}\""], shell: "#{shell}" 54 | else 55 | shell = process.env['SHELL'] or 'bash' 56 | spawn 'asciidoctor-pdf', [asciidoctorPdfArguments, "\"#{sourceFilePath}\""], shell: "#{shell}" 57 | 58 | makeAsciiDoctorPdfArguments = -> 59 | asciidoctorPdfArguments = [] 60 | 61 | asciidoctorPdfStyle = atom.config.get 'asciidoc-preview.exportAsPdf.pdfStyle' 62 | if asciidoctorPdfStyle isnt "" 63 | asciidoctorPdfArguments.push "-a pdf-style=\"#{asciidoctorPdfStyle}\"" 64 | 65 | asciidoctorPdfStylesDir = atom.config.get 'asciidoc-preview.exportAsPdf.pdfStylesDir' 66 | if asciidoctorPdfStylesDir isnt "" 67 | asciidoctorPdfArguments.push "-a pdf-stylesdir=\"#{asciidoctorPdfStylesDir}\"" 68 | 69 | asciidoctorPdfFontsDir = atom.config.get 'asciidoc-preview.exportAsPdf.pdfFontsDir' 70 | if asciidoctorPdfFontsDir isnt "" 71 | asciidoctorPdfArguments.push "-a pdf-fontsdir=\"#{asciidoctorPdfFontsDir}\"" 72 | 73 | asciidoctorPdfAdditionalArguments = atom.config.get 'asciidoc-preview.exportAsPdf.arguments' 74 | if asciidoctorPdfAdditionalArguments isnt "" 75 | asciidoctorPdfArguments.push asciidoctorPdfAdditionalArguments 76 | 77 | asciidoctorPdfArguments.join(' ').trim() 78 | -------------------------------------------------------------------------------- /spec/worker-blocks-positions-spec.coffee: -------------------------------------------------------------------------------- 1 | {Task} = require 'atom' 2 | 3 | describe 'worker when the scroll mode is activated', -> 4 | [options, taskPath] = [] 5 | 6 | beforeEach -> 7 | atom.config.set 'asciidoc-preview.scrollMode', true 8 | options = 9 | opalPwd: window.location.href 10 | scrollMode: true 11 | 12 | taskPath = require.resolve('../lib/worker') 13 | 14 | it 'should generate blocks positions when contains sections', -> 15 | content = ''' 16 | = Hello world 17 | 18 | == First section 19 | 20 | First paragraph. 21 | Second paragraph. 22 | 23 | == Second section 24 | 25 | Third paragraph. 26 | Fourth paragraph. 27 | ''' 28 | 29 | task = Task.once taskPath, content, {}, options 30 | 31 | task.on 'asciidoctor-load:success', ({blockPositions}) => 32 | @blockPositions = blockPositions 33 | 34 | waitsFor (done) -> task.start(done) 35 | 36 | runs => 37 | expect(Object.keys @blockPositions).toHaveLength 5 38 | expect(@blockPositions[1]).toBe '__asciidoctor-preview-0__' 39 | expect(@blockPositions[3]).toBe '_first_section' 40 | expect(@blockPositions[5]).toBe '__asciidoctor-preview-1__' 41 | expect(@blockPositions[8]).toBe '_second_section' 42 | expect(@blockPositions[10]).toBe '__asciidoctor-preview-2__' 43 | 44 | it 'should generate blocks positions when document contains item list.', -> 45 | content = ''' 46 | = Hello world 47 | 48 | == First section 49 | 50 | .Unordered list title 51 | * list item 1 52 | ** nested list item 53 | *** nested nested list item 1 54 | *** nested nested list item 2 55 | * list item 2 56 | ''' 57 | 58 | task = Task.once taskPath, content, {}, options 59 | 60 | task.on 'asciidoctor-load:success', ({blockPositions}) => 61 | @blockPositions = blockPositions 62 | 63 | waitsFor (done) -> task.start(done) 64 | 65 | runs => 66 | expect(Object.keys @blockPositions).toHaveLength 7 67 | expect(@blockPositions[1]).toBe '__asciidoctor-preview-0__' 68 | expect(@blockPositions[3]).toBe '_first_section' 69 | expect(@blockPositions[6]).toBe '__asciidoctor-preview-2__' 70 | expect(@blockPositions[7]).toBe '__asciidoctor-preview-4__' 71 | expect(@blockPositions[8]).toBe '__asciidoctor-preview-6__' 72 | expect(@blockPositions[9]).toBe '__asciidoctor-preview-7__' 73 | expect(@blockPositions[10]).toBe '__asciidoctor-preview-8__' 74 | 75 | it 'should generate blocks positions when document contains definition list.', -> 76 | content = ''' 77 | = Hello world 78 | 79 | == First section 80 | 81 | A term:: 82 | The corresponding definition of the term. 83 | 84 | Another term:: 85 | The corresponding definition of the term. 86 | 87 | Another term again:: The corresponding definition of the term. 88 | ''' 89 | 90 | task = Task.once taskPath, content, {}, options 91 | 92 | task.on 'asciidoctor-load:success', ({blockPositions}) => 93 | @blockPositions = blockPositions 94 | 95 | waitsFor (done) -> task.start(done) 96 | 97 | runs => 98 | expect(Object.keys @blockPositions).toHaveLength 7 99 | expect(@blockPositions[1]).toBe '__asciidoctor-preview-0__' 100 | expect(@blockPositions[3]).toBe '_first_section' 101 | expect(@blockPositions[5]).toBe '__asciidoctor-preview-2__' 102 | expect(@blockPositions[6]).toBe '__asciidoctor-preview-3__' 103 | expect(@blockPositions[8]).toBe '__asciidoctor-preview-4__' 104 | expect(@blockPositions[9]).toBe '__asciidoctor-preview-5__' 105 | expect(@blockPositions[11]).toBe '__asciidoctor-preview-7__' 106 | -------------------------------------------------------------------------------- /menus/asciidoc-preview.cson: -------------------------------------------------------------------------------- 1 | menu: [ 2 | label: 'Packages' 3 | submenu: [ 4 | label: 'AsciiDoc Preview' 5 | submenu: [ 6 | label: 'Toggle Preview', command: 'asciidoc-preview:toggle' 7 | , 8 | label: 'Toggle Sync', command: 'asciidoc-preview:sync' 9 | , 10 | label: 'Always show Table of Contents' 11 | submenu: [ 12 | label: 'none', command: 'asciidoc-preview:set-toc-none' 13 | , 14 | label: 'preamble', command: 'asciidoc-preview:set-toc-preamble' 15 | , 16 | label: 'macro', command: 'asciidoc-preview:set-toc-macro' 17 | ] 18 | , 19 | label: 'Section Numbering' 20 | submenu: [ 21 | label: 'Enabled by default', command: 'asciidoc-preview:set-section-numbering-enabled-by-default' 22 | , 23 | label: 'Always enabled', command: 'asciidoc-preview:set-section-numbering-always-enabled' 24 | , 25 | label: 'Always disabled', command: 'asciidoc-preview:set-section-numbering-always-disabled' 26 | , 27 | label: 'Not specified', command: 'asciidoc-preview:set-section-numbering-not-specified' 28 | ] 29 | , 30 | label: 'Toggle Document Title', command: 'asciidoc-preview:toggle-show-title' 31 | , 32 | label: 'Toggle Front Matter', command: 'asciidoc-preview:toggle-skip-front-matter' 33 | , 34 | label: 'Toggle Compat Mode', command: 'asciidoc-preview:toggle-compat-mode' 35 | ] 36 | ] 37 | ] 38 | 39 | 'context-menu': 40 | '.asciidoc-preview': [ 41 | label: 'Copy', command: 'core:copy' 42 | , 43 | label: 'Save As HTML\u2026', command: 'core:save-as' 44 | , 45 | label: 'Export as PDF', command: 'asciidoc-preview:export-pdf' 46 | , 47 | label: 'Toggle Document Title', command: 'asciidoc-preview:toggle-show-title' 48 | , 49 | label: 'Always show Table of Contents' 50 | submenu: [ 51 | label: 'none', command: 'asciidoc-preview:set-toc-none' 52 | , 53 | label: 'preamble', command: 'asciidoc-preview:set-toc-preamble' 54 | , 55 | label: 'macro', command: 'asciidoc-preview:set-toc-macro' 56 | ] 57 | , 58 | label: 'Toggle Front Matter', command: 'asciidoc-preview:toggle-skip-front-matter' 59 | , 60 | label: 'Section Numbering' 61 | submenu: [ 62 | label: 'Enabled by default', command: 'asciidoc-preview:set-section-numbering-enabled-by-default' 63 | , 64 | label: 'Always enabled', command: 'asciidoc-preview:set-section-numbering-always-enabled' 65 | , 66 | label: 'Always disabled', command: 'asciidoc-preview:set-section-numbering-always-disabled' 67 | , 68 | label: 'Not specified', command: 'asciidoc-preview:set-section-numbering-not-specified' 69 | ] 70 | , 71 | label: 'Toggle Compat Mode', command: 'asciidoc-preview:toggle-compat-mode' 72 | ] 73 | '.tree-view .file .name[data-name$=\\.adoc]': [ 74 | label: 'AsciiDoc: Preview', command: 'asciidoc-preview:preview-file' 75 | , 76 | label: 'AsciiDoc: Export as PDF', command: 'asciidoc-preview:export-pdf' 77 | , 78 | type: 'separator' 79 | ] 80 | '.tree-view .file .name[data-name$=\\.asciidoc]': [ 81 | label: 'AsciiDoc: Preview', command: 'asciidoc-preview:preview-file' 82 | , 83 | label: 'AsciiDoc: Export as PDF', command: 'asciidoc-preview:export-pdf' 84 | , 85 | type: 'separator' 86 | ] 87 | '.tree-view .file .name[data-name$=\\.ad]': [ 88 | label: 'AsciiDoc: Preview', command: 'asciidoc-preview:preview-file' 89 | , 90 | label: 'AsciiDoc: Export as PDF', command: 'asciidoc-preview:export-pdf' 91 | , 92 | type: 'separator' 93 | ] 94 | '.tree-view .file .name[data-name$=\\.asc]': [ 95 | label: 'AsciiDoc: Preview', command: 'asciidoc-preview:preview-file' 96 | , 97 | label: 'AsciiDoc: Export as PDF', command: 'asciidoc-preview:export-pdf' 98 | , 99 | type: 'separator' 100 | ] 101 | '.tree-view .file .name[data-name$=\\.txt]': [ 102 | label: 'AsciiDoc: Preview', command: 'asciidoc-preview:preview-file' 103 | , 104 | label: 'AsciiDoc: Export as PDF', command: 'asciidoc-preview:export-pdf' 105 | , 106 | type: 'separator' 107 | ] 108 | -------------------------------------------------------------------------------- /fonts/LICENSE: -------------------------------------------------------------------------------- 1 | This Font Software is licensed under the SIL Open Font License, 2 | Version 1.1. 3 | 4 | This license is copied below, and is also available with a FAQ at: 5 | http://scripts.sil.org/OFL 6 | 7 | ----------------------------------------------------------- 8 | SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 9 | ----------------------------------------------------------- 10 | 11 | PREAMBLE 12 | The goals of the Open Font License (OFL) are to stimulate worldwide 13 | development of collaborative font projects, to support the font 14 | creation efforts of academic and linguistic communities, and to 15 | provide a free and open framework in which fonts may be shared and 16 | improved in partnership with others. 17 | 18 | The OFL allows the licensed fonts to be used, studied, modified and 19 | redistributed freely as long as they are not sold by themselves. The 20 | fonts, including any derivative works, can be bundled, embedded, 21 | redistributed and/or sold with any software provided that any reserved 22 | names are not used by derivative works. The fonts and derivatives, 23 | however, cannot be released under any other type of license. The 24 | requirement for fonts to remain under this license does not apply to 25 | any document created using the fonts or their derivatives. 26 | 27 | DEFINITIONS 28 | "Font Software" refers to the set of files released by the Copyright 29 | Holder(s) under this license and clearly marked as such. This may 30 | include source files, build scripts and documentation. 31 | 32 | "Reserved Font Name" refers to any names specified as such after the 33 | copyright statement(s). 34 | 35 | "Original Version" refers to the collection of Font Software 36 | components as distributed by the Copyright Holder(s). 37 | 38 | "Modified Version" refers to any derivative made by adding to, 39 | deleting, or substituting -- in part or in whole -- any of the 40 | components of the Original Version, by changing formats or by porting 41 | the Font Software to a new environment. 42 | 43 | "Author" refers to any designer, engineer, programmer, technical 44 | writer or other person who contributed to the Font Software. 45 | 46 | PERMISSION & CONDITIONS 47 | Permission is hereby granted, free of charge, to any person obtaining 48 | a copy of the Font Software, to use, study, copy, merge, embed, 49 | modify, redistribute, and sell modified and unmodified copies of the 50 | Font Software, subject to the following conditions: 51 | 52 | 1) Neither the Font Software nor any of its individual components, in 53 | Original or Modified Versions, may be sold by itself. 54 | 55 | 2) Original or Modified Versions of the Font Software may be bundled, 56 | redistributed and/or sold with any software, provided that each copy 57 | contains the above copyright notice and this license. These can be 58 | included either as stand-alone text files, human-readable headers or 59 | in the appropriate machine-readable metadata fields within text or 60 | binary files as long as those fields can be easily viewed by the user. 61 | 62 | 3) No Modified Version of the Font Software may use the Reserved Font 63 | Name(s) unless explicit written permission is granted by the 64 | corresponding Copyright Holder. This restriction only applies to the 65 | primary font name as presented to the users. 66 | 67 | 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font 68 | Software shall not be used to promote, endorse or advertise any 69 | Modified Version, except to acknowledge the contribution(s) of the 70 | Copyright Holder(s) and the Author(s) or with their explicit written 71 | permission. 72 | 73 | 5) The Font Software, modified or unmodified, in part or in whole, 74 | must be distributed entirely under this license, and must not be 75 | distributed under any other license. The requirement for fonts to 76 | remain under this license does not apply to any document created using 77 | the Font Software. 78 | 79 | TERMINATION 80 | This license becomes null and void if any of the above conditions are 81 | not met. 82 | 83 | DISCLAIMER 84 | THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 85 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF 86 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT 87 | OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE 88 | COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 89 | INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL 90 | DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 91 | FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM 92 | OTHER DEALINGS IN THE FONT SOFTWARE. 93 | -------------------------------------------------------------------------------- /bundle/noto-serif/LICENSE: -------------------------------------------------------------------------------- 1 | This Font Software is licensed under the SIL Open Font License, 2 | Version 1.1. 3 | 4 | This license is copied below, and is also available with a FAQ at: 5 | http://scripts.sil.org/OFL 6 | 7 | ----------------------------------------------------------- 8 | SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 9 | ----------------------------------------------------------- 10 | 11 | PREAMBLE 12 | The goals of the Open Font License (OFL) are to stimulate worldwide 13 | development of collaborative font projects, to support the font 14 | creation efforts of academic and linguistic communities, and to 15 | provide a free and open framework in which fonts may be shared and 16 | improved in partnership with others. 17 | 18 | The OFL allows the licensed fonts to be used, studied, modified and 19 | redistributed freely as long as they are not sold by themselves. The 20 | fonts, including any derivative works, can be bundled, embedded, 21 | redistributed and/or sold with any software provided that any reserved 22 | names are not used by derivative works. The fonts and derivatives, 23 | however, cannot be released under any other type of license. The 24 | requirement for fonts to remain under this license does not apply to 25 | any document created using the fonts or their derivatives. 26 | 27 | DEFINITIONS 28 | "Font Software" refers to the set of files released by the Copyright 29 | Holder(s) under this license and clearly marked as such. This may 30 | include source files, build scripts and documentation. 31 | 32 | "Reserved Font Name" refers to any names specified as such after the 33 | copyright statement(s). 34 | 35 | "Original Version" refers to the collection of Font Software 36 | components as distributed by the Copyright Holder(s). 37 | 38 | "Modified Version" refers to any derivative made by adding to, 39 | deleting, or substituting -- in part or in whole -- any of the 40 | components of the Original Version, by changing formats or by porting 41 | the Font Software to a new environment. 42 | 43 | "Author" refers to any designer, engineer, programmer, technical 44 | writer or other person who contributed to the Font Software. 45 | 46 | PERMISSION & CONDITIONS 47 | Permission is hereby granted, free of charge, to any person obtaining 48 | a copy of the Font Software, to use, study, copy, merge, embed, 49 | modify, redistribute, and sell modified and unmodified copies of the 50 | Font Software, subject to the following conditions: 51 | 52 | 1) Neither the Font Software nor any of its individual components, in 53 | Original or Modified Versions, may be sold by itself. 54 | 55 | 2) Original or Modified Versions of the Font Software may be bundled, 56 | redistributed and/or sold with any software, provided that each copy 57 | contains the above copyright notice and this license. These can be 58 | included either as stand-alone text files, human-readable headers or 59 | in the appropriate machine-readable metadata fields within text or 60 | binary files as long as those fields can be easily viewed by the user. 61 | 62 | 3) No Modified Version of the Font Software may use the Reserved Font 63 | Name(s) unless explicit written permission is granted by the 64 | corresponding Copyright Holder. This restriction only applies to the 65 | primary font name as presented to the users. 66 | 67 | 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font 68 | Software shall not be used to promote, endorse or advertise any 69 | Modified Version, except to acknowledge the contribution(s) of the 70 | Copyright Holder(s) and the Author(s) or with their explicit written 71 | permission. 72 | 73 | 5) The Font Software, modified or unmodified, in part or in whole, 74 | must be distributed entirely under this license, and must not be 75 | distributed under any other license. The requirement for fonts to 76 | remain under this license does not apply to any document created using 77 | the Font Software. 78 | 79 | TERMINATION 80 | This license becomes null and void if any of the above conditions are 81 | not met. 82 | 83 | DISCLAIMER 84 | THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 85 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF 86 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT 87 | OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE 88 | COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 89 | INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL 90 | DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 91 | FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM 92 | OTHER DEALINGS IN THE FONT SOFTWARE. 93 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ### :information_source: **Information** :information_source: 2 | 3 | [GitHub is sunsetting Atom on December 15, 2022](https://github.blog/2022-06-08-sunsetting-atom/). 4 | As a result, we recommend migrating to an alternative solution. The Asciidoctor community is now focusing on providing the best writing experience using the [IntelliJ platform](https://github.com/asciidoctor/asciidoctor-intellij-plugin) or [Visual Studio Code](https://github.com/asciidoctor/asciidoctor-vscode). 5 | 6 | On December 15, 2022, this repository will be archived. 7 | 8 | --- 9 | 10 | # AsciiDoc Preview package 11 | 12 | [![Atom Package](https://img.shields.io/apm/v/asciidoc-preview.svg)](https://atom.io/packages/asciidoc-preview) 13 | [![Atom Package Downloads](https://img.shields.io/apm/dm/asciidoc-preview.svg)](https://atom.io/packages/asciidoc-preview) 14 | [![Build Status (Linux)](https://travis-ci.org/asciidoctor/atom-asciidoc-preview.svg?branch=master)](https://travis-ci.org/asciidoctor/atom-asciidoc-preview) 15 | [![Build Status (Windows)](https://ci.appveyor.com/api/projects/status/a7240elaip2dkd16?svg=true)](https://ci.appveyor.com/project/asciidoctor/atom-asciidoc-preview) 16 | [![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](https://github.com/asciidoctor/atom-asciidoc-preview/blob/master/LICENSE.md) 17 | 18 | Shows the rendered HTML of the AsciiDoc content in current editor. 19 | 20 | Toggle the preview pane, which appears to the right of the editor, by using the key combination ctrl-shift-a or cmd-shift-a. 21 | 22 | It is currently enabled for `.adoc`, `.asciidoc`, `.ad`, `.asc`, `.adoc.txt`, `.txt` files. 23 | 24 | **Note:** since 1.0.0, the auto-completions have been migrated to a dedicate package: [autocomplete-asciidoc](https://atom.io/packages/autocomplete-asciidoc). 25 | 26 | This package use [Asciidoctor.js](https://github.com/asciidoctor/asciidoctor.js). 27 | 28 | ![asciidoc-preview](https://cloud.githubusercontent.com/assets/5674651/23831539/c914762a-0723-11e7-85f6-f7a16dcfa1e9.png) 29 | 30 | 31 | ## Options 32 | 33 | * Live preview or preview only on save. 34 | * Choose the position of the preview pane: "left", "right", "up", "down" (default: "right") 35 | * Enable or disable table of contents (TOC) in preview pane. 36 | * Supported TOC positions: default (center), preamble, or macro. 37 | * Choose none in settings to allow document to control position. 38 | * If toc attribute is set to left or right, the TOC will appear in the center. 39 | * Save as HTML: save the document to an HTML file. 40 | * Export as PDF: create a PDF file and open with your default PDF viewer. 41 | * [asciidoctor-pdf](https://github.com/asciidoctor/asciidoctor-pdf) command must be available on your `PATH`. 42 | * more styling options are available in the package settings. 43 | * Synchronize the preview pane: synchronize the preview pane with the AsciiDoc source pane. 44 | * **WARNING:** The scroll position on the preview pane does not automatically scroll the AsciiDoc source pane. 45 | 46 | More options are available : 47 | * in the package settings 48 | * in the global menu 49 | * by right-clicking on the preview 50 | * by right-clicking on an AsciiDoc file. 51 | 52 | ## Disclaimer About Styles 53 | 54 | The preview window is not meant to emulate the published styles. 55 | Rather, it's intended to present a preview of the content to assist with editing. 56 | This is by design. 57 | It also aims to make the best use of limited screen space. 58 | So, for example, you won't see functionality such as a sidebar TOC. 59 | The colors may also differ to better integrate with the Atom theme. 60 | If you want to customize the apparance of the preview, you can specify your own stylesheet in the settings. 61 | 62 | ## Others Atom packages for AsciiDoc 63 | 64 | * [language-asciidoc](https://atom.io/packages/language-asciidoc): Syntax highlighting and snippets for AsciiDoc (with Asciidoctor flavor). 65 | * [asciidoc-preview](https://atom.io/packages/asciidoc-preview): Show an preview for the AsciiDoc content in the current editor. 66 | * [autocomplete-asciidoc](https://atom.io/packages/autocomplete-asciidoc): AsciiDoc language autocompletions. 67 | * [asciidoc-image-helper](https://atom.io/packages/asciidoc-image-helper): When pasting an image into an Asciidoc document, this package will paste clipboard image data as a file into a folder specified by the user. 68 | * [asciidoc-assistant](https://atom.io/packages/asciidoc-assistant): install Atom AsciiDoc basic packages with one package. 69 | 70 | ## More 71 | 72 | You can install this module from the command-line by typing `apm install asciidoc-preview`. 73 | 74 | ![AsciiDoc Preview demo](https://cloud.githubusercontent.com/assets/5674651/15512720/96199b06-21e1-11e6-9eab-56826356a4e9.gif) 75 | 76 | Thanks to [@kevinsawicki](https://github.com/kevinsawicki) for inspiration [markdown-preview](https://github.com/atom/markdown-preview). 77 | -------------------------------------------------------------------------------- /CONTRIBUTING.adoc: -------------------------------------------------------------------------------- 1 | = Contributing 2 | 3 | In the spirit of free software, _everyone_ is encouraged to help improve this project. 4 | 5 | To contribute code, simply fork the project on GitHub, hack away and send a pull request with your proposed changes. 6 | Feel free to use the https://github.com/asciidoctor/atom-lasciidoc-preview/issues[issue tracker] to provide feedback or suggestions in other ways. 7 | 8 | == Project organization 9 | 10 | The project is hosted and run using GitHub. 11 | The issue tracker is in place to report bugs, discuss improvements, show our ambitious goals and desires for the future, and encourage each other. 12 | Classification labels and versioning tags are added for clarity and the ability to search. 13 | 14 | === Labels 15 | 16 | Labels are added to issues and pull request for clarity, in the present but also when looking back at previous issues and pull requests. 17 | 18 | .Type labels 19 | |=== 20 | |bug | the current implementation has a flaw that needs to be resolved 21 | |question | generic question 22 | |improvement | refinement on top of an existing feature 23 | |enhancement | new feature 24 | |duplicate | a similar (open) issue already exists 25 | |invalid | not reproducible or out of date 26 | |declined | a decision was made not to pursue 27 | |=== 28 | 29 | .Status labels 30 | |=== 31 | |WIP | currently a Work In Progress, not ready for a merge 32 | |ready | development is done 33 | |=== 34 | 35 | == Development 36 | 37 | === Retrieve the source code 38 | 39 | The source code for this plugin is available from https://github.com/asciidoctor/atom-asciidoc-preview. 40 | 41 | === Retrieve the dependencies 42 | 43 | Use the following command to download dependencies (https://github.com/atom/season[Season], http://www.coffeelint.org/[CoffeeLint], ...): 44 | 45 | [source, shell] 46 | ---- 47 | apm install 48 | ---- 49 | 50 | === Prepare for business 51 | 52 | . Decide what you want to work on, and what should be the result 53 | . Have a GitHub account 54 | . Fork the project to your personal account 55 | . Check out your forked project for local development using git 56 | . Navigate to the directory using the command line interface 57 | . Link the package using `apm link -d`, and start atom in dev-mode using the command `atom -d .` 58 | . _Develop_ (this is where the magic happens) 59 | . Commit and push your code onto your forked project 60 | . Make a pull request and fill in the pull request template to request for the changes to be merged into the upstream project 61 | . Answer questions or make adjustments based on the discussion around the pull request 62 | . Wait for the merge, wait for the next release, use it in your normal Atom install 63 | . _Show off to others what you have made, and feel proud for you have improved the lives of many by contributing to this package!_ 64 | 65 | == Quality assurance 66 | 67 | When opening a pull request on GitHub, https://travis-ci.org/asciidoctor/atom-asciidoc-preview[Travis CI] will run the Atom package specs and lint using CoffeeScript files. 68 | Of course you can do so yourself, so you can ensure your code will pass the check in the pull-request. 69 | 70 | === CoffeeScript lint 71 | 72 | This package uses http://www.coffeelint.org/[CoffeeLint] to ensure that the code is uniformly structured. 73 | The linter definitions are defined in the link:coffeelint.json[coffeelint.json]. 74 | 75 | When developing in Atom, the https://atom.io/packages/linter-coffeelint[linter-coffeelint] package exposes the linting in your editor. 76 | It does require CoffeeLint to be http://www.coffeelint.org/#install[installed]. 77 | 78 | CoffeeLint can also be triggered from the command line: 79 | 80 | [source, shell] 81 | ---- 82 | coffeelint -f coffeelint.json lib/*.coffee spec/*-spec.coffee menus/*.cson keymaps/*.cson 83 | ---- 84 | 85 | === Package specs 86 | 87 | Tests are defined in link:spec/[spec directory], which provide snippets of text and test if the parsed result meet the expectations. 88 | Ideally all grammar features are covered in the specs (100% test coverage), with both positive and negative tests. 89 | Having these tests present will help future contributors make improvements without accidentally breaking other parts of the package. 90 | 91 | There are multiple ways in which you can run the tests: 92 | 93 | .Testing from the command line 94 | [source, shell] 95 | ---- 96 | atom --test spec 97 | ---- 98 | 99 | .Testing via the Command Pallet in Atom 100 | ---- 101 | Window: Run Package Specs 102 | ---- 103 | 104 | .Testing using the build-package.sh script 105 | [source, shell] 106 | ---- 107 | curl -s https://raw.githubusercontent.com/atom/ci/master/build-package.sh > build-package.sh 108 | sh build-package.sh 109 | ---- 110 | 111 | .Testing syntax 112 | * http://flight-manual.atom.io/hacking-atom/sections/writing-specs[Atom specs] 113 | * http://jasmine.github.io/1.3/introduction.html[Jasmine 1.3] 114 | -------------------------------------------------------------------------------- /lib/renderer.coffee: -------------------------------------------------------------------------------- 1 | {$} = require 'atom-space-pen-views' 2 | {Task} = require 'atom' 3 | path = require 'path' 4 | fs = require 'fs-plus' 5 | cheerio = require 'cheerio' 6 | highlights = require './highlights' 7 | 8 | {scopeForFenceName} = require './highlights-helper' 9 | 10 | {makeAttributes, makeOptions} = require './configuration-builder' 11 | 12 | highlighter = null 13 | {resourcePath} = atom.getLoadSettings() 14 | packagePath = path.dirname(__dirname) 15 | 16 | exports.toHtml = (text='', filePath) -> 17 | render text, filePath 18 | .then (html) -> 19 | sanitize html 20 | .then (html) -> 21 | resolveImagePaths html, filePath 22 | .then (html) -> 23 | tokenizeCodeBlocks html 24 | 25 | exports.toRawHtml = (text='', filePath) -> 26 | render text, filePath 27 | 28 | exports.getBlockId = (bufferRowPosition) => 29 | @blockPositions[bufferRowPosition + 1] if @blockPositions 30 | 31 | render = (text='', filePath) => 32 | return Promise.resolve() unless atom.config.get('asciidoc-preview.defaultAttributes')? 33 | 34 | new Promise (resolve, reject) => 35 | attributes = makeAttributes() 36 | options = makeOptions filePath 37 | 38 | taskPath = require.resolve('./worker') 39 | task = Task.once taskPath, text, attributes, options 40 | 41 | task.on 'asciidoctor-load:success', ({blockPositions}) => 42 | @blockPositions = blockPositions 43 | 44 | task.on 'asciidoctor-render:success', ({html}) -> 45 | console.warn "Rendering is empty: #{filePath}" if not html 46 | resolve html or '' 47 | 48 | task.on 'asciidoctor-render:error', ({code, errno, syscall, stack}) -> 49 | resolve """ 50 |
51 |

Asciidoctor.js error

52 |

Rendering error

53 |
54 |

Please verify your document syntax.

55 |

Details: #{stack.split('\n')[0]}

56 |

[code: #{code}, errno: #{errno}, syscall: #{syscall}]

57 |

#{stack}
58 |
59 |
60 | """ 61 | 62 | sanitize = (html) -> 63 | return html unless html 64 | 65 | o = cheerio.load(html) 66 | o('script').remove() 67 | attributesToRemove = [ 68 | 'onabort' 69 | 'onblur' 70 | 'onchange' 71 | 'onclick' 72 | 'ondbclick' 73 | 'onerror' 74 | 'onfocus' 75 | 'onkeydown' 76 | 'onkeypress' 77 | 'onkeyup' 78 | 'onload' 79 | 'onmousedown' 80 | 'onmousemove' 81 | 'onmouseover' 82 | 'onmouseout' 83 | 'onmouseup' 84 | 'onreset' 85 | 'onresize' 86 | 'onscroll' 87 | 'onselect' 88 | 'onsubmit' 89 | 'onunload' 90 | ] 91 | o('*').removeAttr(attribute) for attribute in attributesToRemove 92 | o.html() 93 | 94 | resolveImagePaths = (html, filePath) -> 95 | return html unless html 96 | 97 | [rootDirectory] = atom.project.relativizePath(filePath) 98 | o = cheerio.load(html) 99 | for imgElement in o('img') 100 | img = o(imgElement) 101 | if src = img.attr('src') 102 | appenderChar = if src.indexOf('?') is -1 then "?" else "&" 103 | invalidateCache = "#{appenderChar}atomcache=#{Date.now()}" 104 | 105 | if src.match /^(https?|atom):\/\// or 106 | src.startsWith process.resourcesPath or 107 | src.startsWith resourcePath or 108 | src.startsWith packagePath 109 | img.attr 'src', src + invalidateCache 110 | else if src[0] is '/' 111 | unless fs.isFileSync src 112 | if rootDirectory 113 | img.attr 'src', path.join(rootDirectory, src.substring(1) + invalidateCache) 114 | else 115 | img.attr 'src', path.resolve(path.dirname(filePath), "#{src}#{invalidateCache}") 116 | 117 | o.html() 118 | 119 | tokenizeCodeBlocks = (html, defaultLanguage='text') -> 120 | html = $(html) 121 | 122 | if fontFamily = atom.config.get 'editor.fontFamily' 123 | html.find('code').css 'font-family', fontFamily 124 | 125 | for preElement in $.merge(html.filter('pre'), html.find('pre')) 126 | codeBlock = $(preElement.firstChild) 127 | 128 | # Exclude text node to highlights 129 | # Because this creates a rendering bug with quotes substitutions #102 130 | if codeBlock[0]?.nodeType isnt Node.TEXT_NODE 131 | langExp = /language-([^ ]+)/g 132 | group = langExp.exec codeBlock.attr('class') 133 | 134 | if group and group.length 135 | fenceName = group[1] 136 | else 137 | fenceName = defaultLanguage 138 | 139 | # Exclude text block to highlights 140 | # Because this creates a rendering bug with quotes substitutions #193 141 | if fenceName is defaultLanguage 142 | preElement.className = '' 143 | else 144 | blockText = codeBlock.text() 145 | highlightedHtml = highlights 146 | fileContents: blockText 147 | scopeName: scopeForFenceName(fenceName, blockText) 148 | lineDivs: true 149 | editorDiv: true 150 | editorDivTag: 'pre' 151 | # The `editor` class messes things up as `.editor` has absolutely positioned lines 152 | editorDivClass: 'highlights editor-colors' 153 | 154 | highlightedBlock = $(highlightedHtml) 155 | 156 | highlightedBlock.addClass("lang-#{fenceName}") 157 | highlightedBlock.insertAfter(preElement) 158 | preElement.remove() 159 | 160 | html 161 | -------------------------------------------------------------------------------- /lib/main.coffee: -------------------------------------------------------------------------------- 1 | {CompositeDisposable} = require 'atom' 2 | url = require 'url' 3 | path = require 'path' 4 | fs = require 'fs-plus' 5 | pdfconverter = require './pdf-converter' 6 | 7 | AsciiDocPreviewView = null 8 | renderer = null # Defer until used 9 | 10 | isAsciiDocPreviewView = (object) -> 11 | AsciiDocPreviewView ?= require './asciidoc-preview-view' 12 | object instanceof AsciiDocPreviewView 13 | 14 | module.exports = 15 | 16 | subscriptions: null 17 | 18 | activate: -> 19 | @subscriptions = new CompositeDisposable 20 | 21 | if parseFloat(atom.getVersion()) < 1.7 22 | atom.deserializers.add 23 | name: 'AsciiDocPreviewView' 24 | deserialize: module.exports.createAsciiDocPreviewView.bind(module.exports) 25 | 26 | @subscriptions.add atom.commands.add 'atom-workspace', 27 | 'asciidoc-preview:toggle': => 28 | @toggle() 29 | 'asciidoc-preview:sync': -> 30 | keyPath = 'asciidoc-preview.scrollMode' 31 | atom.config.set(keyPath, not atom.config.get(keyPath)) 32 | 'asciidoc-preview:toggle-show-title': -> 33 | keyPath = 'asciidoc-preview.showTitle' 34 | atom.config.set(keyPath, not atom.config.get(keyPath)) 35 | 'asciidoc-preview:toggle-compat-mode': -> 36 | keyPath = 'asciidoc-preview.compatMode' 37 | atom.config.set(keyPath, not atom.config.get(keyPath)) 38 | 'asciidoc-preview:set-toc-none': -> 39 | atom.config.set('asciidoc-preview.tocType', 'none') 40 | 'asciidoc-preview:set-toc-preamble': -> 41 | atom.config.set('asciidoc-preview.tocType', 'preamble') 42 | 'asciidoc-preview:set-toc-macro': -> 43 | atom.config.set('asciidoc-preview.tocType', 'macro') 44 | 'asciidoc-preview:set-section-numbering-enabled-by-default': -> 45 | atom.config.set('asciidoc-preview.sectionNumbering', 'enabled-by-default') 46 | 'asciidoc-preview:set-section-numbering-always-enabled': -> 47 | atom.config.set('asciidoc-preview.sectionNumbering', 'always-enabled') 48 | 'asciidoc-preview:set-section-numbering-always-disabled': -> 49 | atom.config.set('asciidoc-preview.sectionNumbering', 'always-disabled') 50 | 'asciidoc-preview:set-section-numbering-not-specified': -> 51 | atom.config.set('asciidoc-preview.sectionNumbering', 'not-specified') 52 | 'asciidoc-preview:toggle-skip-front-matter': -> 53 | keyPath = 'asciidoc-preview.skipFrontMatter' 54 | atom.config.set(keyPath, not atom.config.get(keyPath)) 55 | 'asciidoc-preview:toggle-render-on-save-only': -> 56 | keyPath = 'asciidoc-preview.renderOnSaveOnly' 57 | atom.config.set(keyPath, not atom.config.get(keyPath)) 58 | 59 | previewFile = @previewFile.bind(this) 60 | fileExtensions = [ 61 | 'adoc' 62 | 'asciidoc' 63 | 'ad' 64 | 'asc' 65 | 'txt' 66 | ] 67 | for extension in fileExtensions 68 | @subscriptions.add atom.commands.add ".tree-view .file .name[data-name$=\\.#{extension}]", 'asciidoc-preview:preview-file', previewFile 69 | @subscriptions.add atom.commands.add ".tree-view .file .name[data-name$=\\.#{extension}]", 'asciidoc-preview:export-pdf', pdfconverter.convert 70 | 71 | atom.workspace.addOpener (uriToOpen) => 72 | try 73 | {protocol, host, pathname} = url.parse(uriToOpen) 74 | catch error 75 | return 76 | 77 | return unless protocol is 'asciidoc-preview:' 78 | 79 | try 80 | pathname = decodeURI(pathname) if pathname 81 | catch error 82 | return 83 | 84 | if host is 'editor' 85 | @createAsciiDocPreviewView editorId: pathname.substring(1) 86 | else 87 | @createAsciiDocPreviewView filePath: pathname 88 | 89 | createAsciiDocPreviewView: (state) -> 90 | if state.editorId or fs.isFileSync(state.filePath) 91 | AsciiDocPreviewView ?= require './asciidoc-preview-view' 92 | new AsciiDocPreviewView state 93 | 94 | toggle: -> 95 | if isAsciiDocPreviewView atom.workspace.getActivePaneItem() 96 | atom.workspace.destroyActivePaneItem() 97 | return 98 | 99 | editor = atom.workspace.getActiveTextEditor() 100 | return unless editor? 101 | 102 | grammars = atom.config.get('asciidoc-preview.grammars') ? [] 103 | return unless editor.getGrammar().scopeName in grammars 104 | 105 | @addPreviewForEditor(editor) unless @removePreviewForEditor(editor) 106 | 107 | uriForEditor: (editor) -> 108 | "asciidoc-preview://editor/#{editor.id}" 109 | 110 | removePreviewForEditor: (editor) -> 111 | uri = @uriForEditor editor 112 | previewPane = atom.workspace.paneForURI uri 113 | if previewPane? 114 | previewPane.destroyItem previewPane.itemForURI(uri) 115 | true 116 | else 117 | false 118 | 119 | addPreviewForEditor: (editor) -> 120 | uri = @uriForEditor editor 121 | previousActivePane = atom.workspace.getActivePane() 122 | options = 123 | searchAllPanes: true 124 | split: atom.config.get 'asciidoc-preview.openInPane' 125 | 126 | atom.workspace.open(uri, options).then (asciidocPreviewView) -> 127 | if isAsciiDocPreviewView asciidocPreviewView 128 | previousActivePane.activate() 129 | 130 | previewFile: ({target}) -> 131 | filePath = target.dataset.path 132 | return unless filePath 133 | 134 | for editor in atom.workspace.getTextEditors() when editor.getPath() is filePath 135 | @addPreviewForEditor editor 136 | return 137 | 138 | atom.workspace.open "asciidoc-preview://#{encodeURI(filePath)}", searchAllPanes: true 139 | 140 | deactivate: -> 141 | @subscriptions.dispose() 142 | -------------------------------------------------------------------------------- /spec/configuration-builder-spec.coffee: -------------------------------------------------------------------------------- 1 | {makeAttributes, makeOptions} = require '../lib/configuration-builder' 2 | 3 | describe "attributes-builder", -> 4 | 5 | describe "TOC type", -> 6 | 7 | it 'when tocType option is defined to none', -> 8 | atom.config.set 'asciidoc-preview.tocType', 'none' 9 | {tocType} = makeAttributes() 10 | 11 | expect(tocType).toBe '' 12 | 13 | it 'when tocType option is defined to preamble', -> 14 | atom.config.set 'asciidoc-preview.tocType', 'preamble' 15 | {tocType} = makeAttributes() 16 | 17 | expect(tocType).toBe 'toc=preamble toc2!' 18 | 19 | it 'when tocType option is defined to macro', -> 20 | atom.config.set 'asciidoc-preview.tocType', 'macro' 21 | {tocType} = makeAttributes() 22 | 23 | expect(tocType).toBe 'toc=macro toc2!' 24 | 25 | describe "Section numbering", -> 26 | 27 | it 'when sectionNumbering option is defined to enabled-by-default', -> 28 | atom.config.set 'asciidoc-preview.sectionNumbering', 'enabled-by-default' 29 | {sectnums} = makeAttributes() 30 | 31 | expect(sectnums).toBe 'sectnums=@' 32 | 33 | it 'when sectionNumbering option is defined to always-enabled', -> 34 | atom.config.set 'asciidoc-preview.sectionNumbering', 'always-enabled' 35 | {sectnums} = makeAttributes() 36 | 37 | expect(sectnums).toBe 'sectnums' 38 | 39 | it 'when sectionNumbering option is defined to always-disabled', -> 40 | atom.config.set 'asciidoc-preview.sectionNumbering', 'always-disabled' 41 | {sectnums} = makeAttributes() 42 | 43 | expect(sectnums).toBe 'sectnums!' 44 | 45 | it 'when sectionNumbering option is defined to not-specified', -> 46 | atom.config.set 'asciidoc-preview.sectionNumbering', 'not-specified' 47 | {sectnums} = makeAttributes() 48 | 49 | expect(sectnums).toBe '' 50 | 51 | describe "Default attributes", -> 52 | 53 | it 'when defaultAttributes option is defined', -> 54 | atom.config.set 'asciidoc-preview.defaultAttributes', 'asciidoctor options' 55 | {defaultAttributes} = makeAttributes() 56 | 57 | expect(defaultAttributes).toBe 'asciidoctor options' 58 | 59 | describe "Front matter", -> 60 | 61 | it 'when frontMatter option is defined to true', -> 62 | atom.config.set 'asciidoc-preview.frontMatter', true 63 | {skipFrontMatter} = makeAttributes() 64 | 65 | expect(skipFrontMatter).toBeFalsy() 66 | 67 | it 'when frontMatter option is defined to false', -> 68 | atom.config.set 'asciidoc-preview.frontMatter', false 69 | {skipFrontMatter} = makeAttributes() 70 | 71 | expect(skipFrontMatter).toBeTruthy() 72 | 73 | describe "Show title", -> 74 | 75 | it 'when showTitle option is defined to true', -> 76 | atom.config.set 'asciidoc-preview.showTitle', true 77 | {showTitle} = makeAttributes() 78 | 79 | expect(showTitle).toBe 'showtitle' 80 | 81 | it 'when showTitle option is defined to false', -> 82 | atom.config.set 'asciidoc-preview.showTitle', false 83 | {showTitle} = makeAttributes() 84 | 85 | expect(showTitle).toBe 'showtitle!' 86 | 87 | describe "Compat mode", -> 88 | 89 | it 'when compatMode option is defined to true', -> 90 | atom.config.set 'asciidoc-preview.compatMode', true 91 | {compatMode} = makeAttributes() 92 | 93 | expect(compatMode).toBe 'compat-mode=@' 94 | 95 | it 'when compatMode option is defined to false', -> 96 | atom.config.set 'asciidoc-preview.compatMode', false 97 | {compatMode} = makeAttributes() 98 | 99 | expect(compatMode).toBe '' 100 | 101 | describe "Force experimental", -> 102 | 103 | it 'when forceExperimental option is defined to true', -> 104 | atom.config.set 'asciidoc-preview.forceExperimental', true 105 | {forceExperimental} = makeAttributes() 106 | 107 | expect(forceExperimental).toBe 'experimental' 108 | 109 | it 'when forceExperimental option is defined to false', -> 110 | atom.config.set 'asciidoc-preview.forceExperimental', false 111 | {forceExperimental} = makeAttributes() 112 | 113 | expect(forceExperimental).toBe '' 114 | 115 | describe "Safe mode", -> 116 | 117 | it 'when safeMode option is defined to unsafe', -> 118 | atom.config.set 'asciidoc-preview.safeMode', 'unsafe' 119 | {safeMode} = makeOptions() 120 | 121 | expect(safeMode).toBe 'unsafe' 122 | 123 | it 'when safeMode option is defined to safe', -> 124 | atom.config.set 'asciidoc-preview.safeMode', 'safe' 125 | {safeMode} = makeOptions() 126 | 127 | expect(safeMode).toBe 'safe' 128 | 129 | it 'when safeMode option is defined to server', -> 130 | atom.config.set 'asciidoc-preview.safeMode', 'server' 131 | {safeMode} = makeOptions() 132 | 133 | expect(safeMode).toBe 'server' 134 | 135 | it 'when safeMode option is defined to secure', -> 136 | atom.config.set 'asciidoc-preview.safeMode', 'secure' 137 | {safeMode} = makeOptions() 138 | 139 | expect(safeMode).toBe 'secure' 140 | 141 | describe "Base directory", -> 142 | 143 | it 'when filePath is undefined and document path as base_dir', -> 144 | atom.config.set 'asciidoc-preview.baseDir', '{docdir}' 145 | {baseDir} = makeOptions() 146 | 147 | expect(baseDir).toBeUndefined() 148 | 149 | it 'when filePath is defined and document path as base_dir', -> 150 | atom.config.set 'asciidoc-preview.baseDir', '{docdir}' 151 | {baseDir} = makeOptions 'foo/bar.adoc' 152 | 153 | expect(baseDir).toBe 'foo' 154 | 155 | it 'when filePath is defined and use absolute path', -> 156 | atom.config.set 'asciidoc-preview.baseDir', '-' 157 | {baseDir} = makeOptions 'foo/bar.adoc' 158 | 159 | expect(baseDir).toBeUndefined() 160 | 161 | it 'when use a custom base_dir', -> 162 | atom.config.set 'asciidoc-preview.baseDir', 'fii' 163 | {baseDir} = makeOptions 'foo/bar.adoc' 164 | 165 | expect(baseDir).toBe 'fii' 166 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "asciidoc-preview", 3 | "main": "./lib/main", 4 | "version": "2.13.1", 5 | "description": "Show an HTML preview for the AsciiDoc content in the current editor", 6 | "repository": "https://github.com/asciidoctor/atom-asciidoc-preview", 7 | "license": "MIT", 8 | "keywords": [ 9 | "asciidoctor", 10 | "asciidoc", 11 | "preview" 12 | ], 13 | "styles": [ 14 | "font-awesome", 15 | "asciidoc-preview" 16 | ], 17 | "engines": { 18 | "atom": ">=1.24.0 <2.0.0" 19 | }, 20 | "dependencies": { 21 | "@asciidoctor/core": "~2.0.3", 22 | "atom-space-pen-views": "~2.2.0", 23 | "cheerio": "~0.22.0", 24 | "font-awesome": "^4.7.0", 25 | "fs-plus": "~2.9.3", 26 | "mustache": "~2.3.0", 27 | "opn": "^4.0.2", 28 | "underscore-plus": "~1.6.6" 29 | }, 30 | "devDependencies": { 31 | "coffeelint": "^1.15.0" 32 | }, 33 | "deserializers": { 34 | "AsciiDocPreviewView": "createAsciiDocPreviewView" 35 | }, 36 | "configSchema": { 37 | "scrollMode": { 38 | "title": "Synchronize the preview pane", 39 | "description": "If set, synchronize the preview pane with the AsciiDoc source pane.
WARNING: The scroll position on the preview pane does not automatically scroll the AsciiDoc source pane.", 40 | "type": "boolean", 41 | "default": true, 42 | "order": 0 43 | }, 44 | "renderOnSaveOnly": { 45 | "title": "Render on save only", 46 | "type": "boolean", 47 | "default": false, 48 | "order": 1 49 | }, 50 | "openInPane": { 51 | "type": "string", 52 | "default": "right", 53 | "enum": [ 54 | "left", 55 | "right", 56 | "up", 57 | "down" 58 | ], 59 | "order": 2 60 | }, 61 | "showTitle": { 62 | "description": "If set, displays an embedded document’s title.
Mutually exclusive with the notitle attribute.", 63 | "type": "boolean", 64 | "default": true, 65 | "order": 3 66 | }, 67 | "sectionNumbering": { 68 | "description": "Auto-number section titles.
- Enabled by default (equivalent to `-a sectnums=@`)
- Always enabled (equivalent to `-a sectnums`)
- Always disabled (equivalent to `-a sectnums!`)
- Not specified
https://asciidoctor.org/docs/user-manual/#numbering", 69 | "type": "string", 70 | "default": "enabled-by-default", 71 | "enum": [ 72 | "enabled-by-default", 73 | "always-enabled", 74 | "always-disabled", 75 | "not-specified" 76 | ], 77 | "order": 4 78 | }, 79 | "tocType": { 80 | "title": "Always show Table of Contents", 81 | "description": "Override `:toc:` attribute defined in documents.
Choose `none` to define manually the `:toc:` attribute in documents.", 82 | "type": "string", 83 | "default": "preamble", 84 | "enum": [ 85 | "none", 86 | "preamble", 87 | "macro" 88 | ], 89 | "order": 5 90 | }, 91 | "frontMatter": { 92 | "title": "Allow Front Matter", 93 | "description": "If set, consume YAML-style front matter at the top of the document and store it in the front-matter attribute.", 94 | "type": "boolean", 95 | "default": false, 96 | "order": 6 97 | }, 98 | "forceExperimental": { 99 | "title": "Always enable AsciiDoctor experimental extensions", 100 | "description": "The features behind this attribute are subject to change and may even be removed in a future version of AsciiDoctor.
Currently enables the UI macros (`button`, `menu` and `kbd`).", 101 | "type": "boolean", 102 | "default": false, 103 | "order": 7 104 | }, 105 | "compatMode": { 106 | "title": "Always enable compatibility mode (AsciiDoc Python)", 107 | "type": "boolean", 108 | "default": false, 109 | "order": 8 110 | }, 111 | "safeMode": { 112 | "description": "Set safe mode 'level': `unsafe`, `safe`, `server` or `secure`.
Disables potentially dangerous macros in source files, such as `include::[]`.
Set safe mode level to `safe` to enable include macros, but restrict access to ancestor paths of source file.
https://asciidoctor.org/docs/user-manual/#running-asciidoctor-securely
", 113 | "type": "string", 114 | "default": "safe", 115 | "enum": [ 116 | "unsafe", 117 | "safe", 118 | "server", 119 | "secure" 120 | ], 121 | "order": 9 122 | }, 123 | "baseDir": { 124 | "title": "Base directory", 125 | "description": "The default value `{docdir}` makes the base directory match the document directory.
Use the value `-` to use absolute path.
More information: https://asciidoctor.org/docs/user-manual/#ruby-api-options", 126 | "type": "string", 127 | "default": "{docdir}", 128 | "order": 10 129 | }, 130 | "defaultAttributes": { 131 | "type": "string", 132 | "default": "platform=opal platform-opal env=browser env-browser source-highlighter=highlight.js data-uri!", 133 | "order": 11 134 | }, 135 | "grammars": { 136 | "type": "array", 137 | "default": [ 138 | "source.asciidoc", 139 | "text.plain", 140 | "text.plain.null-grammar" 141 | ], 142 | "order": 12 143 | }, 144 | "saveAsHtml": { 145 | "title": "Save as HTML", 146 | "type": "object", 147 | "collapsed": true, 148 | "properties": { 149 | "openInEditor": { 150 | "title": "Open the generated HTML source code in Atom.", 151 | "type": "boolean", 152 | "default": false 153 | }, 154 | "openInBrowser": { 155 | "title": "Open the generated HTML file in your default browser.", 156 | "type": "boolean", 157 | "default": true 158 | } 159 | }, 160 | "order": 13 161 | }, 162 | "exportAsPdf": { 163 | "title": "Export as PDF [experimental]", 164 | "type": "object", 165 | "collapsed": true, 166 | "properties": { 167 | "enabled": { 168 | "title": "Enable PDF export using Asciidoctor PDF.", 169 | "description": "The [asciidoctor-pdf](https://github.com/asciidoctor/asciidoctor-pdf) command must be available on your `PATH`.", 170 | "type": "boolean", 171 | "default": false, 172 | "order": 1 173 | }, 174 | "openWithExternal": { 175 | "title": "Automatically open the PDF after generation with the default PDF viewer.", 176 | "type": "boolean", 177 | "default": true, 178 | "order": 2 179 | }, 180 | "pdfStyle": { 181 | "title": "Style (-a pdf-style=)", 182 | "description": "The name of the YAML theme file to load.
https://github.com/asciidoctor/asciidoctor-pdf/blob/master/docs/theming-guide.adoc#applying-your-theme", 183 | "type": "string", 184 | "default": "", 185 | "order": 3 186 | }, 187 | "pdfStylesDir": { 188 | "title": "Styles directory (-a pdf-stylesdir=)", 189 | "description": "The directory where the theme file is located. _Specifying an absolute path is recommended._", 190 | "type": "string", 191 | "default": "", 192 | "order": 4 193 | }, 194 | "pdfFontsDir": { 195 | "title": "Fonts directory (-a pdf-fontsdir=)", 196 | "description": "The directory where the fonts used by your theme, if any, are located. _Specifying an absolute path is recommended._", 197 | "type": "string", 198 | "default": "", 199 | "order": 5 200 | }, 201 | "arguments": { 202 | "title": "Command line additional arguments", 203 | "description": "ex: `-a pdf-page-size=Letter`", 204 | "type": "string", 205 | "default": "", 206 | "order": 6 207 | } 208 | }, 209 | "order": 14 210 | } 211 | } 212 | } 213 | -------------------------------------------------------------------------------- /lib/asciidoc-preview-view.coffee: -------------------------------------------------------------------------------- 1 | {Emitter, Disposable, CompositeDisposable, File} = require 'atom' 2 | {$, $$$, ScrollView} = require 'atom-space-pen-views' 3 | path = require 'path' 4 | fs = require 'fs-plus' 5 | _ = require 'underscore-plus' 6 | mustache = require 'mustache' 7 | opn = require 'opn' 8 | renderer = require './renderer' 9 | pdfconverter = require './pdf-converter' 10 | 11 | module.exports = 12 | class AsciiDocPreviewView extends ScrollView 13 | @content: -> 14 | @div class: 'asciidoc-preview native-key-bindings', tabindex: -1 15 | 16 | constructor: ({@editorId, @filePath}) -> 17 | super 18 | @emitter = new Emitter 19 | @disposables = new CompositeDisposable 20 | @loaded = false 21 | 22 | attached: -> 23 | return if @isAttached 24 | @isAttached = true 25 | 26 | if @editorId? 27 | @resolveEditor @editorId 28 | else if atom.workspace? 29 | @subscribeToFilePath @filePath 30 | else 31 | @disposables.add atom.packages.onDidActivateInitialPackages => 32 | @subscribeToFilePath @filePath 33 | 34 | serialize: -> 35 | deserializer: 'AsciiDocPreviewView' 36 | filePath: @getPath() ? @filePath 37 | editorId: @editorId 38 | 39 | destroy: -> 40 | @disposables.dispose() 41 | 42 | onDidChangeTitle: (callback) -> 43 | @emitter.on 'did-change-title', callback 44 | 45 | onDidChangeModified: (callback) -> 46 | # No op to suppress deprecation warning 47 | new Disposable 48 | 49 | onDidChangeAsciidoc: (callback) -> 50 | @emitter.on 'did-change-asciidoc', callback 51 | 52 | subscribeToFilePath: (filePath) -> 53 | @file = new File filePath 54 | @emitter.emit 'did-change-title' 55 | @handleEvents() 56 | @renderAsciiDoc() 57 | 58 | resolveEditor: (editorId) -> 59 | resolve = => 60 | @editor = @editorForId editorId 61 | 62 | if @editor? 63 | @emitter.emit 'did-change-title' if @editor? 64 | @handleEvents() 65 | @renderAsciiDoc() 66 | else 67 | # The editor this preview was created for has been closed so close 68 | # this preview since a preview cannot be rendered without an editor 69 | atom.workspace?.paneForItem(this)?.destroyItem(this) 70 | 71 | if atom.workspace? 72 | resolve() 73 | else 74 | @disposables.add atom.packages.onDidActivateInitialPackages resolve 75 | 76 | editorForId: (editorId) -> 77 | for editor in atom.workspace.getTextEditors() 78 | return editor if editor.id?.toString() is editorId.toString() 79 | null 80 | 81 | handleEvents: -> 82 | @disposables.add atom.grammars.onDidAddGrammar => _.debounce((=> @renderAsciiDoc()), 250) 83 | @disposables.add atom.grammars.onDidUpdateGrammar _.debounce((=> @renderAsciiDoc()), 250) 84 | 85 | @disposables.add atom.commands.add @element, 86 | 'core:move-up': => 87 | @scrollUp() 88 | 'core:move-down': => 89 | @scrollDown() 90 | 'asciidoc-preview:export-pdf': => 91 | pdfconverter.convertFromPath(@filePath ? @getPath()) 92 | 'core:copy': (event) => 93 | event.stopPropagation() if @copyToClipboard() 94 | 'asciidoc-preview:zoom-in': => 95 | zoomLevel = parseFloat(@css 'zoom') or 1 96 | @css 'zoom', zoomLevel + .1 97 | 'asciidoc-preview:zoom-out': => 98 | zoomLevel = parseFloat(@css 'zoom') or 1 99 | @css 'zoom', zoomLevel - .1 100 | 'asciidoc-preview:reset-zoom': => 101 | @css 'zoom', 1 102 | 103 | changeHandler = => 104 | @renderAsciiDoc() 105 | 106 | pane = atom.workspace.paneForItem(this) 107 | if pane? and pane isnt atom.workspace.getActivePane() 108 | pane.activateItem(this) 109 | 110 | renderOnChange = -> 111 | saveOnly = atom.config.get 'asciidoc-preview.renderOnSaveOnly' 112 | changeHandler() if not saveOnly 113 | 114 | scrollPreview = (event, callback) -> 115 | if atom.config.get 'asciidoc-preview.scrollMode' 116 | blockId = renderer.getBlockId event.newBufferPosition.row 117 | if blockId? 118 | if target = document.getElementById(blockId) 119 | callback target.offsetTop 120 | # else 121 | # TODO Find the nearest block 122 | 123 | if @file? 124 | @disposables.add @file.onDidChange changeHandler 125 | else if @editor? 126 | @disposables.add @editor.onDidChangeCursorPosition (event) => scrollPreview event, (top) => @scrollTop top 127 | @disposables.add @editor.onDidChangePath => @emitter.emit 'did-change-title' 128 | buffer = @editor.getBuffer() 129 | @disposables.add buffer.onDidStopChanging renderOnChange 130 | @disposables.add buffer.onDidSave changeHandler 131 | @disposables.add buffer.onDidReload renderOnChange 132 | 133 | @disposables.add atom.config.onDidChange 'asciidoc-preview.showTitle', changeHandler 134 | @disposables.add atom.config.onDidChange 'asciidoc-preview.compatMode', changeHandler 135 | @disposables.add atom.config.onDidChange 'asciidoc-preview.safeMode', changeHandler 136 | @disposables.add atom.config.onDidChange 'asciidoc-preview.defaultAttributes', changeHandler 137 | @disposables.add atom.config.onDidChange 'asciidoc-preview.tocType', changeHandler 138 | @disposables.add atom.config.onDidChange 'asciidoc-preview.frontMatter', changeHandler 139 | @disposables.add atom.config.onDidChange 'asciidoc-preview.sectionNumbering', changeHandler 140 | @disposables.add atom.config.onDidChange 'asciidoc-preview.forceExperimental', changeHandler 141 | @disposables.add atom.config.onDidChange 'asciidoc-preview.baseDir', changeHandler 142 | 143 | renderAsciiDoc: -> 144 | @showLoading() unless @loaded 145 | @getAsciiDocSource().then (source) => @renderAsciiDocText(source) if source? 146 | 147 | getAsciiDocSource: -> 148 | if @file?.getPath() 149 | @file.read() 150 | else if @editor? 151 | Promise.resolve(@editor.getText()) 152 | else 153 | Promise.resolve(null) 154 | 155 | renderAsciiDocText: (text) -> 156 | renderer.toHtml text, @getPath() 157 | .then (html) => 158 | @loading = false 159 | @html(html) 160 | @enableAnchorScroll html, (top) => 161 | @scrollTop top 162 | 163 | @emitter.emit 'did-change-asciidoc' 164 | @originalTrigger('asciidoc-preview:asciidoc-changed') 165 | 166 | enableAnchorScroll: (html, callback) -> 167 | html = $(html) 168 | for linkElement in html.find('a') 169 | link = $(linkElement) 170 | if hrefLink = link.attr('href') 171 | continue if not hrefLink.match(/^#/) 172 | # Because jQuery uses CSS syntax for selecting elements, some characters are interpreted as CSS notation. 173 | # In order to tell jQuery to treat these characters literally rather than as CSS notation, they must be "escaped" by placing two backslashes in front of them. 174 | if target = $(hrefLink.replace(/(\/|:|\.|\[|\]|,|\)|\()/g, '\\$1')) 175 | continue if not target[0] 176 | top = target[0].offsetTop 177 | do (top) -> 178 | link.on 'click', (e) -> 179 | top = top 180 | callback top 181 | 182 | getTitle: -> 183 | if @file? 184 | "#{path.basename @getPath()} Preview" 185 | else if @editor? 186 | "#{@editor.getTitle()} Preview" 187 | else 188 | 'AsciiDoc Preview' 189 | 190 | getIconName: -> 191 | 'eye' 192 | 193 | getURI: -> 194 | if @file? 195 | "asciidoc-preview://#{@getPath()}" 196 | else 197 | "asciidoc-preview://editor/#{@editorId}" 198 | 199 | getPath: -> 200 | if @file? 201 | @file.getPath() 202 | else if @editor? 203 | @editor.getPath() 204 | 205 | showLoading: -> 206 | @loading = true 207 | if not @firstloadingdone? 208 | @firstloadingdone = true 209 | @html $$$ -> 210 | @div class: 'asciidoc-spinner', 'Loading AsciiDoc\u2026' 211 | 212 | copyToClipboard: -> 213 | return false if @loading 214 | 215 | selection = window.getSelection() 216 | selectedText = selection.toString() 217 | selectedNode = selection.baseNode 218 | 219 | # Use default copy event handler if there is selected text inside this view 220 | return false if selectedText and selectedNode? and $.contains(@[0], selectedNode) 221 | 222 | atom.clipboard.write @[0].innerHTML 223 | true 224 | 225 | getSaveDialogOptions: -> 226 | defaultPath = @getPath() 227 | if defaultPath 228 | defaultPath += '.html' 229 | else 230 | defaultPath = 'untitled.adoc.html' 231 | if projectPath = atom.project.getPaths()[0] 232 | defaultPath = path.join(projectPath, defaultPath) 233 | 234 | return {defaultPath} 235 | 236 | saveAs: (htmlFilePath) -> 237 | if @loading 238 | atom.notifications.addWarning('Please wait until the Asciidoctor Preview has finished loading before saving') 239 | return 240 | 241 | packPath = atom.packages.resolvePackagePath 'asciidoc-preview' 242 | templatePath = path.join packPath, 'templates', 'default.html' 243 | 244 | @getAsciiDocSource() 245 | .then (source) => 246 | renderer.toRawHtml source, @getPath() 247 | .then (html) => 248 | model = 249 | content: html 250 | style: fs.readFileSync path.join(packPath, 'node_modules/@asciidoctor/core/dist/css/asciidoctor.css'), 'utf8' 251 | title: $(@html).find('h1').text() or path.basename htmlFilePath, '.html' 252 | .then (model) -> 253 | template = fs.readFileSync templatePath, 'utf8' 254 | mustache.to_html template, model 255 | .then (htmlContent) -> 256 | fs.writeFileSync htmlFilePath, htmlContent 257 | .then -> 258 | if atom.config.get 'asciidoc-preview.saveAsHtml.openInEditor' 259 | atom.workspace.open htmlFilePath 260 | 261 | if atom.config.get 'asciidoc-preview.saveAsHtml.openInBrowser' 262 | opn(htmlFilePath).catch (error) -> 263 | atom.notifications.addError error.toString(), detail: error?.stack or '', dismissable: true 264 | console.error error 265 | -------------------------------------------------------------------------------- /spec/fixtures/test.asciidoc: -------------------------------------------------------------------------------- 1 | = Asciidoctor.js 1.5.0 released to Bower and npm! 2 | Guillaume Grossetie ; Anthonny Quérouil 3 | 2014-08-23 4 | :revdate: 2014-08-23 13:20:39 -0600 5 | // Settings: 6 | :page-tags: [release, asciidoctor.js] 7 | :compat-mode!: 8 | :source-highlighter: pygments 9 | ifndef::imagesdir[:imagesdir: ../images] 10 | // URIs: 11 | :uri-bower: http://bower.io 12 | :uri-npm: https://www.npmjs.org 13 | :uri-repo: https://github.com/asciidoctor/asciidoctor.js 14 | :uri-frontend-guide: {uri-repo}#front-end-development 15 | :uri-backend-guide: {uri-repo}#back-end-development 16 | :uri-migration: http://asciidoctor.org/docs/migration/ 17 | :uri-asciidoctorj-repo: https://github.com/asciidoctor/asciidoctorj 18 | :uri-asciidoctorjs-in-asciidoctorj-issue: {uri-asciidoctorj-repo}/issues/189 19 | :uri-nashorn: http://openjdk.java.net/projects/nashorn 20 | :uri-dynjs: http://dynjs.org 21 | :uri-asciidocfx: https://github.com/rahmanusta/AsciidocFX 22 | :uri-asciidoctorjs-npm: https://www.npmjs.org/package/asciidoctor.js 23 | :uri-atom: https://atom.io 24 | :uri-asciidoc-preview-atom: {uri-atom}/packages/asciidoc-preview 25 | :uri-asciidoc-preview-brackets: https://github.com/asciidoctor/brackets-asciidoc-preview 26 | :uri-tedbergeron-repo: https://github.com/tedbergeron 27 | :uri-grunt-asciidoctor-assemble-repo: {uri-tedbergeron-repo}/grunt-asciidoctor-assemble 28 | :uri-grunt-asciidoctor-npm: https://www.npmjs.org/package/grunt-asciidoctor 29 | :uri-gruntjs: http://gruntjs.com 30 | :uri-opal-contributors: https://github.com/opal/opal/graphs/contributors 31 | :uri-asciidoctor-1-5-0: http://asciidoctor.org/news/2014/08/12/asciidoctor-1-5-0-released/#spotlight-asciidoctorjs 32 | 33 | The release train is on the move! Version 1.5.0 of Asciidoctor.js has been released and is now available in {uri-bower}[Bower] and {uri-npm}[npm]. 34 | This release is an important step toward making Asciidoctor.js widely available to the JavaScript ecosystem. 35 | 36 | image::bower-npm-logos.png[Bower and npm,225,100,role=right] 37 | 38 | [verse] 39 | Asciidoctor in JavaScript. 40 | It was a dream. 41 | Then it was a prototype. 42 | Now, it's the real deal. 43 | 44 | .What is Asciidoctor.js? 45 | **** 46 | {uri-repo}[Asciidoctor.js] is the official library for using Asciidoctor in JavaScript. 47 | It shares the same source code as Asciidoctor and is transcompiled to JavaScript using Opal. 48 | With Asciidoctor.js, you can convert AsciiDoc content or analyze the structure of a parsed AsciiDoc document from JavaScript. 49 | **** 50 | 51 | IMPORTANT: When upgrading to Asciidoctor 1.5.0, please refer to the {uri-migration}[migration guide] for details about how to migrate your content. 52 | 53 | == Release highlights 54 | 55 | === Asciidoctor.js is Asciidoctor 56 | 57 | As mentioned in the {uri-asciidoctor-1-5-0}[release notes for Asciidoctor 1.5.0], we worked hard to align Asciidoctor.js (JavaScript) and Asciidoctor core (Ruby). 58 | That means you can expect Asciidoctor.js to parse and convert documents just like the original. 59 | Even includes work! 60 | 61 | [WARNING] 62 | ==== 63 | Getting certain features to work, like includes, requires special consideration because JavaScript is a different environment than Ruby and there are even key variations between JavaScript environments! 64 | 65 | For example, reading an include file in Ruby is just a matter of using the normal Ruby IO API. 66 | In a browser environment, we have to use `XMLHttpRequest` (i.e., Ajax) as the IO API instead. 67 | If Asciidoctor.js is running on Node.js, we have to use the Node IO API, `fs.readSync()`, to make it work. 68 | ==== 69 | 70 | Rest assured we're continuing to work on smoothing any differences to bring all the great features of Asciidoctor core to JavaScript. 71 | 72 | Read on to learn how to get your hands on Asciidoctor.js! 73 | 74 | === Using Asciidoctor.js is easier than ever before 75 | 76 | If you are a frontend or backend JavaScript developer, you're only one command away from getting the latest version of Asciidoctor.js 77 | 78 | === Bower package 79 | 80 | [source, bash] 81 | .Installing Asciidoctor.js with Bower 82 | ---- 83 | $ bower install asciidoctor.js --save 84 | ---- 85 | 86 | TIP: The optional `--save` flag automatically adds the package to your project's dependencies. 87 | 88 | Once the package installed, you can add the following `script` tag to your HTML page: 89 | 90 | [source,html] 91 | ---- 92 | 93 | ---- 94 | 95 | The `asciidoctor-all.min.js` is a `minified` version and includes Asciidoctor core, extensions API and Opal. 96 | 97 | Here is a simple example that converts AsciiDoc to HTML5 using the `doctype: 'inline'` option and `showtitle` attribute: 98 | 99 | TEST 100 | 101 | include::include.adoc[] 102 | 103 | See the {uri-frontend-guide}[Front-end development guide] to learn more about the Bower package. 104 | 105 | === npm package 106 | 107 | [source, bash] 108 | .Installing Asciidoctor.js with npm 109 | ---- 110 | $ npm install asciidoctor.js --save 111 | ---- 112 | 113 | TIP: The optional `--save` flag automatically adds the package to your project's dependencies. 114 | 115 | Once the package is installed, the first thing to do is to load the `asciidoctor.js` module using `require`, then you're ready to start using the API: 116 | 117 | .sample.js 118 | [source,javascript] 119 | ---- 120 | var asciidoctor = require('asciidoctor.js')(); // <1> 121 | var opal = asciidoctor.Opal; // <2> 122 | 123 | var processor = null; 124 | var useExtensions = true; 125 | 126 | if (useExtensions) { 127 | processor = asciidoctor.Asciidoctor(true); // <3> 128 | } 129 | else { 130 | processor = asciidoctor.Asciidoctor(); // <4> 131 | } 132 | 133 | var content = "http://asciidoctor.org[*Asciidoctor*] " + 134 | "running on http://opalrb.org[_Opal_] " + 135 | "brings AsciiDoc to Node.js!"; 136 | var options = opal.hash2( 137 | ['doctype', 'attributes'], 138 | {doctype: 'inline', attributes: ['showtitle']}); 139 | var html = processor.$convert(content, options); // <5> 140 | console.log(html); // <6> 141 | ---- 142 | <1> Load the Asciidoctor.js library 143 | <2> Retrieve and alias the top-level Opal namespace 144 | <3> Instantiate Asciidoctor with extensions enabled 145 | <4> Instantiate Asciidoctor without extensions 146 | <5> Convert AsciiDoc content to HTML5 using Asciidoctor.js 147 | <6> Print the HTML5 output to the console 148 | 149 | Save the file as `sample.js` and run it using the `node` command: 150 | 151 | $ node sample.js 152 | 153 | You should see the following output in your terminal: 154 | 155 | [.output] 156 | .... 157 | Asciidoctor running on Opal brings AsciiDoc to Node.js!

158 | .... 159 | 160 | IMPORTANT: To be successful with Asciidoctor.js, it's important to understand how to work with Ruby objects in the JavaScript environment. 161 | We recommend that you browse the http://opalrb.org/docs/using_ruby_from_javascript[Opal documentation] to learn how method names are mapped and what data types it expects. 162 | 163 | See the {uri-backend-guide}[Back-end development guide] to learn more about the npm package. 164 | 165 | === Asciidoctor.js is heating up on Node 166 | 167 | Node.js is where the hottest JavaScript is happening and npm is the package manager that manages and distributes that hotness. 168 | We wanted Asciidoctor.js to be a part of this ecosystem. 169 | We also needed it there to start building tools. 170 | That's why we took the first step of packaging Asciidoctor.js as an npm package...in fact, several! 171 | Asciidoctor now has a new playground! 172 | 173 | Here are the npm packages that are published: 174 | 175 | {uri-asciidoctorjs-npm}[asciidoctor.js]:: the main npm package for Asciidoctor.js 176 | {uri-grunt-asciidoctor-npm}[grunt-asciidoctor]:: an npm package for processing AsciiDoc source files in your {uri-gruntjs}[Grunt] project 177 | 178 | Here's how the community is playing with these packages already: 179 | 180 | {uri-asciidoc-preview-atom}[asciidoc-preview (Atom Editor)]:: A plugin for Atom that shows you a preview of your document while you type! 181 | {uri-asciidoc-preview-brackets}[asciidoc-preview (Brackets Editor)]:: An extension for Brackets that shows you a preview of your document while you type! 182 | {uri-grunt-asciidoctor-assemble-repo}[grunt-asciidoctor-assemble]:: a static website generator for {uri-gruntjs}[Grunt] by {uri-tedbergeron-repo}[@tedbergeron] 183 | 184 | Of course there are still challenges, but we'll solve them. 185 | Head over to the {uri-repo}[Asciidoctor.js project] to get involved. 186 | 187 | Let us play this new game! 188 | 189 | === Asciidoctor.js on the JVM 190 | 191 | You read that right. 192 | The browser ain't the only JavaScript game in town. 193 | (And we're not talking about JavaScript engines that have escaped from the browser, like Node.js.) 194 | We're talking about the most polyglot of polyglot runtimes, _the JVM_. 195 | 196 | Alex Soto is working at getting {uri-asciidoctorjs-in-asciidoctorj-issue}[Asciidoctor.js integrated into AsciidoctorJ] so you can use it on the JVM using {uri-nashorn}[Nashorn], {uri-dynjs}[dynjs] and other JavaScript engines that run on it. 197 | The {uri-asciidocfx}[AsciidocFX project] is already using Asciidoctor.js on Nashorn, so it's more than just an idea! 198 | 199 | There are still several challenges to tackle to ensure Asciidoctor.js runs smoothly on the JVM, such as getting includes working. 200 | Head over to the {uri-asciidoctorj-repo}[AsciidoctorJ project] to get involved and help make it happen! 201 | 202 | == Acknowledgments 203 | 204 | The alignment of Asciidoctor.js with Asciidoctor core was a major effort. 205 | It required input from a lot of people and they really pulled together to meet this challenge. 206 | 207 | We want to especially thank the {uri-opal-contributors}[Opal developers], notably Adam Beynon, meh and Elia Schito, for making Asciidoctor.js happen. 208 | They were very responsive to our effort, making changes and fixes to Opal and generally providing input that allowed us to continuously move forward. 209 | 210 | We also want to thank Anthonny Quérouil for crafting a Grunt build to compile, aggregate and compress Asciidoctor.js and for helping to get the artifacts published to Bower and npm. 211 | 212 | Thanks to everyone who tested Asciidoctor.js, either directly or by using the tools. 213 | Your participation has helped Asciidoctor.js become the real deal! 214 | 215 | If you have questions or feedback, we encourage you to participate in the http://discuss.asciidoctor.org[discussion list]. 216 | Talk to you there! 217 | -------------------------------------------------------------------------------- /bundle/droid-sans/LICENSE.txt: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright [yyyy] [name of copyright owner] 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /bundle/open-sans/LICENSE.txt: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright [yyyy] [name of copyright owner] 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | ## [v2.10.1](https://github.com/asciidoctor/atom-asciidoc-preview/tree/v2.10.1) (2017-04-29) 4 | [Full Changelog](https://github.com/asciidoctor/atom-asciidoc-preview/compare/v2.10.0...v2.10.1) 5 | 6 | **Closed issues:** 7 | 8 | - Highlighted source blocks should respect syntax theme [\#231](https://github.com/asciidoctor/atom-asciidoc-preview/issues/231) 9 | 10 | **Merged pull requests:** 11 | 12 | - feat: add pdf export entry to preview menu. [\#238](https://github.com/asciidoctor/atom-asciidoc-preview/pull/238) ([ldez](https://github.com/ldez)) 13 | 14 | ## [v2.10.0](https://github.com/asciidoctor/atom-asciidoc-preview/tree/v2.10.0) (2017-04-02) 15 | [Full Changelog](https://github.com/asciidoctor/atom-asciidoc-preview/compare/v2.9.2...v2.10.0) 16 | 17 | **Implemented enhancements:** 18 | 19 | - Don't force scrolling on the x axis [\#233](https://github.com/asciidoctor/atom-asciidoc-preview/issues/233) 20 | - Don't force scrolling on the x axis [\#234](https://github.com/asciidoctor/atom-asciidoc-preview/pull/234) ([mojavelinux](https://github.com/mojavelinux)) 21 | 22 | **Fixed bugs:** 23 | 24 | - Syntax highlighting styles don't get applied in preview window [\#229](https://github.com/asciidoctor/atom-asciidoc-preview/issues/229) 25 | - refactor: change Highlights provider. [\#230](https://github.com/asciidoctor/atom-asciidoc-preview/pull/230) ([ldez](https://github.com/ldez)) 26 | 27 | ## [v2.9.2](https://github.com/asciidoctor/atom-asciidoc-preview/tree/v2.9.2) (2017-04-01) 28 | [Full Changelog](https://github.com/asciidoctor/atom-asciidoc-preview/compare/v2.9.1...v2.9.2) 29 | 30 | **Fixed bugs:** 31 | 32 | - Cannot load /usr/lib64/atom/node\_modules/highlights [\#223](https://github.com/asciidoctor/atom-asciidoc-preview/issues/223) 33 | - fix: Highlights on Fedora. [\#228](https://github.com/asciidoctor/atom-asciidoc-preview/pull/228) ([ldez](https://github.com/ldez)) 34 | 35 | **Closed issues:** 36 | 37 | - Offset scroll preview window when syncing with source [\#222](https://github.com/asciidoctor/atom-asciidoc-preview/issues/222) 38 | 39 | ## [v2.9.1](https://github.com/asciidoctor/atom-asciidoc-preview/tree/v2.9.1) (2017-03-22) 40 | [Full Changelog](https://github.com/asciidoctor/atom-asciidoc-preview/compare/v2.9.0...v2.9.1) 41 | 42 | **Fixed bugs:** 43 | 44 | - Save as HTML raises an error [\#224](https://github.com/asciidoctor/atom-asciidoc-preview/issues/224) 45 | - fix: wrong file path when save as HTML. [\#225](https://github.com/asciidoctor/atom-asciidoc-preview/pull/225) ([ldez](https://github.com/ldez)) 46 | 47 | **Closed issues:** 48 | 49 | - After updating the preview window display the bottom of it [\#206](https://github.com/asciidoctor/atom-asciidoc-preview/issues/206) 50 | 51 | ## [v2.9.0](https://github.com/asciidoctor/atom-asciidoc-preview/tree/v2.9.0) (2017-03-13) 52 | [Full Changelog](https://github.com/asciidoctor/atom-asciidoc-preview/compare/v2.8.0...v2.9.0) 53 | 54 | **Implemented enhancements:** 55 | 56 | - Add option to sync scroll of editor and preview [\#82](https://github.com/asciidoctor/atom-asciidoc-preview/issues/82) 57 | 58 | **Closed issues:** 59 | 60 | - Specifying theme file for PDF export [\#208](https://github.com/asciidoctor/atom-asciidoc-preview/issues/208) 61 | 62 | **Merged pull requests:** 63 | 64 | - doc: enhance readme. [\#220](https://github.com/asciidoctor/atom-asciidoc-preview/pull/220) ([ldez](https://github.com/ldez)) 65 | - feat: Add support for asciidoctor-pdf additional arguments. [\#214](https://github.com/asciidoctor/atom-asciidoc-preview/pull/214) ([ldez](https://github.com/ldez)) 66 | 67 | ## [v2.8.0](https://github.com/asciidoctor/atom-asciidoc-preview/tree/v2.8.0) (2017-03-12) 68 | [Full Changelog](https://github.com/asciidoctor/atom-asciidoc-preview/compare/v2.7.2...v2.8.0) 69 | 70 | **Implemented enhancements:** 71 | 72 | - Synchronize the preview pane with the AsciiDoc source pane [\#216](https://github.com/asciidoctor/atom-asciidoc-preview/pull/216) ([ldez](https://github.com/ldez)) 73 | 74 | **Fixed bugs:** 75 | 76 | - Include macro not working using an attribute in the path [\#189](https://github.com/asciidoctor/atom-asciidoc-preview/issues/189) 77 | 78 | **Closed issues:** 79 | 80 | - Asciidoc Preview Don't popup [\#215](https://github.com/asciidoctor/atom-asciidoc-preview/issues/215) 81 | - Inner document links not working within included pages [\#191](https://github.com/asciidoctor/atom-asciidoc-preview/issues/191) 82 | 83 | **Merged pull requests:** 84 | 85 | - chore: update CI configuration. [\#217](https://github.com/asciidoctor/atom-asciidoc-preview/pull/217) ([ldez](https://github.com/ldez)) 86 | 87 | ## [v2.7.2](https://github.com/asciidoctor/atom-asciidoc-preview/tree/v2.7.2) (2017-02-17) 88 | [Full Changelog](https://github.com/asciidoctor/atom-asciidoc-preview/compare/v2.7.1...v2.7.2) 89 | 90 | **Fixed bugs:** 91 | 92 | - "Export as PDF" fails for filenames with whitespaces [\#212](https://github.com/asciidoctor/atom-asciidoc-preview/issues/212) 93 | - feat\(pdf\): support filenames with whitespaces. [\#213](https://github.com/asciidoctor/atom-asciidoc-preview/pull/213) ([ldez](https://github.com/ldez)) 94 | 95 | **Closed issues:** 96 | 97 | - matching underscores inside quoted code block are treated as italic markers [\#207](https://github.com/asciidoctor/atom-asciidoc-preview/issues/207) 98 | - "save as html" error [\#203](https://github.com/asciidoctor/atom-asciidoc-preview/issues/203) 99 | 100 | **Merged pull requests:** 101 | 102 | - feat: update libraries versions. [\#211](https://github.com/asciidoctor/atom-asciidoc-preview/pull/211) ([ldez](https://github.com/ldez)) 103 | 104 | ## [v2.7.1](https://github.com/asciidoctor/atom-asciidoc-preview/tree/v2.7.1) (2016-12-06) 105 | [Full Changelog](https://github.com/asciidoctor/atom-asciidoc-preview/compare/v2.7.0...v2.7.1) 106 | 107 | ## [v2.7.0](https://github.com/asciidoctor/atom-asciidoc-preview/tree/v2.7.0) (2016-11-25) 108 | [Full Changelog](https://github.com/asciidoctor/atom-asciidoc-preview/compare/v2.6.0...v2.7.0) 109 | 110 | **Implemented enhancements:** 111 | 112 | - Upgrade to Asciidoctor.js 1.5.5-4 [\#202](https://github.com/asciidoctor/atom-asciidoc-preview/pull/202) ([Mogztter](https://github.com/Mogztter)) 113 | 114 | **Fixed bugs:** 115 | 116 | - Callouts prevent rendering block [\#111](https://github.com/asciidoctor/atom-asciidoc-preview/issues/111) 117 | 118 | **Closed issues:** 119 | 120 | - Live previewing make editor stuck [\#200](https://github.com/asciidoctor/atom-asciidoc-preview/issues/200) 121 | - Preview window does not fill the frame [\#199](https://github.com/asciidoctor/atom-asciidoc-preview/issues/199) 122 | - HTML entity as variable replacement in headers [\#198](https://github.com/asciidoctor/atom-asciidoc-preview/issues/198) 123 | 124 | ## [v2.6.0](https://github.com/asciidoctor/atom-asciidoc-preview/tree/v2.6.0) (2016-08-15) 125 | [Full Changelog](https://github.com/asciidoctor/atom-asciidoc-preview/compare/v2.5.3...v2.6.0) 126 | 127 | **Fixed bugs:** 128 | 129 | - Document can't be exported as PDF [\#195](https://github.com/asciidoctor/atom-asciidoc-preview/issues/195) 130 | - fix\(pdf\): remove bash interactive option [\#197](https://github.com/asciidoctor/atom-asciidoc-preview/pull/197) ([ldez](https://github.com/ldez)) 131 | 132 | ## [v2.5.3](https://github.com/asciidoctor/atom-asciidoc-preview/tree/v2.5.3) (2016-08-14) 133 | [Full Changelog](https://github.com/asciidoctor/atom-asciidoc-preview/compare/v2.5.2...v2.5.3) 134 | 135 | **Fixed bugs:** 136 | 137 | - Starting quotes code block with italics breaks block rendering. [\#193](https://github.com/asciidoctor/atom-asciidoc-preview/issues/193) 138 | - fix: text code block [\#194](https://github.com/asciidoctor/atom-asciidoc-preview/pull/194) ([ldez](https://github.com/ldez)) 139 | 140 | **Closed issues:** 141 | 142 | - Failed to activate the asciidoc-preview package [\#190](https://github.com/asciidoctor/atom-asciidoc-preview/issues/190) 143 | 144 | ## [v2.5.2](https://github.com/asciidoctor/atom-asciidoc-preview/tree/v2.5.2) (2016-07-09) 145 | [Full Changelog](https://github.com/asciidoctor/atom-asciidoc-preview/compare/v2.5.1...v2.5.2) 146 | 147 | **Fixed bugs:** 148 | 149 | - Uncaught TypeError: Cannot read property 'parent' of null [\#184](https://github.com/asciidoctor/atom-asciidoc-preview/issues/184) 150 | 151 | **Closed issues:** 152 | 153 | - include::xxx.... is rendering as URL [\#182](https://github.com/asciidoctor/atom-asciidoc-preview/issues/182) 154 | - Images do not refresh. [\#95](https://github.com/asciidoctor/atom-asciidoc-preview/issues/95) 155 | 156 | **Merged pull requests:** 157 | 158 | - feat: invalidate image cache [\#192](https://github.com/asciidoctor/atom-asciidoc-preview/pull/192) ([ldez](https://github.com/ldez)) 159 | - refactor: split options and attributes [\#188](https://github.com/asciidoctor/atom-asciidoc-preview/pull/188) ([ldez](https://github.com/ldez)) 160 | 161 | ## [v2.5.1](https://github.com/asciidoctor/atom-asciidoc-preview/tree/v2.5.1) (2016-06-18) 162 | [Full Changelog](https://github.com/asciidoctor/atom-asciidoc-preview/compare/v2.5.0...v2.5.1) 163 | 164 | ## [v2.5.0](https://github.com/asciidoctor/atom-asciidoc-preview/tree/v2.5.0) (2016-06-18) 165 | [Full Changelog](https://github.com/asciidoctor/atom-asciidoc-preview/compare/v2.4.2...v2.5.0) 166 | 167 | **Merged pull requests:** 168 | 169 | - feat: base directory management [\#186](https://github.com/asciidoctor/atom-asciidoc-preview/pull/186) ([ldez](https://github.com/ldez)) 170 | 171 | ## [v2.4.2](https://github.com/asciidoctor/atom-asciidoc-preview/tree/v2.4.2) (2016-06-16) 172 | [Full Changelog](https://github.com/asciidoctor/atom-asciidoc-preview/compare/v2.4.1...v2.4.2) 173 | 174 | **Merged pull requests:** 175 | 176 | - refactor: safe rendering [\#185](https://github.com/asciidoctor/atom-asciidoc-preview/pull/185) ([ldez](https://github.com/ldez)) 177 | - refactor: remove dead code [\#183](https://github.com/asciidoctor/atom-asciidoc-preview/pull/183) ([ldez](https://github.com/ldez)) 178 | 179 | ## [v2.4.1](https://github.com/asciidoctor/atom-asciidoc-preview/tree/v2.4.1) (2016-06-15) 180 | [Full Changelog](https://github.com/asciidoctor/atom-asciidoc-preview/compare/v2.4.0...v2.4.1) 181 | 182 | **Fixed bugs:** 183 | 184 | - Update preview on save does not work: Render on save [\#180](https://github.com/asciidoctor/atom-asciidoc-preview/issues/180) 185 | - Fix: render on save [\#181](https://github.com/asciidoctor/atom-asciidoc-preview/pull/181) ([ldez](https://github.com/ldez)) 186 | 187 | ## [v2.4.0](https://github.com/asciidoctor/atom-asciidoc-preview/tree/v2.4.0) (2016-06-14) 188 | [Full Changelog](https://github.com/asciidoctor/atom-asciidoc-preview/compare/v2.3.2...v2.4.0) 189 | 190 | **Implemented enhancements:** 191 | 192 | - feat: open generated HTML file in browser [\#177](https://github.com/asciidoctor/atom-asciidoc-preview/pull/177) ([ldez](https://github.com/ldez)) 193 | 194 | **Fixed bugs:** 195 | 196 | - Preview pane throws an exception when Asciidoctor is trying to write something to stdout [\#159](https://github.com/asciidoctor/atom-asciidoc-preview/issues/159) 197 | 198 | **Merged pull requests:** 199 | 200 | - feat: open PDF after generating [\#179](https://github.com/asciidoctor/atom-asciidoc-preview/pull/179) ([ldez](https://github.com/ldez)) 201 | - refactor: move base directory construct [\#178](https://github.com/asciidoctor/atom-asciidoc-preview/pull/178) ([ldez](https://github.com/ldez)) 202 | - Refactor: pdf converter [\#176](https://github.com/asciidoctor/atom-asciidoc-preview/pull/176) ([ldez](https://github.com/ldez)) 203 | 204 | ## [v2.3.2](https://github.com/asciidoctor/atom-asciidoc-preview/tree/v2.3.2) (2016-06-11) 205 | [Full Changelog](https://github.com/asciidoctor/atom-asciidoc-preview/compare/v2.3.1...v2.3.2) 206 | 207 | **Fixed bugs:** 208 | 209 | - Windows stdout hook [\#175](https://github.com/asciidoctor/atom-asciidoc-preview/pull/175) ([ldez](https://github.com/ldez)) 210 | 211 | ## [v2.3.1](https://github.com/asciidoctor/atom-asciidoc-preview/tree/v2.3.1) (2016-06-07) 212 | [Full Changelog](https://github.com/asciidoctor/atom-asciidoc-preview/compare/v2.3.0...v2.3.1) 213 | 214 | **Implemented enhancements:** 215 | 216 | - Support "Save As PDF..." [\#167](https://github.com/asciidoctor/atom-asciidoc-preview/issues/167) 217 | 218 | **Fixed bugs:** 219 | 220 | - feat: add error page for rendering [\#174](https://github.com/asciidoctor/atom-asciidoc-preview/pull/174) ([ldez](https://github.com/ldez)) 221 | 222 | ## [v2.3.0](https://github.com/asciidoctor/atom-asciidoc-preview/tree/v2.3.0) (2016-06-07) 223 | [Full Changelog](https://github.com/asciidoctor/atom-asciidoc-preview/compare/v2.2.5...v2.3.0) 224 | 225 | **Implemented enhancements:** 226 | 227 | - feature: export as PDF \(experimental\) [\#170](https://github.com/asciidoctor/atom-asciidoc-preview/pull/170) ([ldez](https://github.com/ldez)) 228 | 229 | **Merged pull requests:** 230 | 231 | - New templating system \(Part 1\) [\#171](https://github.com/asciidoctor/atom-asciidoc-preview/pull/171) ([ldez](https://github.com/ldez)) 232 | - Refactor: isolation of attributes' construction [\#169](https://github.com/asciidoctor/atom-asciidoc-preview/pull/169) ([ldez](https://github.com/ldez)) 233 | 234 | ## [v2.2.5](https://github.com/asciidoctor/atom-asciidoc-preview/tree/v2.2.5) (2016-06-03) 235 | [Full Changelog](https://github.com/asciidoctor/atom-asciidoc-preview/compare/v2.2.4...v2.2.5) 236 | 237 | **Fixed bugs:** 238 | 239 | - Named substitutions breaks in asciidoc-preview [\#102](https://github.com/asciidoctor/atom-asciidoc-preview/issues/102) 240 | - fix: substitutions quotes [\#165](https://github.com/asciidoctor/atom-asciidoc-preview/pull/165) ([ldez](https://github.com/ldez)) 241 | 242 | ## [v2.2.4](https://github.com/asciidoctor/atom-asciidoc-preview/tree/v2.2.4) (2016-06-03) 243 | [Full Changelog](https://github.com/asciidoctor/atom-asciidoc-preview/compare/v2.2.3...v2.2.4) 244 | 245 | **Fixed bugs:** 246 | 247 | - Spacing between text and URLs is often too small [\#106](https://github.com/asciidoctor/atom-asciidoc-preview/issues/106) 248 | 249 | **Merged pull requests:** 250 | 251 | - refactor: add deserializer configuration [\#166](https://github.com/asciidoctor/atom-asciidoc-preview/pull/166) ([ldez](https://github.com/ldez)) 252 | 253 | ## [v2.2.3](https://github.com/asciidoctor/atom-asciidoc-preview/tree/v2.2.3) (2016-06-02) 254 | [Full Changelog](https://github.com/asciidoctor/atom-asciidoc-preview/compare/v2.2.2...v2.2.3) 255 | 256 | **Merged pull requests:** 257 | 258 | - refactor: section numbering menu [\#164](https://github.com/asciidoctor/atom-asciidoc-preview/pull/164) ([ldez](https://github.com/ldez)) 259 | 260 | ## [v2.2.2](https://github.com/asciidoctor/atom-asciidoc-preview/tree/v2.2.2) (2016-06-01) 261 | [Full Changelog](https://github.com/asciidoctor/atom-asciidoc-preview/compare/v2.2.1...v2.2.2) 262 | 263 | **Closed issues:** 264 | 265 | - Turning auto-numbering off [\#58](https://github.com/asciidoctor/atom-asciidoc-preview/issues/58) 266 | 267 | **Merged pull requests:** 268 | 269 | - feature: section numbering [\#162](https://github.com/asciidoctor/atom-asciidoc-preview/pull/162) ([ldez](https://github.com/ldez)) 270 | 271 | ## [v2.2.1](https://github.com/asciidoctor/atom-asciidoc-preview/tree/v2.2.1) (2016-06-01) 272 | [Full Changelog](https://github.com/asciidoctor/atom-asciidoc-preview/compare/v2.2.0...v2.2.1) 273 | 274 | **Closed issues:** 275 | 276 | - The loading gif is truncated [\#160](https://github.com/asciidoctor/atom-asciidoc-preview/issues/160) 277 | 278 | **Merged pull requests:** 279 | 280 | - fix: loading gif size [\#161](https://github.com/asciidoctor/atom-asciidoc-preview/pull/161) ([ldez](https://github.com/ldez)) 281 | 282 | ## [v2.2.0](https://github.com/asciidoctor/atom-asciidoc-preview/tree/v2.2.0) (2016-05-31) 283 | [Full Changelog](https://github.com/asciidoctor/atom-asciidoc-preview/compare/v2.1.2...v2.2.0) 284 | 285 | **Implemented enhancements:** 286 | 287 | - Choose display pane & open from tree view [\#158](https://github.com/asciidoctor/atom-asciidoc-preview/pull/158) ([ldez](https://github.com/ldez)) 288 | 289 | **Fixed bugs:** 290 | 291 | - Uncaught TypeError: atom.workspace.open\(...\).done is not a function [\#124](https://github.com/asciidoctor/atom-asciidoc-preview/issues/124) 292 | - Save As HTML... : Uncaught TypeError: atom.project.getPath is not a function [\#119](https://github.com/asciidoctor/atom-asciidoc-preview/issues/119) 293 | - Status bar element doesn't display on startup [\#68](https://github.com/asciidoctor/atom-asciidoc-preview/issues/68) 294 | 295 | **Closed issues:** 296 | 297 | - Explain the role of safe mode in the README [\#87](https://github.com/asciidoctor/atom-asciidoc-preview/issues/87) 298 | 299 | ## [v2.1.2](https://github.com/asciidoctor/atom-asciidoc-preview/tree/v2.1.2) (2016-05-31) 300 | [Full Changelog](https://github.com/asciidoctor/atom-asciidoc-preview/compare/v2.1.1...v2.1.2) 301 | 302 | **Merged pull requests:** 303 | 304 | - refactor: Setting options naming [\#156](https://github.com/asciidoctor/atom-asciidoc-preview/pull/156) ([ldez](https://github.com/ldez)) 305 | 306 | ## [v2.1.1](https://github.com/asciidoctor/atom-asciidoc-preview/tree/v2.1.1) (2016-05-31) 307 | [Full Changelog](https://github.com/asciidoctor/atom-asciidoc-preview/compare/v2.1.0...v2.1.1) 308 | 309 | **Closed issues:** 310 | 311 | - Settings to disable package keybinding [\#155](https://github.com/asciidoctor/atom-asciidoc-preview/issues/155) 312 | 313 | **Merged pull requests:** 314 | 315 | - feat: Settings to disable package keybinding [\#157](https://github.com/asciidoctor/atom-asciidoc-preview/pull/157) ([ldez](https://github.com/ldez)) 316 | 317 | ## [v2.1.0](https://github.com/asciidoctor/atom-asciidoc-preview/tree/v2.1.0) (2016-05-31) 318 | [Full Changelog](https://github.com/asciidoctor/atom-asciidoc-preview/compare/v2.0.0...v2.1.0) 319 | 320 | **Merged pull requests:** 321 | 322 | - Refactor: styling [\#154](https://github.com/asciidoctor/atom-asciidoc-preview/pull/154) ([ldez](https://github.com/ldez)) 323 | 324 | ## [v2.0.0](https://github.com/asciidoctor/atom-asciidoc-preview/tree/v2.0.0) (2016-05-29) 325 | [Full Changelog](https://github.com/asciidoctor/atom-asciidoc-preview/compare/v1.0.4...v2.0.0) 326 | 327 | **Fixed bugs:** 328 | 329 | - Unable to install on Atom 1.7.4 running on windows 10 [\#150](https://github.com/asciidoctor/atom-asciidoc-preview/issues/150) 330 | 331 | **Merged pull requests:** 332 | 333 | - feat: more user friendly settings [\#153](https://github.com/asciidoctor/atom-asciidoc-preview/pull/153) ([ldez](https://github.com/ldez)) 334 | 335 | ## [v1.0.4](https://github.com/asciidoctor/atom-asciidoc-preview/tree/v1.0.4) (2016-05-26) 336 | [Full Changelog](https://github.com/asciidoctor/atom-asciidoc-preview/compare/v1.0.3...v1.0.4) 337 | 338 | **Fixed bugs:** 339 | 340 | - fix: remove Highlights dependency [\#152](https://github.com/asciidoctor/atom-asciidoc-preview/pull/152) ([ldez](https://github.com/ldez)) 341 | 342 | ## [v1.0.3](https://github.com/asciidoctor/atom-asciidoc-preview/tree/v1.0.3) (2016-05-26) 343 | [Full Changelog](https://github.com/asciidoctor/atom-asciidoc-preview/compare/v1.0.2...v1.0.3) 344 | 345 | **Fixed bugs:** 346 | 347 | - fix: Highlights dependency [\#151](https://github.com/asciidoctor/atom-asciidoc-preview/pull/151) ([ldez](https://github.com/ldez)) 348 | 349 | ## [v1.0.2](https://github.com/asciidoctor/atom-asciidoc-preview/tree/v1.0.2) (2016-05-25) 350 | [Full Changelog](https://github.com/asciidoctor/atom-asciidoc-preview/compare/v1.0.1...v1.0.2) 351 | 352 | **Implemented enhancements:** 353 | 354 | - Use pathwatcher built-in in atom [\#31](https://github.com/asciidoctor/atom-asciidoc-preview/issues/31) 355 | 356 | **Merged pull requests:** 357 | 358 | - Prepare tests [\#149](https://github.com/asciidoctor/atom-asciidoc-preview/pull/149) ([ldez](https://github.com/ldez)) 359 | - feat: remove Markdown Preview dependency [\#148](https://github.com/asciidoctor/atom-asciidoc-preview/pull/148) ([ldez](https://github.com/ldez)) 360 | 361 | ## [v1.0.1](https://github.com/asciidoctor/atom-asciidoc-preview/tree/v1.0.1) (2016-05-24) 362 | [Full Changelog](https://github.com/asciidoctor/atom-asciidoc-preview/compare/v1.0.0...v1.0.1) 363 | 364 | **Implemented enhancements:** 365 | 366 | - doc: add GitHub templates [\#146](https://github.com/asciidoctor/atom-asciidoc-preview/pull/146) ([ldez](https://github.com/ldez)) 367 | 368 | **Merged pull requests:** 369 | 370 | - chore: add keywords/tags [\#147](https://github.com/asciidoctor/atom-asciidoc-preview/pull/147) ([ldez](https://github.com/ldez)) 371 | - doc: add contributing guide [\#145](https://github.com/asciidoctor/atom-asciidoc-preview/pull/145) ([ldez](https://github.com/ldez)) 372 | 373 | ## [v1.0.0](https://github.com/asciidoctor/atom-asciidoc-preview/tree/v1.0.0) (2016-05-24) 374 | [Full Changelog](https://github.com/asciidoctor/atom-asciidoc-preview/compare/v0.9.0...v1.0.0) 375 | 376 | **Fixed bugs:** 377 | 378 | - Suggestion popup for attributes pops up everywhere in line after an attribute [\#130](https://github.com/asciidoctor/atom-asciidoc-preview/issues/130) 379 | - Atom's preview link is broken in 0.8.0 [\#143](https://github.com/asciidoctor/atom-asciidoc-preview/issues/143) 380 | - Unable to install on Atom 1.3.2 running on windows 10 [\#116](https://github.com/asciidoctor/atom-asciidoc-preview/issues/116) 381 | - Installing on Windows 7 Fails with atom-space-pen-views module error. [\#112](https://github.com/asciidoctor/atom-asciidoc-preview/issues/112) 382 | - asciidoc-preview install fail [\#110](https://github.com/asciidoctor/atom-asciidoc-preview/issues/110) 383 | - can't install success with atom [\#107](https://github.com/asciidoctor/atom-asciidoc-preview/issues/107) 384 | - Failed to load the asciidoc-preview package [\#91](https://github.com/asciidoctor/atom-asciidoc-preview/issues/91) 385 | 386 | **Closed issues:** 387 | 388 | - Migrate autocompletion to the grammar package. [\#139](https://github.com/asciidoctor/atom-asciidoc-preview/issues/139) 389 | - Suggestion popup for attributes contains unset attributes as well [\#131](https://github.com/asciidoctor/atom-asciidoc-preview/issues/131) 390 | 391 | **Merged pull requests:** 392 | 393 | - feat: remove autocomplete [\#140](https://github.com/asciidoctor/atom-asciidoc-preview/pull/140) ([ldez](https://github.com/ldez)) 394 | 395 | ## [v0.9.0](https://github.com/asciidoctor/atom-asciidoc-preview/tree/v0.9.0) (2016-05-24) 396 | [Full Changelog](https://github.com/asciidoctor/atom-asciidoc-preview/compare/v0.8.0...v0.9.0) 397 | 398 | **Fixed bugs:** 399 | 400 | - fix: preview link [\#144](https://github.com/asciidoctor/atom-asciidoc-preview/pull/144) ([ldez](https://github.com/ldez)) 401 | 402 | ## [v0.8.0](https://github.com/asciidoctor/atom-asciidoc-preview/tree/v0.8.0) (2016-05-24) 403 | [Full Changelog](https://github.com/asciidoctor/atom-asciidoc-preview/compare/v0.7.0...v0.8.0) 404 | 405 | **Fixed bugs:** 406 | 407 | - preview crashes with ifeval [\#108](https://github.com/asciidoctor/atom-asciidoc-preview/issues/108) 408 | 409 | **Merged pull requests:** 410 | 411 | - Upgrade to Asciidoctor 1.5.4 \(version 1.5.5-1\) [\#132](https://github.com/asciidoctor/atom-asciidoc-preview/pull/132) ([Mogztter](https://github.com/Mogztter)) 412 | 413 | ## [v0.7.0](https://github.com/asciidoctor/atom-asciidoc-preview/tree/v0.7.0) (2016-05-24) 414 | [Full Changelog](https://github.com/asciidoctor/atom-asciidoc-preview/compare/v0.6.1...v0.7.0) 415 | 416 | **Closed issues:** 417 | 418 | - Release 0.7.0 before remove autocomplete [\#142](https://github.com/asciidoctor/atom-asciidoc-preview/issues/142) 419 | 420 | ## [v0.6.1](https://github.com/asciidoctor/atom-asciidoc-preview/tree/v0.6.1) (2016-05-24) 421 | [Full Changelog](https://github.com/asciidoctor/atom-asciidoc-preview/compare/v0.6.0...v0.6.1) 422 | 423 | **Implemented enhancements:** 424 | 425 | - Add autocomplete of attribute references in editor pane [\#34](https://github.com/asciidoctor/atom-asciidoc-preview/issues/34) 426 | 427 | **Fixed bugs:** 428 | 429 | - Unicode ids are broken [\#121](https://github.com/asciidoctor/atom-asciidoc-preview/issues/121) 430 | 431 | **Closed issues:** 432 | 433 | - Add Atom package url to the header. [\#141](https://github.com/asciidoctor/atom-asciidoc-preview/issues/141) 434 | - \[feature request\] tree-view of headers for quick navigation [\#126](https://github.com/asciidoctor/atom-asciidoc-preview/issues/126) 435 | - Uncaught Error: Syntax error, unrecognized expression: \#look here \(\) [\#125](https://github.com/asciidoctor/atom-asciidoc-preview/issues/125) 436 | - Uncaught Error: Syntax error, unrecognized expression: \#wsd-e.i.r.p. [\#123](https://github.com/asciidoctor/atom-asciidoc-preview/issues/123) 437 | - Pane crashed after trying to split preview pane [\#118](https://github.com/asciidoctor/atom-asciidoc-preview/issues/118) 438 | - Uncaught Error: Syntax error, unrecognized expression: \#../data\_structure/data.adoc [\#117](https://github.com/asciidoctor/atom-asciidoc-preview/issues/117) 439 | - Uncaught Error: Syntax error, unrecognized expression: \#eclipse-4-rcp/JPA-persistence.adoc [\#115](https://github.com/asciidoctor/atom-asciidoc-preview/issues/115) 440 | - Mention right-click options in README [\#109](https://github.com/asciidoctor/atom-asciidoc-preview/issues/109) 441 | - The preview text is hard to read because it is light grey [\#105](https://github.com/asciidoctor/atom-asciidoc-preview/issues/105) 442 | - Uncaught TypeError: undefined is not a function [\#104](https://github.com/asciidoctor/atom-asciidoc-preview/issues/104) 443 | - No syntax highlighting for certain macros [\#103](https://github.com/asciidoctor/atom-asciidoc-preview/issues/103) 444 | - Attribute :data-uri: causes asciidoc-preview to hang [\#97](https://github.com/asciidoctor/atom-asciidoc-preview/issues/97) 445 | - Preview crashes when cross-referencing an anchor with a :: in the name [\#51](https://github.com/asciidoctor/atom-asciidoc-preview/issues/51) 446 | 447 | **Merged pull requests:** 448 | 449 | - chore: Travis CI & AppVeyor [\#138](https://github.com/asciidoctor/atom-asciidoc-preview/pull/138) ([ldez](https://github.com/ldez)) 450 | - Update link to Asciidoctor.js on README [\#135](https://github.com/asciidoctor/atom-asciidoc-preview/pull/135) ([Mogztter](https://github.com/Mogztter)) 451 | - Resolves \#105, use \#333 color for text [\#134](https://github.com/asciidoctor/atom-asciidoc-preview/pull/134) ([Mogztter](https://github.com/Mogztter)) 452 | - Resolves \#125, escape ': . \[ \] , \( \)' characters in links [\#133](https://github.com/asciidoctor/atom-asciidoc-preview/pull/133) ([Mogztter](https://github.com/Mogztter)) 453 | - Update default.html [\#129](https://github.com/asciidoctor/atom-asciidoc-preview/pull/129) ([ojn](https://github.com/ojn)) 454 | - Add detail and demo to README [\#114](https://github.com/asciidoctor/atom-asciidoc-preview/pull/114) ([Xcodo](https://github.com/Xcodo)) 455 | - add skip-front-matter to default attributes [\#101](https://github.com/asciidoctor/atom-asciidoc-preview/pull/101) ([251](https://github.com/251)) 456 | 457 | ## [v0.6.0](https://github.com/asciidoctor/atom-asciidoc-preview/tree/v0.6.0) (2015-08-12) 458 | [Full Changelog](https://github.com/asciidoctor/atom-asciidoc-preview/compare/v0.5.1...v0.6.0) 459 | 460 | **Fixed bugs:** 461 | 462 | - Preferences : there is two entries for the option showToc [\#29](https://github.com/asciidoctor/atom-asciidoc-preview/issues/29) 463 | 464 | **Closed issues:** 465 | 466 | - Toc shows when adding an single-line admonition under the title [\#99](https://github.com/asciidoctor/atom-asciidoc-preview/issues/99) 467 | - \[object Object\].view is deprecated. [\#96](https://github.com/asciidoctor/atom-asciidoc-preview/issues/96) 468 | - Use the `atom-workspace` tag instead of the `workspace` class. [\#93](https://github.com/asciidoctor/atom-asciidoc-preview/issues/93) 469 | 470 | **Merged pull requests:** 471 | 472 | - improved toc configuration using a select option instead of a toogle [\#100](https://github.com/asciidoctor/atom-asciidoc-preview/pull/100) ([abelsromero](https://github.com/abelsromero)) 473 | - Disable data-uri by default - fixes issue \#97 [\#98](https://github.com/asciidoctor/atom-asciidoc-preview/pull/98) ([akhayyat](https://github.com/akhayyat)) 474 | 475 | ## [v0.5.1](https://github.com/asciidoctor/atom-asciidoc-preview/tree/v0.5.1) (2015-06-05) 476 | [Full Changelog](https://github.com/asciidoctor/atom-asciidoc-preview/compare/v0.5.0...v0.5.1) 477 | 478 | **Fixed bugs:** 479 | 480 | - keymap is broken [\#64](https://github.com/asciidoctor/atom-asciidoc-preview/issues/64) 481 | 482 | **Closed issues:** 483 | 484 | - Support without Asciidoctor [\#92](https://github.com/asciidoctor/atom-asciidoc-preview/issues/92) 485 | - Package.activateConfig is deprecated. [\#90](https://github.com/asciidoctor/atom-asciidoc-preview/issues/90) 486 | - Atom.Object.defineProperty.get is deprecated. [\#81](https://github.com/asciidoctor/atom-asciidoc-preview/issues/81) 487 | - Pane.itemForUri is deprecated. [\#80](https://github.com/asciidoctor/atom-asciidoc-preview/issues/80) 488 | - Workspace.getEditors is deprecated. [\#79](https://github.com/asciidoctor/atom-asciidoc-preview/issues/79) 489 | - wrappedOpener is deprecated. [\#78](https://github.com/asciidoctor/atom-asciidoc-preview/issues/78) 490 | - Workspace.paneForUri is deprecated. [\#77](https://github.com/asciidoctor/atom-asciidoc-preview/issues/77) 491 | - Workspace.getEditors is deprecated. [\#76](https://github.com/asciidoctor/atom-asciidoc-preview/issues/76) 492 | - wrappedOpener is deprecated. [\#75](https://github.com/asciidoctor/atom-asciidoc-preview/issues/75) 493 | - Package.activateConfig is deprecated. [\#74](https://github.com/asciidoctor/atom-asciidoc-preview/issues/74) 494 | - Atom.Object.defineProperty.get is deprecated. [\#71](https://github.com/asciidoctor/atom-asciidoc-preview/issues/71) 495 | - Atom.Object.defineProperty.get is deprecated. [\#70](https://github.com/asciidoctor/atom-asciidoc-preview/issues/70) 496 | - Atom.Object.defineProperty.get is deprecated. [\#69](https://github.com/asciidoctor/atom-asciidoc-preview/issues/69) 497 | - Status bar element doesn't play well [\#67](https://github.com/asciidoctor/atom-asciidoc-preview/issues/67) 498 | - Style elements within text editors using the `atom-text-editor::shadow` selector or the `.atom-text-editor.less` file extension.If you want to target overlay elements, target them directly or as descendants of `atom-overlay` elements. [\#62](https://github.com/asciidoctor/atom-asciidoc-preview/issues/62) 499 | - Use the `atom-workspace` tag instead of the `workspace` class. [\#57](https://github.com/asciidoctor/atom-asciidoc-preview/issues/57) 500 | - Use the `atom-text-editor` tag instead of the `editor-colors` class. [\#56](https://github.com/asciidoctor/atom-asciidoc-preview/issues/56) 501 | - Style elements within text editors using the `atom-text-editor::shadow` selector or the `.atom-text-editor.less` file extension.If you want to target overlay elements, target them directly or as descendants of `atom-overlay` elements. [\#55](https://github.com/asciidoctor/atom-asciidoc-preview/issues/55) 502 | - Atom.Object.defineProperty.get is deprecated. [\#52](https://github.com/asciidoctor/atom-asciidoc-preview/issues/52) 503 | - use another keybinding [\#26](https://github.com/asciidoctor/atom-asciidoc-preview/issues/26) 504 | 505 | ## [v0.5.0](https://github.com/asciidoctor/atom-asciidoc-preview/tree/v0.5.0) (2015-05-10) 506 | [Full Changelog](https://github.com/asciidoctor/atom-asciidoc-preview/compare/v0.4.3...v0.5.0) 507 | 508 | **Fixed bugs:** 509 | 510 | - Fails to load in Atom 0.182.0 [\#63](https://github.com/asciidoctor/atom-asciidoc-preview/issues/63) 511 | 512 | **Closed issues:** 513 | 514 | - Include macro doesn't work [\#84](https://github.com/asciidoctor/atom-asciidoc-preview/issues/84) 515 | - Adds "Render on change" to status bar for new, unsaved Plain Text buffers [\#73](https://github.com/asciidoctor/atom-asciidoc-preview/issues/73) 516 | - Smart quotes not properly previewed [\#66](https://github.com/asciidoctor/atom-asciidoc-preview/issues/66) 517 | - Can't Preview [\#65](https://github.com/asciidoctor/atom-asciidoc-preview/issues/65) 518 | - Use New autocomplete-plus API [\#54](https://github.com/asciidoctor/atom-asciidoc-preview/issues/54) 519 | 520 | **Merged pull requests:** 521 | 522 | - make "safe" the default safe mode [\#86](https://github.com/asciidoctor/atom-asciidoc-preview/pull/86) ([mojavelinux](https://github.com/mojavelinux)) 523 | - fix name of default toc config setting [\#85](https://github.com/asciidoctor/atom-asciidoc-preview/pull/85) ([mojavelinux](https://github.com/mojavelinux)) 524 | 525 | ## [v0.4.3](https://github.com/asciidoctor/atom-asciidoc-preview/tree/v0.4.3) (2015-02-23) 526 | [Full Changelog](https://github.com/asciidoctor/atom-asciidoc-preview/compare/v0.4.2...v0.4.3) 527 | 528 | **Closed issues:** 529 | 530 | - Use the `atom-workspace` tag instead of the `workspace` class. [\#61](https://github.com/asciidoctor/atom-asciidoc-preview/issues/61) 531 | - Use the `atom-workspace` tag instead of the `workspace` class. [\#60](https://github.com/asciidoctor/atom-asciidoc-preview/issues/60) 532 | - Using + for syntax highlighting doesn't render in Atom Preview [\#53](https://github.com/asciidoctor/atom-asciidoc-preview/issues/53) 533 | - unable to install asciidoc-preview package [\#50](https://github.com/asciidoctor/atom-asciidoc-preview/issues/50) 534 | 535 | **Merged pull requests:** 536 | 537 | - Deprecated fixes [\#59](https://github.com/asciidoctor/atom-asciidoc-preview/pull/59) ([phdelodder](https://github.com/phdelodder)) 538 | 539 | ## [v0.4.2](https://github.com/asciidoctor/atom-asciidoc-preview/tree/v0.4.2) (2015-01-20) 540 | [Full Changelog](https://github.com/asciidoctor/atom-asciidoc-preview/compare/v0.4.1...v0.4.2) 541 | 542 | **Implemented enhancements:** 543 | 544 | - Update Package To Use New autocomplete-plus API [\#45](https://github.com/asciidoctor/atom-asciidoc-preview/issues/45) 545 | 546 | **Closed issues:** 547 | 548 | - include directive does not work [\#46](https://github.com/asciidoctor/atom-asciidoc-preview/issues/46) 549 | 550 | **Merged pull requests:** 551 | 552 | - fix \#45: Update Package To Use New autocomplete-plus API [\#49](https://github.com/asciidoctor/atom-asciidoc-preview/pull/49) ([anthonny](https://github.com/anthonny)) 553 | - fix include:: [\#48](https://github.com/asciidoctor/atom-asciidoc-preview/pull/48) ([cobomi](https://github.com/cobomi)) 554 | 555 | ## [v0.4.1](https://github.com/asciidoctor/atom-asciidoc-preview/tree/v0.4.1) (2014-12-26) 556 | [Full Changelog](https://github.com/asciidoctor/atom-asciidoc-preview/compare/v0.4.0...v0.4.1) 557 | 558 | **Implemented enhancements:** 559 | 560 | - Add option to toggle compat-mode [\#37](https://github.com/asciidoctor/atom-asciidoc-preview/issues/37) 561 | 562 | **Closed issues:** 563 | 564 | - fontawesome icons [\#43](https://github.com/asciidoctor/atom-asciidoc-preview/issues/43) 565 | - release 0.4.0 stylesheet has some visual inconsistencies [\#38](https://github.com/asciidoctor/atom-asciidoc-preview/issues/38) 566 | - Keyboard inline macro's not enabled [\#35](https://github.com/asciidoctor/atom-asciidoc-preview/issues/35) 567 | 568 | **Merged pull requests:** 569 | 570 | - clean up render mode in status bar [\#41](https://github.com/asciidoctor/atom-asciidoc-preview/pull/41) ([graemeworthy](https://github.com/graemeworthy)) 571 | 572 | ## [v0.4.0](https://github.com/asciidoctor/atom-asciidoc-preview/tree/v0.4.0) (2014-08-24) 573 | [Full Changelog](https://github.com/asciidoctor/atom-asciidoc-preview/compare/v0.3.0...v0.4.0) 574 | 575 | ## [v0.3.0](https://github.com/asciidoctor/atom-asciidoc-preview/tree/v0.3.0) (2014-08-13) 576 | [Full Changelog](https://github.com/asciidoctor/atom-asciidoc-preview/compare/v0.2.3...v0.3.0) 577 | 578 | **Closed issues:** 579 | 580 | - apm install asciidoc-preview fail with error [\#33](https://github.com/asciidoctor/atom-asciidoc-preview/issues/33) 581 | - install fails on Windows7: node-gyp rebuild [\#32](https://github.com/asciidoctor/atom-asciidoc-preview/issues/32) 582 | - installation failed ... [\#30](https://github.com/asciidoctor/atom-asciidoc-preview/issues/30) 583 | 584 | ## [v0.2.3](https://github.com/asciidoctor/atom-asciidoc-preview/tree/v0.2.3) (2014-06-19) 585 | [Full Changelog](https://github.com/asciidoctor/atom-asciidoc-preview/compare/v0.2.2...v0.2.3) 586 | 587 | **Closed issues:** 588 | 589 | - Save as HTML ... body content only is saved. [\#28](https://github.com/asciidoctor/atom-asciidoc-preview/issues/28) 590 | 591 | ## [v0.2.2](https://github.com/asciidoctor/atom-asciidoc-preview/tree/v0.2.2) (2014-06-17) 592 | [Full Changelog](https://github.com/asciidoctor/atom-asciidoc-preview/compare/v0.2.1...v0.2.2) 593 | 594 | **Closed issues:** 595 | 596 | - Dropped last line in ruby code [\#27](https://github.com/asciidoctor/atom-asciidoc-preview/issues/27) 597 | 598 | ## [v0.2.1](https://github.com/asciidoctor/atom-asciidoc-preview/tree/v0.2.1) (2014-06-02) 599 | [Full Changelog](https://github.com/asciidoctor/atom-asciidoc-preview/compare/v0.2.0...v0.2.1) 600 | 601 | **Closed issues:** 602 | 603 | - Remove loading splash screen after initial render [\#25](https://github.com/asciidoctor/atom-asciidoc-preview/issues/25) 604 | 605 | ## [v0.2.0](https://github.com/asciidoctor/atom-asciidoc-preview/tree/v0.2.0) (2014-05-28) 606 | [Full Changelog](https://github.com/asciidoctor/atom-asciidoc-preview/compare/v0.1.2...v0.2.0) 607 | 608 | **Implemented enhancements:** 609 | 610 | - Add title attribute to links [\#20](https://github.com/asciidoctor/atom-asciidoc-preview/issues/20) 611 | - Add option to render on save [\#19](https://github.com/asciidoctor/atom-asciidoc-preview/issues/19) 612 | - Enable syntax highlighting of code snippets [\#15](https://github.com/asciidoctor/atom-asciidoc-preview/issues/15) 613 | 614 | **Closed issues:** 615 | 616 | - Look to use webworkers when we run converter [\#22](https://github.com/asciidoctor/atom-asciidoc-preview/issues/22) 617 | 618 | **Merged pull requests:** 619 | 620 | - resolve \#20 by adding href in status bar [\#24](https://github.com/asciidoctor/atom-asciidoc-preview/pull/24) ([anthonny](https://github.com/anthonny)) 621 | - Use a task to run Asciidoc generation [\#23](https://github.com/asciidoctor/atom-asciidoc-preview/pull/23) ([anthonny](https://github.com/anthonny)) 622 | - Add render on save only configuration [\#21](https://github.com/asciidoctor/atom-asciidoc-preview/pull/21) ([anthonny](https://github.com/anthonny)) 623 | - override problematic blockquote style inherited from Atom styles [\#18](https://github.com/asciidoctor/atom-asciidoc-preview/pull/18) ([mojavelinux](https://github.com/mojavelinux)) 624 | 625 | ## [v0.1.2](https://github.com/asciidoctor/atom-asciidoc-preview/tree/v0.1.2) (2014-05-18) 626 | [Full Changelog](https://github.com/asciidoctor/atom-asciidoc-preview/compare/v0.1.1...v0.1.2) 627 | 628 | **Implemented enhancements:** 629 | 630 | - Load Font Awesome into the preview window [\#10](https://github.com/asciidoctor/atom-asciidoc-preview/issues/10) 631 | 632 | **Merged pull requests:** 633 | 634 | - resolves \#10 load the FontAwesome icon font & stylesheet [\#17](https://github.com/asciidoctor/atom-asciidoc-preview/pull/17) ([mojavelinux](https://github.com/mojavelinux)) 635 | - fix paths for include file resolution; set correct toc attributes [\#13](https://github.com/asciidoctor/atom-asciidoc-preview/pull/13) ([mojavelinux](https://github.com/mojavelinux)) 636 | - rename context menu items to clarify function [\#12](https://github.com/asciidoctor/atom-asciidoc-preview/pull/12) ([mojavelinux](https://github.com/mojavelinux)) 637 | - Fix package name in install command [\#11](https://github.com/asciidoctor/atom-asciidoc-preview/pull/11) ([mojavelinux](https://github.com/mojavelinux)) 638 | 639 | ## [v0.1.1](https://github.com/asciidoctor/atom-asciidoc-preview/tree/v0.1.1) (2014-05-17) 640 | [Full Changelog](https://github.com/asciidoctor/atom-asciidoc-preview/compare/v0.1.0...v0.1.1) 641 | 642 | **Closed issues:** 643 | 644 | - Make the safe mode configurable, default to "safe" [\#5](https://github.com/asciidoctor/atom-asciidoc-preview/issues/5) 645 | - Make attributes configurable [\#4](https://github.com/asciidoctor/atom-asciidoc-preview/issues/4) 646 | - Enable title by default [\#3](https://github.com/asciidoctor/atom-asciidoc-preview/issues/3) 647 | 648 | **Merged pull requests:** 649 | 650 | - Suggest command-line installation method [\#7](https://github.com/asciidoctor/atom-asciidoc-preview/pull/7) ([glaforge](https://github.com/glaforge)) 651 | - add screenshot to README [\#6](https://github.com/asciidoctor/atom-asciidoc-preview/pull/6) ([mojavelinux](https://github.com/mojavelinux)) 652 | - add description to package metadata [\#2](https://github.com/asciidoctor/atom-asciidoc-preview/pull/2) ([mojavelinux](https://github.com/mojavelinux)) 653 | - rename Asciidoc to AsciiDoc; update README [\#1](https://github.com/asciidoctor/atom-asciidoc-preview/pull/1) ([mojavelinux](https://github.com/mojavelinux)) 654 | 655 | ## [v0.1.0](https://github.com/asciidoctor/atom-asciidoc-preview/tree/v0.1.0) (2014-05-15) 656 | 657 | 658 | \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)* --------------------------------------------------------------------------------