Skip to content
This repository has been archived by the owner on Dec 28, 2022. It is now read-only.

AsciiDoc Preview not loading #279

Open
cyburdine opened this issue Oct 31, 2018 · 10 comments
Open

AsciiDoc Preview not loading #279

cyburdine opened this issue Oct 31, 2018 · 10 comments

Comments

@cyburdine
Copy link

Description

Your description.
Had this working on my old laptop (mac), and am trying to get this working on my new laptop (mac). I have an open adoc file and I press shift+cmd+a, the preview window opens, but never renders, it only shows "Loading AsciiDoc..."

  • Atom version: 1.32.1
  • OS: MacOS High Sierra (10.13.6)
  • asciidoc-preview version: 2.12.2
  • language-asciidoc version: 1.11.0

Screenshots

screen shot 2018-10-31 at 2 13 12 pm

Syntax example

:scrollbar:
:data-uri:
:linkattrs:
:toc2:
:docname: Ansible Tower Quickstart Guide
:show_solution: false


== {docname}
Maintained by
Justin Burdine, RHCE
[email protected]
Sr. Cloud Solution Architect


This document contains my notes from the last time I installed Ansible Tower and should be up to date.  I do my best to update/verify these steps every time I install Ansible Tower.  Having said that, this should be used only as reference and should be checked against the official Ansible Tower installation documentation.

For further details on how to deploy Tower please see: https://docs.ansible.com/ansible-tower/latest/html/installandreference/index.html

:numbered:

== Attach RH Subsription, Upgrade System, Install Ansible
. Connect to the system you want to install Ansible Tower on.
+
[source,sh]
----
[root@control ~]\# subscription-manager register
[root@control ~]\# subscription-manager attach
[root@control ~]\# yum upgrade
[root@control ~]\# yum install ansible
----

== Download The Latest Version Of Ansible Tower (Bundled Installer)
. We now need to download the latest version of Ansible Tower, in this example I'm using the bundled installer which includes the dependancies needed for Tower. I choose to do this because some customers don't have internet access for their
+
[source,sh]
----
[root@control ~]\# wget https://releases.ansible.com/ansible-tower/setup-bundle/ansible-tower-setup-bundle-latest.el7.tar.gz
[root@control ~]\# tar xzvf ansible-tower-setup-bundle-latest.el7.tar.gz
[root@control ~]\# cd ansible-tower-setup-bundle-3.1.5-1.el7
----
@cyburdine
Copy link
Author

I did note that when looking at the browser console I get a few errors when the preview window loads.

screen shot 2018-10-31 at 2 17 17 pm

hope this provides insight.

@ldez
Copy link
Member

ldez commented Oct 31, 2018

This is an incompatibility with tree-sitter grammars.
For now, disable tree-sitter parsers: this option in core settings should be disabled (as in picture):

@cyburdine
Copy link
Author

Worked perfectly! thanks for the quick fix!

@Tejeev
Copy link

Tejeev commented Nov 29, 2018

Thanks Idez!

@bschwarzent
Copy link

In my case the problem appears as soon as I include a code block with syntax set to javascript. Other languages, such as java or json are fine.

Disabling the tree sitter parsing (whatever that is) helps, although this seems to be only a temproary solution. I noticed a similar issue in the markdown-preview-plus package. They seem to have fixed it.

@ggrossetie
Copy link
Member

I think we should add this workaround in the README no ?
For reference the error is:

Uncaught (in promise) TypeError: grammar.tokenizeLines is not a function
    at highlightSync (file:///C:/Users/ggrossetie/.atom/packages/asciidoc-preview/lib/highlights.coffee:44:26)
    at tokenizeCodeBlocks (file:///C:/Users/ggrossetie/.atom/packages/asciidoc-preview/lib/renderer.coffee:145:27)
    at file:///C:/Users/ggrossetie/.atom/packages/asciidoc-preview/lib/renderer.coffee:23:7
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)

@tcowan
Copy link

tcowan commented Jan 10, 2019

I am having this same issue, and when I removed the [source,C] lines (and I used languages bash, text and C), the preview panel would begin working again.

Disabling the Tree Sitter Parsing allows the preview panel to work and allowed me to leave the [source] statements in place.

@ericjacolin
Copy link

I am having the same problem on any document. Disabling tree sitter parsing did not help.
On the console:

handler is not defined ReferenceError: handler is not defined
    at process.<anonymous> (/opt/atom/resources/app.asar/src/task-bootstrap.js:51:20)
    at emitTwo (events.js:106:13)
    at process.emit (events.js:194:7)
    at process.nextTick (internal/child_process.js:766:12)
    at _combinedTickCallback (internal/process/next_tick.js:73:7)
    at process._tickCallback (internal/process/next_tick.js:104:9)

Ubuntu 18.04
ascii-doc-preview 2.13.1

@ggrossetie
Copy link
Member

ggrossetie commented Aug 4, 2019

@ericjacolin I don't think it's the same issue. The stacktrace does not seem related to the Asciidoctor extension.
Did you try to reinstall the extension/update Atom?

@ericjacolin
Copy link

Thanks. Yes, to no avail.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants