asciidoctor / atom-asciidoc-preview Goto Github PK
View Code? Open in Web Editor NEW⚛ AsciiDoc preview for the Atom editor.
Home Page: https://atom.io/packages/asciidoc-preview
License: MIT License
⚛ AsciiDoc preview for the Atom editor.
Home Page: https://atom.io/packages/asciidoc-preview
License: MIT License
atom.workspaceView is no longer available.
In most cases you will not need the view. See the Workspace docs for
alternatives: https://atom.io/docs/api/latest/Workspace.
If you do need the view, please use atom.views.getView(atom.workspace)
,
which returns an HTMLElement.
Atom.Object.defineProperty.get (/usr/share/atom/resources/app/src/atom.js:55:11)
Object.changeRenderMode (/home/srt/.atom/packages/asciidoc-preview/lib/asciidoc-preview.coffee:164:23)
The atom.syntax global is deprecated. Use atom.grammars instead.
Atom.Object.defineProperty.get (/usr/share/atom/resources/app/src/atom.js:316:11)
AsciiDocPreviewView.handleEvents (/home/srt/.atom/packages/asciidoc-preview/lib/asciidoc-preview-view.coffee:72:20)
Using Atom 0.175.0
In keymaps/asciidoc-preview.cson: Use the atom-workspace
tag instead of the workspace
class.
Use icons=font@
in default attributes.
Placing :numbered!:
at the top of the file does not turn auto-numbering of sections off.
PS. Atom-asciidoc-preview rocks! I use it every day!!
Make the safe mode configurable and default to "SAFE". By default, includes are disabled. Setting the safe mode to "SAFE" allows them to work out of the box.
Refer to the Asciidoctor.js Live Preview Chrome extension for an example:
https://github.com/asciidoctor/asciidoctor-chrome-extension/blob/master/js/renderer.js#L52
You can edit your personal keympa :
'atom-workspace, atom-workspace atom-text-editor':
'ctrl-shift-a': 'asciidoc-preview:toggle'
'ctrl-alt-a': 'asciidoc-preview:toggle-render-on-save-only'
In keymaps\asciidoc-preview.cson: Use the atom-workspace
tag instead of the workspace
class.
In stylesheets/asciidoc-preview.less: 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.
This might be a shoot for the moon sort of request, but it would be cool if we could figure out how to fold (hide) the source on blocks (like sections or block content) so that you only see content in the open regions.
There's some sort of fold method in Atom. Maybe that can make it possible.
The Chrome extension has the option to render the current selection. I think this would be a great feature to have in an editing environment as well.
...once we add "render selection" we could move on to "render section". There's a new API coming in 1.5.0 that will give you access to the source code for any node in the parse tree.
I was editing the jekyll-asciidoc-quickstart Readme.adoc file in Atom, and noticed that when I surrounded a command in the + delimiters, the code did not get formatted.
If I fenced it with back-ticks, it worked.
I've adopted a fencing approach in this file just so it renders in the short term, because I'm relying on the live render to tell me if I have made an error with markup (not staging these files locally first) as I get used to AsciiDoc authoring.
If I've misunderstood anything with regard to usage, I apologise, and this issue can be insta-closed. 😃
In stylesheets\asciidoc-preview.less: Use the atom-text-editor
tag instead of the editor-colors
class.
Make the global attributes configurable (i.e., attributes that are passed through the API to all documents). It's sufficient to make this a text box that accepts a space-separated list of attributes.
You can see an example in the Asciidoctor.js Live Preview Chrome extension:
https://github.com/asciidoctor/asciidoctor-chrome-extension/blob/master/js/renderer.js#L42
In keymaps/asciidoc-preview.cson: Use the atom-workspace
tag instead of the workspace
class.
This was picked up by deprecator cop. I am using:
Enable the title by default by passing the following attribute to the AsciiDoc convert method.
showtitle=@
The attribute showtitle
enables the document title when generating embeddable HTML. The @
value allows the document to override this setting.
See the Asciidoctor.js Live Preview Chrome extension for an example of how to pass these attributes.
https://github.com/asciidoctor/asciidoctor-chrome-extension/blob/master/js/renderer.js#L44
Also, I recommend setting the following additional attributes to be consistent with what we are doing in other environments.
env=browser env-browser platform=opal platform-opal icons=font@
Of course, enabling icons=font@
means that you need to load Font Awesome into the preview browser.
The package fails to load with an error message
Failed to activate package named 'asciidoc-preview' Error: Cannot find module '/Applications/Atom.app/Contents/Resources/app/node_modules/markdown-preview/node_modules/highlights'
I found highlights
in Applications/Atom.app/Contents/Resources/app/node_modules/ but changing
Highlights = require path.join(pathWatcherDirectory, 'node_modules', 'highlights')
in lib/renderer.coffee
to just
Highlights = require 'highlights'
did not work. But changing it to this worked.
Highlights = require path.join(pathWatcherDirectory, '../', 'highlights')
I thought just require 'highlights'
should works since require 'cheerio'
and require 'underscore-plus'
works but I know nothing about how node or atom work :). Is it because you are not including highlights in package.json ? Shouldn't it be included since it is a dependency?
Actually, the plugin have a dependency on pathwatcher
, like Markdown plugin.
Pathwatcher need to be compiled during the installation, and required a c++ compiler installed.
A solution could be use the pathwatcher
used in atom and remove dependency.
See #30 and http://pastebin.com/qDCHvNaG
Rough code to create an AsciiDoc outline in ctags. We could extrapolate to create tree view for Atom.
https://github.com/mojavelinux/gedit-source-code-browser/blob/asciidoc-outline-py3/sourcecodebrowser/bin/ctags-wrapper
The loading splash screen should only be used after the initial rendering. Otherwise, it interferes with / interrupts WebKit's built-in logic to paint updates smoothly and you notice a flashing effect when updates are made. We definitely want smooth updates, especially when rendering on change.
Installing asciidoc-preview to C:\Users\guoxf2_yuchengtech\.atom\packages failed
> [email protected] install C:\Users\GUOXF2~1\AppData\Local\Temp\apm-install-dir-11474-9428-12sbvi3\node_modules\asciidoc-preview\node_modules\pathwatcher\node_module
s\runas
> node-gyp rebuild
C:\Users\GUOXF2~1\AppData\Local\Temp\apm-install-dir-11474-9428-12sbvi3\node_modules\asciidoc-preview\node_modules\pathwatcher\node_modules\runas>node "C:\Choco
latey\lib\Atom.0.120.0\tools\Atom\resources\app\apm\node_modules\atom-package-manager\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gy
p.js" rebuild
npm http GET https://registry.npmjs.org/mustache/0.8.2
npm http GET https://registry.npmjs.org/wrench
npm http GET https://registry.npmjs.org/opal-npm-wrapper
npm http GET https://registry.npmjs.org/temp
npm http GET https://registry.npmjs.org/cheerio
npm http GET https://registry.npmjs.org/pathwatcher
npm http GET https://registry.npmjs.org/underscore-plus
npm http GET https://registry.npmjs.org/fs-plus
npm http GET https://registry.npmjs.org/asciidoctorjs-npm-wrapper/0.1.3
npm http 304 https://registry.npmjs.org/cheerio
npm http 304 https://registry.npmjs.org/pathwatcher
npm http 304 https://registry.npmjs.org/underscore-plus
npm http 304 https://registry.npmjs.org/wrench
npm http 304 https://registry.npmjs.org/mustache/0.8.2
npm http 304 https://registry.npmjs.org/opal-npm-wrapper
npm http 304 https://registry.npmjs.org/fs-plus
npm http 304 https://registry.npmjs.org/asciidoctorjs-npm-wrapper/0.1.3
npm http 304 https://registry.npmjs.org/temp
npm http GET https://registry.npmjs.org/mkdirp
npm http GET https://registry.npmjs.org/underscore
npm http GET https://registry.npmjs.org/rimraf
npm http GET https://registry.npmjs.org/async
npm http GET https://registry.npmjs.org/rimraf
npm http 304 https://registry.npmjs.org/mkdirp
npm http 304 https://registry.npmjs.org/underscore
npm http GET https://registry.npmjs.org/osenv/0.0.3
npm http 304 https://registry.npmjs.org/async
npm http 304 https://registry.npmjs.org/rimraf
npm http GET https://registry.npmjs.org/q
npm http GET https://registry.npmjs.org/runas
npm http GET https://registry.npmjs.org/xmlhttprequest
npm http GET https://registry.npmjs.org/emissary
npm http GET https://registry.npmjs.org/async
npm http 304 https://registry.npmjs.org/rimraf
npm http GET https://registry.npmjs.org/htmlparser2
npm http GET https://registry.npmjs.org/lodash
npm http GET https://registry.npmjs.org/CSSselect
npm http GET https://registry.npmjs.org/bindings
npm http GET https://registry.npmjs.org/entities
npm http GET https://registry.npmjs.org/nan/0.8.0
npm http 304 https://registry.npmjs.org/xmlhttprequest
npm http 304 https://registry.npmjs.org/emissary
npm http 304 https://registry.npmjs.org/htmlparser2
npm http 200 https://registry.npmjs.org/async
npm WARN `git config --get remote.origin.url` returned wrong result (git://github.com/anthonny/opal-npm-wrapper.git)
npm http 304 https://registry.npmjs.org/lodash
npm http 304 https://registry.npmjs.org/runas
npm http 304 https://registry.npmjs.org/CSSselect
npm http 304 https://registry.npmjs.org/osenv/0.0.3
npm http 304 https://registry.npmjs.org/bindings
npm ERR! git clone git://github.com/anthonny/opal-npm-wrapper.git
npm http 304 https://registry.npmjs.org/nan/0.8.0
npm ERR! Error: ENOENT, lstat 'C:\Users\GUOXF2~1\AppData\Local\Temp\apm-install-dir-11474-9428-12sbvi3\node_modules\asciidoc-preview\node_modules\fs-plus\node_m
odules\rimraf\test\setup.sh'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR! <http://github.com/npm/npm/issues>
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Chocolatey\\lib\\Atom.0.120.0\\tools\\Atom\\resources\\app\\apm\\node_modules\\atom-package-manager\\bin\\\\node.exe" "C:\\Chocolatey\\lib
\\Atom.0.120.0\\tools\\Atom\\resources\\app\\apm\\node_modules\\atom-package-manager\\node_modules\\npm\\bin\\npm-cli.js" "--globalconfig" "C:\\Chocolatey\\lib\
\Atom.0.120.0\\tools\\Atom\\resources\\app\\apm\\node_modules\\atom-package-manager\\.apmrc" "--userconfig" "C:\\Users\\guoxf2_yuchengtech\\.atom\\.apmrc" "inst
all" "C:\\Users\\guoxf2_yuchengtech\\.atom\\.node-gyp\\.atom\\.apm\\asciidoc-preview\\0.2.3\\package.tgz" "--target=0.11.10" "--arch=ia32" "--msvs_version=2010"
npm ERR! cwd C:\Users\GUOXF2~1\AppData\Local\Temp\apm-install-dir-11474-9428-12sbvi3
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.4
npm ERR! path C:\Users\GUOXF2~1\AppData\Local\Temp\apm-install-dir-11474-9428-12sbvi3\node_modules\asciidoc-preview\node_modules\fs-plus\node_modules\rimraf\tes
t\setup.sh
npm ERR! fstream_path C:\Users\GUOXF2~1\AppData\Local\Temp\apm-install-dir-11474-9428-12sbvi3\node_modules\asciidoc-preview\node_modules\fs-plus\node_modules\ri
mraf\test\setup.sh
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack C:\Chocolatey\lib\Atom.0.120.0\tools\Atom\resources\app\apm\node_modules\atom-package-manager\node_modules\npm\node_modules\fstream\lib\w
riter.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! Error: ENOENT, lstat 'C:\Users\GUOXF2~1\AppData\Local\Temp\apm-install-dir-11474-9428-12sbvi3\node_modules\asciidoc-preview\node_modules\fs-plus\node_m
odules\async\package.json'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR! <http://github.com/npm/npm/issues>
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Chocolatey\\lib\\Atom.0.120.0\\tools\\Atom\\resources\\app\\apm\\node_modules\\atom-package-manager\\bin\\\\node.exe" "C:\\Chocolatey\\lib
\\Atom.0.120.0\\tools\\Atom\\resources\\app\\apm\\node_modules\\atom-package-manager\\node_modules\\npm\\bin\\npm-cli.js" "--globalconfig" "C:\\Chocolatey\\lib\
\Atom.0.120.0\\tools\\Atom\\resources\\app\\apm\\node_modules\\atom-package-manager\\.apmrc" "--userconfig" "C:\\Users\\guoxf2_yuchengtech\\.atom\\.apmrc" "inst
all" "C:\\Users\\guoxf2_yuchengtech\\.atom\\.node-gyp\\.atom\\.apm\\asciidoc-preview\\0.2.3\\package.tgz" "--target=0.11.10" "--arch=ia32" "--msvs_version=2010"
npm ERR! cwd C:\Users\GUOXF2~1\AppData\Local\Temp\apm-install-dir-11474-9428-12sbvi3
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.4
npm ERR! path C:\Users\GUOXF2~1\AppData\Local\Temp\apm-install-dir-11474-9428-12sbvi3\node_modules\asciidoc-preview\node_modules\fs-plus\node_modules\async\pack
age.json
npm ERR! fstream_path C:\Users\GUOXF2~1\AppData\Local\Temp\apm-install-dir-11474-9428-12sbvi3\node_modules\asciidoc-preview\node_modules\fs-plus\node_modules\as
ync\package.json
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack C:\Chocolatey\lib\Atom.0.120.0\tools\Atom\resources\app\apm\node_modules\atom-package-manager\node_modules\npm\node_modules\fstream\lib\w
riter.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! Error: ENOENT, lstat 'C:\Users\GUOXF2~1\AppData\Local\Temp\apm-install-dir-11474-9428-12sbvi3\node_modules\asciidoc-preview\node_modules\fs-plus\node_m
odules\mkdirp\test\perm.js'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR! <http://github.com/npm/npm/issues>
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Chocolatey\\lib\\Atom.0.120.0\\tools\\Atom\\resources\\app\\apm\\node_modules\\atom-package-manager\\bin\\\\node.exe" "C:\\Chocolatey\\lib
\\Atom.0.120.0\\tools\\Atom\\resources\\app\\apm\\node_modules\\atom-package-manager\\node_modules\\npm\\bin\\npm-cli.js" "--globalconfig" "C:\\Chocolatey\\lib\
\Atom.0.120.0\\tools\\Atom\\resources\\app\\apm\\node_modules\\atom-package-manager\\.apmrc" "--userconfig" "C:\\Users\\guoxf2_yuchengtech\\.atom\\.apmrc" "inst
all" "C:\\Users\\guoxf2_yuchengtech\\.atom\\.node-gyp\\.atom\\.apm\\asciidoc-preview\\0.2.3\\package.tgz" "--target=0.11.10" "--arch=ia32" "--msvs_version=2010"
npm ERR! cwd C:\Users\GUOXF2~1\AppData\Local\Temp\apm-install-dir-11474-9428-12sbvi3
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.4
npm ERR! path C:\Users\GUOXF2~1\AppData\Local\Temp\apm-install-dir-11474-9428-12sbvi3\node_modules\asciidoc-preview\node_modules\fs-plus\node_modules\mkdirp\tes
t\perm.js
npm ERR! fstream_path C:\Users\GUOXF2~1\AppData\Local\Temp\apm-install-dir-11474-9428-12sbvi3\node_modules\asciidoc-preview\node_modules\fs-plus\node_modules\mk
dirp\test\perm.js
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack C:\Chocolatey\lib\Atom.0.120.0\tools\Atom\resources\app\apm\node_modules\atom-package-manager\node_modules\npm\node_modules\fstream\lib\w
riter.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm http 304 https://registry.npmjs.org/entities
npm ERR! Error: spawn ENOENT
npm ERR! at errnoException (child_process.js:988:11)
npm ERR! at Process.ChildProcess._handle.onexit (child_process.js:779:34)
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR! <http://github.com/npm/npm/issues>
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Chocolatey\\lib\\Atom.0.120.0\\tools\\Atom\\resources\\app\\apm\\node_modules\\atom-package-manager\\bin\\\\node.exe" "C:\\Chocolatey\\lib
\\Atom.0.120.0\\tools\\Atom\\resources\\app\\apm\\node_modules\\atom-package-manager\\node_modules\\npm\\bin\\npm-cli.js" "--globalconfig" "C:\\Chocolatey\\lib\
\Atom.0.120.0\\tools\\Atom\\resources\\app\\apm\\node_modules\\atom-package-manager\\.apmrc" "--userconfig" "C:\\Users\\guoxf2_yuchengtech\\.atom\\.apmrc" "inst
all" "C:\\Users\\guoxf2_yuchengtech\\.atom\\.node-gyp\\.atom\\.apm\\asciidoc-preview\\0.2.3\\package.tgz" "--target=0.11.10" "--arch=ia32" "--msvs_version=2010"
npm ERR! cwd C:\Users\GUOXF2~1\AppData\Local\Temp\apm-install-dir-11474-9428-12sbvi3
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.4
npm ERR! syscall spawn
npm ERR! code ENOENT
npm ERR! errno ENOENT
npm http GET https://registry.npmjs.org/graceful-fs
npm http 304 https://registry.npmjs.org/graceful-fs
npm http GET https://registry.npmjs.org/CSSwhat
npm http GET https://registry.npmjs.org/domutils
npm http GET https://registry.npmjs.org/domutils
npm http GET https://registry.npmjs.org/readable-stream
npm http GET https://registry.npmjs.org/domelementtype
npm http GET https://registry.npmjs.org/domhandler
npm http 304 https://registry.npmjs.org/domutils
npm http 304 https://registry.npmjs.org/readable-stream
npm http 304 https://registry.npmjs.org/domhandler
npm http 304 https://registry.npmjs.org/domelementtype
npm http 304 https://registry.npmjs.org/q
module.js:340
throw err;
^
Error: Cannot find module 'nan'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at [eval]:1:1
at Object.<anonymous> ([eval]-wrapper:6:22)
at Module._compile (module.js:456:26)
at evalScript (node.js:532:25)
at startup (node.js:80:7)
at node.js:902:3
gyp: Call to 'node -e "require('nan')"' returned exit status 8.
gypnpm http GET https://registry.npmjs.org/property-accessors
npm http GET https://registry.npmjs.org/mixto
npm WARN `git config --get remote.origin.url` returned wrong result (https://github.com/Benvie/harmony-collections.git)
npm ERR! git clone https://github.com/Benvie/harmony-collections.git
npm http 304 https://registry.npmjs.org/property-accessors
npm http 304 https://registry.npmjs.org/mixto
npm http 304 https://registry.npmjs.org/CSSwhat
npm http 304 https://registry.npmjs.org/domutils
npm http GET https://registry.npmjs.org/string_decoder
npm http GET https://registry.npmjs.org/core-util-is
npm http GET https://registry.npmjs.org/inherits
npm http GET https://registry.npmjs.org/isarray/0.0.1
npm http 304 https://registry.npmjs.org/inherits
npm http 304 https://registry.npmjs.org/isarray/0.0.1
npm http 304 https://registry.npmjs.org/string_decoder
npm ERR! error rolling back Error: EBUSY, unlink 'C:\Users\GUOXF2~1\AppData\Local\Temp\apm-install-dir-11474-9428-12sbvi3\node_modules\asciidoc-preview\node_mod
ules\pathwatcher\node_modules\runas'
npm ERR! error rolling back [email protected] { [Error: EBUSY, unlink 'C:\Users\GUOXF2~1\AppData\Local\Temp\apm-install-dir-11474-9428-12sbvi3\node_modules\asc
iidoc-preview\node_modules\pathwatcher\node_modules\runas']
npm ERR! error rolling back errno: 10,
npm ERR! error rolling back code: 'EBUSY',
npm ERR! error rolling back path: 'C:\\Users\\GUOXF2~1\\AppData\\Local\\Temp\\apm-install-dir-11474-9428-12sbvi3\\node_modules\\asciidoc-preview\\node_modules
\\pathwatcher\\node_modules\\runas' }
npm http 304 https://registry.npmjs.org/core-util-is
I don't think we need to post-processing image code that came over from the Markdown Preview plugin. Asciidoctor is very intelligent with how it handles images, so if we have to do anything, we should be configuring Asciidoctor's image handling behavior.
Specifically, I'm proposing eliminating this method: https://github.com/asciidoctor/atom-asciidoc-preview/blob/master/lib/renderer.coffee#L73
To reproduce the problem, type the following text:
[[hello::world]]
<<hello::world, Hello World!>>
The error reported is
Error: Syntax error, unrecognized expression: #hello::world
at Function.Sizzle.error (c:\Users\atroccoli\AppData\Local\atom\app-0.175.0\resources\app\node_modules\space-pen\vendor\jquery.js:1715:8)
at tokenize (c:\Users\atroccoli\AppData\Local\atom\app-0.175.0\resources\app\node_modules\space-pen\vendor\jquery.js:2325:11)
at select (c:\Users\atroccoli\AppData\Local\atom\app-0.175.0\resources\app\node_modules\space-pen\vendor\jquery.js:2712:11)
at Function.Sizzle (c:\Users\atroccoli\AppData\Local\atom\app-0.175.0\resources\app\node_modules\space-pen\vendor\jquery.js:1154:9)
at [object Object].jQuery.fn.extend.find (c:\Users\atroccoli\AppData\Local\atom\app-0.175.0\resources\app\node_modules\space-pen\vendor\jquery.js:5163:11)
at [object Object].jQuery.fn.jQuery.init (c:\Users\atroccoli\AppData\Local\atom\app-0.175.0\resources\app\node_modules\space-pen\vendor\jquery.js:168:38)
at jQuery (c:\Users\atroccoli\AppData\Local\atom\app-0.175.0\resources\app\node_modules\space-pen\vendor\jquery.js:63:10)
at AsciiDocPreviewView.module.exports.AsciiDocPreviewView.enableAnchorScroll (c:\Users\atroccoli\.atom\packages\asciidoc-preview\lib\asciidoc-preview-view.coffee:145:21)
at c:\Users\atroccoli\.atom\packages\asciidoc-preview\lib\asciidoc-preview-view.coffee:128:8
at Task.callback (c:\Users\atroccoli\.atom\packages\asciidoc-preview\lib\renderer.coffee:30:5)
at c:\Users\atroccoli\AppData\Local\atom\app-0.175.0\resources\app\src\task.js:57:72
at Task.module.exports.Emitter.emit (c:\Users\atroccoli\AppData\Local\atom\app-0.175.0\resources\app\node_modules\emissary\lib\emitter.js:118:15)
at ChildProcess.<anonymous> (c:\Users\atroccoli\AppData\Local\atom\app-0.175.0\resources\app\src\task.js:70:31)
at ChildProcess.emit (events.js:110:17)
at handleMessage (child_process.js:323:10)
at Pipe.channel.onread (child_process.js:351:11)
Hi,
the "Save as HTML..." action available in the contextual menu in the preview pan does not save the full html but only the body content.
No embedded css and/or js available :(
I'm on OSX.
regards,
Yann
Please:
Updated example: https://github.com/atom-community/autocomplete-plus/wiki/Tutorial:-Registering-and-creating-a-suggestion-provider
Great idea of @nerk !
See asciidoctor/brackets-asciidoc-preview#4
Can't seem to install it in atom version 0.106.0781-a51a. The output log : http://pastebin.com/qDCHvNaG
In the log there is mention of a debug log but the file doesn't exist @ the given location.
I think the user should be able to choose whether to render after a short delay (as it is now) or whether to render on save. There are times when the constant rendering gets annoying and slows down the editing. Other times, you want that instant feedback. Having a way to toggle this behavior would be really helpful.
Enable syntax highlighting of code snippets in preview window. This will likely require two things:
This would be a killer feature. Of course, we'll want a context menu item to toggle this behavior.
Smart quotes are not properly previewed. The output text is monospaced using the semantics of the back-tick symbol, and the quotes remain as simple rather than curved marks.
Input text that looks like this:
Here's how you say "`Hello, World!`" in Ruby.
is rendered like this:
but it should be rendered like this:
This is probably very premature to be talking about problem with Windows ... but I'll note it here, because I'm interesting in using it in the future.
Following is error message:
C:\Users\tbergeron>apm install asciidoc-preview
Installing asciidoc-preview to C:\Users\tbergeron.atom\packages failed
[email protected] install C:\Users\TBERGE~1\AppData\Local\Temp\apm-install-dir-11461
1-8344-1w02z83\node_modules\asciidoc-preview\node_modules\pathwatcher\node_modul
es\runas
node-gyp rebuild
C:\Users\TBERGE~1\AppData\Local\Temp\apm-install-dir-114611-8344-1w02z83\node_mo
dules\asciidoc-preview\node_modules\pathwatcher\node_modules\runas>node "C:\Prog
ramData\chocolatey\lib\Atom.0.113.0\tools\Atom\resources\app\apm\node_modules\at
om-package-manager\node_modules\npm\bin\node-gyp-bin....\node_modules\node-gy
p\bin\node-gyp.js" rebuild
npm http GET https://registry.npmjs.org/asciidoctorjs-npm-wrapper/0.1.3
npm http GET https://registry.npmjs.org/opal-npm-wrapper
npm http GET https://registry.npmjs.org/mustache/0.8.2
npm http GET https://registry.npmjs.org/wrench
npm http GET https://registry.npmjs.org/cheerio
npm http GET https://registry.npmjs.org/fs-plus
npm http GET https://registry.npmjs.org/underscore-plus
npm http GET https://registry.npmjs.org/pathwatcher
npm http GET https://registry.npmjs.org/temp
npm http 304 https://registry.npmjs.org/wrench
npm http 304 https://registry.npmjs.org/cheerio
npm http 304 https://registry.npmjs.org/mustache/0.8.2
npm http 304 https://registry.npmjs.org/asciidoctorjs-npm-wrapper/0.1.3
npm http 304 https://registry.npmjs.org/opal-npm-wrapper
npm http 304 https://registry.npmjs.org/fs-plus
npm http 304 https://registry.npmjs.org/underscore-plus
npm http 304 https://registry.npmjs.org/temp
npm http 200 https://registry.npmjs.org/pathwatcher
npm http GET https://registry.npmjs.org/emissary
npm http GET https://registry.npmjs.org/nan/0.8.0
npm http GET https://registry.npmjs.org/q
npm http GET https://registry.npmjs.org/runas
npm http GET https://registry.npmjs.org/bindings
npm http GET https://registry.npmjs.org/async
npm http GET https://registry.npmjs.org/underscore
npm http GET https://registry.npmjs.org/async
npm http GET https://registry.npmjs.org/rimraf
npm http GET https://registry.npmjs.org/rimraf
npm http GET https://registry.npmjs.org/osenv/0.0.3
npm http GET https://registry.npmjs.org/mkdirp
npm http 304 https://registry.npmjs.org/q
npm http GET https://registry.npmjs.org/htmlparser2
npm http 304 https://registry.npmjs.org/bindings
npm http GET https://registry.npmjs.org/lodash
npm http 304 https://registry.npmjs.org/emissary
npm http GET https://registry.npmjs.org/CSSselect
npm http GET https://registry.npmjs.org/entities
npm http 304 https://registry.npmjs.org/nan/0.8.0
npm http GET https://registry.npmjs.org/xmlhttprequest
npm http 304 https://registry.npmjs.org/runas
npm http 304 https://registry.npmjs.org/rimraf
npm http 200 https://registry.npmjs.org/underscore
npm http 200 https://registry.npmjs.org/async
npm http 200 https://registry.npmjs.org/async
npm http 304 https://registry.npmjs.org/rimraf
npm http 304 https://registry.npmjs.org/mkdirp
npm http 304 https://registry.npmjs.org/htmlparser2
npm http 304 https://registry.npmjs.org/entities
npm http 304 https://registry.npmjs.org/osenv/0.0.3
npm http 304 https://registry.npmjs.org/xmlhttprequest
npm http 200 https://registry.npmjs.org/lodash
npm http 304 https://registry.npmjs.org/CSSselect
gypnpm http GET https://registry.npmjs.org/graceful-fs
npm http GET https://registry.npmjs.org/property-accessors
npm http GET https://registry.npmjs.org/mixto
npm http 304 https://registry.npmjs.org/graceful-fs
npm http GET https://registry.npmjs.org/CSSwhat
npm http GET https://registry.npmjs.org/domutils
npm http 304 https://registry.npmjs.org/property-accessors
npm http 304 https://registry.npmjs.org/mixto
npm http 304 https://registry.npmjs.org/domutils
npm ERR! Error: ENOENT, lstat 'C:\Users\TBERGE~1\AppData\Local\Temp\apm-install-
dir-114611-8344-1w02z83\node_modules\asciidoc-preview\node_modules\cheerio\node_
modules\htmlparser2\test\Stream\04-RDF.json'
npm ERR! If you need help, you may report this entire log,
npm ERR! including the npm and node versions, at:
npm ERR! http://github.com/npm/npm/issues
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\ProgramData\chocolatey\lib\Atom.0.113.0\tools\Atom\r
esources\app\apm\node_modules\atom-package-manager\bin\node.exe" "C:\Pr
ogramData\chocolatey\lib\Atom.0.113.0\tools\Atom\resources\app\apm\node
_modules\atom-package-manager\node_modules\npm\bin\npm-cli.js" "--globalcon
fig" "C:\ProgramData\chocolatey\lib\Atom.0.113.0\tools\Atom\resources\ap
p\apm\node_modules\atom-package-manager.apmrc" "--userconfig" "C:\Users\t
bergeron.atom.apmrc" "install" "C:\Users\tbergeron.atom.node-gyp.ato
m.apm\asciidoc-preview\0.2.3\package.tgz" "--target=0.11.10" "--arch=ia32"
"--msvs_version=2012"
npm ERR! cwd C:\Users\TBERGE1\AppData\Local\Temp\apm-install-dir-114611-8344-1w1\AppData\Local\Temp\apm-install-dir-114611-8344-1
02z83
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.4
npm ERR! path C:\Users\TBERGE
w02z83\node_modules\asciidoc-preview\node_modules\cheerio\node_modules\htmlparse
r2\test\Stream\04-RDF.json
npm ERR! fstream_path C:\Users\TBERGE~1\AppData\Local\Temp\apm-install-dir-11461
1-8344-1w02z83\node_modules\asciidoc-preview\node_modules\cheerio\node_modules\h
tmlparser2\test\Stream\04-RDF.json
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack C:\ProgramData\chocolatey\lib\Atom.0.113.0\tools\Atom\res
ources\app\apm\node_modules\atom-package-manager\node_modules\npm\node_modules\f
stream\lib\writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm http 304 https://registry.npmjs.org/CSSwhat
npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the runas package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls runas
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\ProgramData\chocolatey\lib\Atom.0.113.0\tools\Atom\r
esources\app\apm\node_modules\atom-package-manager\bin\node.exe" "C:\Pr
ogramData\chocolatey\lib\Atom.0.113.0\tools\Atom\resources\app\apm\node
_modules\atom-package-manager\node_modules\npm\bin\npm-cli.js" "--globalcon
fig" "C:\ProgramData\chocolatey\lib\Atom.0.113.0\tools\Atom\resources\ap
p\apm\node_modules\atom-package-manager.apmrc" "--userconfig" "C:\Users\t
bergeron.atom.apmrc" "install" "C:\Users\tbergeron.atom.node-gyp.ato
m.apm\asciidoc-preview\0.2.3\package.tgz" "--target=0.11.10" "--arch=ia32"
"--msvs_version=2012"
npm ERR! cwd C:\Users\TBERGE~1\AppData\Local\Temp\apm-install-dir-114611-8344-1w
02z83
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.4
npm ERR! code ELIFECYCLE
npm http GET https://registry.npmjs.org/domelementtype
npm http 304 https://registry.npmjs.org/domelementtype
npm
C:\Users\tbergeron>
Add an option to toggle compat-mode (i.e., pass the attribute to the Asciidoctor API as compat-mode=@
).
Ideally, this option should only be enabled if the document does not specify a compat-mode setting. However, if we pass it as compat-mode=@
, then it won't have an affect anyway if specified in the document...so it's probably a safe approach for now.
I would like to be able to use more than one template and if possible be able to specify my own
I noticed quite a few icons were missing between the version used here and current font-awesome release. I hacked my local asciidoc-preview but I could do a pull request if you like. I just replaced all fonts/ and less/ contents of the folders - not knowing or caring about any tweaking you guys did and it works fine, just checking to make sure you didn't have any patched magic going on I wasn't aware of or if there was any other reason for not wanting to do a bump on fontawesome.
Cheers,
Rob
ctrl-shift-A editor:select-to-first-character-of-line Core .editor
ctrl-shift-A asciidoc-preview:toggle Asciidoc Preview .workspace
ctrl-shift-A git-plus:add Git Plus
When editing AsciiDoc, it would be incredibly useful to have autocomplete support for attribute names when entering an attribute reference. This would work much like autocomplete works in IDEs when entering a variable or method name.
In the editor pane, I would type {
, then press <Ctrl><Space>
. That would bring up a drop down list of names that would be filtered as I type additional characters. If I select one of the names, it would be inserted into the document after the {
and then a }
would be automatically added after the name.
The list of attribute names can be retrieved from the Document#attributes
map. We'd need to do a bit more work to get attributes defined in the flow of the document...but let's not worry about those in the initial prototype.
We must remove showToc
and keep showTableOfContent
.
Change :
atom.workspaceView.command 'asciidoc-preview:toggle-show-toc', ->
atom.config.toggle('asciidoc-preview.showToc')
by
atom.workspaceView.command 'asciidoc-preview:toggle-show-toc', ->
atom.config.toggle('asciidoc-preview.showTableOfContent')
Thx to @YannDanthu for reporting
Expected: Status bar element to display
Actual: Status bar element does not show until changing to another tab and changing back
It would be very nice to be able to preview asciidoctor diagrams as you type. That's the only missing piece that I'd love to see added.
Using 0.4.3 of the package and Atom 0.177.0, I can't run the asciidoctor-preview:toggle
command. I noticed this in the console when I started up:
Failed to activate package named 'asciidoc-preview' Error: Cannot find module '/Applications/Atom.app/Contents/Resources/app/node_modules/highlights'
at Module._resolveFilename (module.js:351:15)
at Function.Module._resolveFilename (/Applications/Atom.app/Contents/Resources/app/src/module-cache.js:383:52)
at Function.Module._load (module.js:293:25)
at Module.require (module.js:380:17)
at require (module.js:399:17)
at Object.<anonymous> (/Users/tlberglund/.atom/packages/asciidoc-preview/lib/renderer.coffee:8:14)
at Object.<anonymous> (/Users/tlberglund/.atom/packages/asciidoc-preview/lib/renderer.coffee:1:1)
at Module._compile (module.js:475:26)
at Object.requireCoffeeScript [as .coffee] (/Applications/Atom.app/Contents/Resources/app/src/coffee-cache.js:74:19)
at Module.load (/Applications/Atom.app/Contents/Resources/app/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
at Function.Module._load (module.js:325:12)
at Module.require (module.js:380:17)
at require (module.js:399:17)
at Object.<anonymous> (/Users/tlberglund/.atom/packages/asciidoc-preview/lib/asciidoc-preview-view.coffee:7:12)
at Object.<anonymous> (/Users/tlberglund/.atom/packages/asciidoc-preview/lib/asciidoc-preview-view.coffee:1:1)
at Module._compile (module.js:475:26)
at Object.requireCoffeeScript [as .coffee] (/Applications/Atom.app/Contents/Resources/app/src/coffee-cache.js:74:19)
at Module.load (/Applications/Atom.app/Contents/Resources/app/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
at Function.Module._load (module.js:325:12)
at Module.require (module.js:380:17)
at require (module.js:399:17)
at Object.<anonymous> (/Users/tlberglund/.atom/packages/asciidoc-preview/lib/asciidoc-preview.coffee:3:23)
at Object.<anonymous> (/Users/tlberglund/.atom/packages/asciidoc-preview/lib/asciidoc-preview.coffee:1:1)
at Module._compile (module.js:475:26)
at Object.requireCoffeeScript [as .coffee] (/Applications/Atom.app/Contents/Resources/app/src/coffee-cache.js:74:19)
at Module.load (/Applications/Atom.app/Contents/Resources/app/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
at Function.Module._load (module.js:325:12)
at Module.require (module.js:380:17)
at require (module.js:399:17)
at Package.module.exports.Package.requireMainModule (/Applications/Atom.app/Contents/Resources/app/src/package.js:651:34)
at Package.module.exports.Package.activateConfig (/Applications/Atom.app/Contents/Resources/app/src/package.js:251:12)
at Package.module.exports.Package.activateNow (/Applications/Atom.app/Contents/Resources/app/src/package.js:232:14)
at /Applications/Atom.app/Contents/Resources/app/src/package.js:221:28
at Package.module.exports.Package.measure (/Applications/Atom.app/Contents/Resources/app/src/package.js:167:15)
at Package.module.exports.Package.activate (/Applications/Atom.app/Contents/Resources/app/src/package.js:215:14)
at PackageManager.module.exports.PackageManager.activatePackage (/Applications/Atom.app/Contents/Resources/app/src/package-manager.js:464:21)
at /Applications/Atom.app/Contents/Resources/app/src/package-manager.js:445:29
at Config.module.exports.Config.transact (/Applications/Atom.app/Contents/Resources/app/src/config.js:350:16)
at PackageManager.module.exports.PackageManager.activatePackages (/Applications/Atom.app/Contents/Resources/app/src/package-manager.js:439:19)
at PackageManager.module.exports.PackageManager.activate (/Applications/Atom.app/Contents/Resources/app/src/package-manager.js:422:46)
at Atom.module.exports.Atom.startEditorWindow (/Applications/Atom.app/Contents/Resources/app/src/atom.js:611:21)
at Object.<anonymous> (/Applications/Atom.app/Contents/Resources/app/src/window-bootstrap.js:12:8)
at Object.<anonymous> (/Applications/Atom.app/Contents/Resources/app/src/window-bootstrap.js:23:4)
at Module._compile (module.js:475:26)
at Object.loadFile [as .js] (/Applications/Atom.app/Contents/Resources/app/src/6to5.js:140:21)
at Module.load (/Applications/Atom.app/Contents/Resources/app/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
at Function.Module._load (module.js:325:12)
at Module.require (module.js:380:17)
at require (module.js:399:17)
at window.onload (file:///Applications/Atom.app/Contents/Resources/app/static/index.js:57:25)
index.js:62 Window load time: 1467ms
Does this mean package.json
should have a dependency on highlights
? I'm happy to PR that in, but my Node-Fu is weak, so I figured I'd ask first.
As being mentioned in running-asciidoctor-securely, defining a safe mode option(ifdef::safe-mode-0[]) can make include directive work. But it failed. Nothing shows up.
How to fix this problem?
In stylesheets\asciidoc-preview.less: 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.
Since there's no status bar, there's no way to see where a link leads. We should add a title attribute to all links that matches the href. The AsciiDoc Preview plugin for Brackets takes this approach.
If you can think of another way to display the URL, please suggest it.
i was trying to install asciidoc-preview on my windows machine with:
apm install asciidoc-preview
which results in the following error:
npm http 304 https://registry.npmjs.org/core-util-is
npm ERR! git clone git://github.com/anthonny/opal-npm-wrapper.git Cloning into bare repository 'C:\Users\gruenefeld.atom.node-gyp.atom.apm_git-remotes\git-github-com-anthonny-opal-npm-wrapper-git-10c5b7b0'...
npm ERR! git clone git://github.com/anthonny/opal-npm-wrapper.git fatal: unable to connect to github.com:
npm ERR! git clone git://github.com/anthonny/opal-npm-wrapper.git github.com[0: 192.30.252.128]: errno=No error
npm ERR! Error: Command failed: Cloning into bare repository 'C:\Users\gruenefeld.atom.node-gyp.atom.apm_git-remotes\git-github-com-anthonny-opal-npm-wrapper-git-10c5b7b0'...
npm ERR! fatal: unable to connect to github.com:
npm ERR! github.com[0: 192.30.252.128]: errno=No error
npm ERR!
npm ERR!
npm ERR! at ChildProcess.exithandler (child_process.js:658:15)
npm ERR! at ChildProcess.emit (events.js:98:17)
npm ERR! at maybeClose (child_process.js:766:16)
npm ERR! at Process.ChildProcess._handle.onexit (child_process.js:833:5)
npm ERR! If you need help, you may report this entire log,
npm ERR! including the npm and node versions, at:
npm ERR! http://github.com/npm/npm/issues
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "c:\Users\gruenefeld\AppData\Local\atom\app-0.174.0\resources\app\apm\node_modules\atom-package-manager\bin\node.exe" "c:\Users\gruenefeld\AppData\Local\atom\app-0.174.0\resources\app\ap
m\node_modules\atom-package-manager\node_modules\npm\bin\npm-cli.js" "--globalconfig" "c:\Users\gruenefeld\AppData\Local\atom\app-0.174.0\resources\app\apm\node_modules\atom-package-manager.apmrc" "--userco
nfig" "C:\Users\gruenefeld.atom.apmrc" "install" "C:\Users\gruenefeld.atom.node-gyp.atom.apm\asciidoc-preview\0.4.2\package.tgz" "--target=0.20.0" "--arch=ia32"
npm ERR! cwd C:\Users\GRUENE~1\AppData\Local\Temp\apm-install-dir-115021-5512-14r6f60
npm ERR! node -v v0.10.35
npm ERR! npm -v 1.4.4
npm ERR! code 128
npm
i got the same error on an linux machine.
I already change my git config with:
git config --global url."https://github.com/".insteadOf [email protected]:
git config --global url."https://".insteadOf git://
but with no success.
Any ideas whats going wrong?
Kind regard
Bernd
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.