-
-
Notifications
You must be signed in to change notification settings - Fork 148
asciidoc-preview in pulsar-editor opens blank window with no text rendered, same occurs in latest atom 1.63 (Markdown IS rendered in pulsar v1.100) #256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Appreciate the contribution! With this, especially since it's failing on the most recent version of Atom, is likely an issue stemming from bumping node versions, with that said the most helpful thing may be to add the logs from the dev pane if you could, that should tell us what's failing. But I do want to note, that because this is a community package there may be limited things we can do, but hopefully still we can find a fix, even if it has to occur on a forked version of |
Hi confused-Techie. |
The dev pane not opening (in some linux builds) is a known issue, that should be fixed in our most recent Alpha Binary, otherwise you could try the fix manually by starting Pulsar with |
"pulsar --no-sandbox" did the trick. Many thanks. pulsar --no-sandbox --version ############################################
Please update the following components: Command DevTools failed to load SourceMap: Could not parse content for file:///tmp/.mount_Linux.WhM1LM/resources/app.asar/node_modules/spelling-manager/lib/BufferSpellingChecker.js.map: Unexpected end of JSON input Now Ctr-Sft-A pressed a few times. The asciidoc-preview window opened and closed as expected but there was no rendering of text. Nothing was added to the console output during this process. |
Hi confused-Techie
I wonder if you would expand on your comment that the problem with asciidoc-preview not rendering text may related to bumping node versions. I have had a look at some of the code for asciidoc-preview but I have no experience of working with node.js or java as I generally use R, Python, PHP, html, slim, Ruby, Sass, erb etc I am intrigued by your comment as being a clue to where I might start looking for the problem. So any pointers that you can give me would be much appreciated. Thanks for your help with this, I should add that I have had found no other problems using pulsar with any of these: |
Edit: I was wrong. That was used correctly. |
Just an update and a thank you to pulsar developers. The process has been made much easier than I expected; using the "Hacking the Core" the build and first investigations went faultlessly. So thanks for that and other assistance. https://pulsar-edit.dev/docs/launch-manual/sections/core-hacking/#check-your-build-tools |
Please always feel free to ask about any issues building or troubleshooting, we'd be more than happy to help. But glad to hear you're looking into this issues as well, thanks a ton for helping out! |
EDIT Correction. In Pulsar 1.101.2023012406 x64 markdown files .md ARE rendered correctly with markdown-preview 0.160.2. The confusion to the contrary came about because markdown-preview-plus 4.11.3 does not appear to render .md files leaving a window with the correct name but blank contents. However, when markdown-preview-plus is enabled it also disables markdown-preview. It is markdown-preview-plus that is not showing a preview. When markdown-preview is re-enabled the preview appears with Ctrl-Shft-M. The preview is also closed (toggled) with the same keys. (In markdown-preview the .md window does not appear to be synchronised with the preview window. ) For clarity, asciidoc-preview still does not render but opens a window with a title and blank contents. Just as it is described above. |
This is some amazing investigation. But due to the failure occurring in the last version of Atom as well, then we can know it's tied to the Electron bump we have both done. So we would have to see exactly what these packages rely on that's changed |
This is all something of a steep learning curve for me. I am working through Hacking the Core & learning about how packages are constructed. I have had a look at ascidoc-preview package and trying to see what would have changed in the environment around the package because the package itself has not changed. I have a set up a dev package for it and I am about to insert debug messages to indicate what is working. Since there are no error messages that I can see and the tests seem to run OK, I surmise that it must be something pretty near the end. Tracking down the html that is used to generate the final output is my goal at the moment. However, I am so new to node.js, never seen coffee in which ascii-preview is largely written it is all a bit hit & miss at the moment. But, I am learning slowly with the help of others paticularly an informed, even if confused Techie! Thank-you. Getting asciidoc-preview will eventually be worked out I a sure because the various editors that have such a preview all seem to use the same application, Asciidoctor.js, to do the job. |
I could do with some help now using pulsar & atom in dev mode to debug the asciidoc-preview package so that I can inspect various variables as the process takes place. QUESTION: My preliminary conclusion looking at all the coffeescript files in lib and transcoding them to javascript, with which I am more familiar, is that the path, filename or extension is not being obtained correctly. A conclusion drawn from the observations that the asciidoc-preview pane is headed "Asciidoc Preview" when "test.adoc preview" with the filename is expected. Similarly the html output obtained on R-click menu on the asciidoc-preview pane is headed "untitled.adoc.html" This html file when saved contains a ... section which appears OK with lots of styles and so on but with a ../ syntactically correct but empty where the output from the .adoc file should be. It seems that the filename cannot be identified for some reason. Writing this I have just noticed that with atom 1.60 the html version of the asciidoc-preview is correctly saved in By debugging the coffeescript (or .js files if I can make them work OK) I hope to tract down the origin of the error. Then look farther for the source of the problem An interesting note is how in writing this description and checking all the details as I go I found the last bit of evidence about the different eroneous path which would have gone unnoticed without this detailed effort. We live & learn. EDIT: I forgot to add that I have been using Mike Dane's Giraffe Academy website to crash learn Javascript - https://youtu.be/TLlGhogq56Y Some of the best learning resources where I have learnt Middleman CMS, Python, CSS, Ruby and several other. |
@ianwillie
|
Thanks for that simple and elegant solution to managing packages. Much easier than using dev subdirectory. I have got my own versions of atom-asciidoc-preview up and running. I will report the results in due course. One point of note is that if we are using a flatpak of atom then the changes which you suggest, or links to them. seem to have to go into the Flatpak systemwide /var/lib/flatpak, or per-user $HOME/.local/share/flatpak. Maybe the same applies to appimages. EDIT: Here is the answer: on running "flatpak run io.atom.Atom" at the top of the Settings, Install Packages screen it says "Packages are published to atom.io and are installed to ~/.var/app/io.atom.Atom/data/packages" and indeed they are: $ ~/Downloads/Pulsar-1.101.2023012406.AppImage (I don't know where to get an Appimage of atom to test that. https://apprepo.de/appimage/atom does not seem to load.) |
That's an interesting point, and sorry to say I don't have the answer there. Something like that might be a good idea to ping |
Update: We seem to be on the right track because various console.log(filename) additions are finding filenames matching the source filename.adoc in atom v1.60.0 asciidoc-preview/lib/main.coffee & asciidoc-preview-view.coffee. However, in pulsar, & atom 1.61 or later not one of these that I have found is correct; these are undefined or very strange. The strangeness is that the form is like "asciidoc-preview://editor/7". Also after keystroke Ctrl-Shft-A which should produce the asciidoc-preview sometimes a new file like "asciidoc-preview://editor/xx" is appearing where xx is a number like 26, 34. They seem to be a files in .../editor which resolutely refuse to be deleted and keep reappearing on Ctrl-Shft-A. I wonder if they are related to a line number where the editor if picking up some sort of error or unexpected End of File. |
Super strange filenames you are seeing there. I wonder, it almost looks like it's generating URIs, we haven't made many changes to our URIs but maybe one is accidentally being passed where it shouldn't? Beyond that I'd probably have to take a look at the packages source code to really know, but I'd probably check to see if this package is using the URIs in any way to open and manage it's saved files? |
Just an update. I am struggling with lack of familiarity wi Javascript, coffescript and node.js. However, this is being rectified by doing some learning on these subject helped by a knowledge of writing in other things like Fortran, Pascal, Python, R and DataBasic once upon a time. It does mean starting right at the beginning which will take a bit of time but I am maintaining interest in getting asciidoc-preview working in pulsar and supporting the project. So I will be back doing more work on this soon. For now, I am stuck using atom 1.60.0 (or VSCodium etc) because for writing websites in AsciiDoc having an integrated preview which renders the code without all the styling and processing that occurs in a browser speeds up writing greatly. I am committed to community supported projects because over the years I have had work interrupted by large companies buying over small innovative software projects and either abandoning them or introducing licences that were so expensive as to be unavailable to mere mortals. But that is a discussion for another time in another place! |
@ianwillie I apploud your efforts to find this bug and learn JavaScript/CoffeeScript at the same time. Really I'm not familiar with CoffeeScript at all myself, I just look at what little I know and try to convert to JavaScript in my head, this is largely why we want to remove CoffeeScript from Pulsar. But to learn these, personally I think these are the best resources (but you may have already found them)
But that does seem interesting, if you'd like I'll try to take a look at it as well, and report any of the findings I'm able to see back here |
Thanks for your support and encouragement. |
Here's an update on what I have been doing.
All the programs given were fairly short, moderately high level and complete so that they could be implemented and run immediately. As a beginner I struggled with the excellent likes of JS MDN & Node.JS & nodejs.org because the examples given were snippets of code that were missing some essential components that would be second nature to experienced users but just not to someone unfamiliar with JS. With hindsight, I realise just how clear and complete these two website are. Thanks for the recommendation confused-Techie.
That is where I am now having learnt JS enough to turn nodedump into a function which can be included as a module & function in asciidoc-preview to track down where the pulsar atom versions >=1.61 loose track of the filename to be rendered in html by comparing with the working atom 1.60.
EDIT: Minutes ago, just received a copy of 7th edition of David Flanagan's "Javascript: The Definitive Guide" much of which I can actually understand. In the past the 6th edition was over my head: so all this effort is definitely worthwhile. |
Love all the learning and effort going into this @ianwillie. please feel free to message me on here or Discord if you ever need any programming (in JavaScript assistance) and I'd be more than happy to help |
@confused-Techie
|
No worries, glad to see youre taking the time to learn things as needed then!
|
Thanks for that @confused-Techie . I've not forgotten about this and thanks for your advice which I will follow. |
I am trying to read through the comments here, but I am unsure if this is the start of a new plugin or an attempt to repair the existing plugin. In light of that I have questions... What is the direction here? |
@ddreggors A quick summary of the conversation here. It seems the package itself is broken, and changes likely need to be made within the package to fix this. But The previous commenter here set out to do exactly this, create a new package to provide this functionality. Although it's been about 6 months since the last activity on their repo, so I'm unsure of their current progress. Otherwise, now that we do bring this up again, it seems that |
@ddreggors @confused-Techie I'm glad to hear that someone is interested. I do have a working version o my asciidoctor preview that I am this very day about to push to github https://github.com/ianwillie/ianasciidocpreview-active-editor-info . I am quite new to using github and it will take me a few hours (maybe days) to sort out how to update this so that it clones properly. My version is simple it will preview an .adoc file in a pane using asciidoctor.js encapsulated in html. The resulting preview styled using asciidotor.css can be resized, scrolled and zoomed. However, syncing the .adoc & preview has defeated me so far because I can't work out how to get internal links ( This is very much a developing project but I do use it for a web site management every day and it works for me. There are a few bugs and quirks which need ironing out. My intention is to write the app in standard html as far as possible and avoid use of webview or electron ipc . The idea is that any changes to ipc or webview being deprecated should not affect the app. It should be independent of nodejs versions. I have had a look at pulsar markdown-preview from pulsar core and it should be quite simple to substitute asciidoctor.js for the renderer, or so I THINK! However, I have failed to get the current markdown-preview to compile because it seems to have dependencies that expect nodejs v18 which is higher than the version used by pulsar. I am not sure how to proceed with this and have not explored any farther. Thanks for your interest and help. EDIT 20231108 I've just updated https://github.com/ianwillie/ianasciidocpreview-active-editor-info and downloaded a clone to test and it appears to be OK. I am not sure about installation but putting the package in ~/.pulsar should work. A link should work too. The read.md is a bit out of date but the first paragraphs are accurate. Please let me know if it seems to work. But it is definitely work in progress and is getting more attention as I learn more thanks to all of you for help. |
I followed instructions, and I see the package loaded in Pulsar, but when I try to toggle nothing opens and I get this error in devloper console:
|
An update on asciidoc-preview.I have followed your suggestion and adapted markdown-preview to preview asciidoc source code. My inclination is to set it up on github as a separate entity rather than a fork of markdown-preview but underlining my great debt to that package. How would you suggest I proceed? You have given me valuable advice for this project often before. Here is a summary of what works so far: magically almost everything. But I have to add that it has taken me a year to learn amongst many other things js, cofeescript (a bit), git, the intricacies of pulsar (and the confusion caused by sunsetting of much of atom help). On the way I wrote my own preview package https://github.com/ianwillie/ianasciidocpreview-active-editor-info which was a learning exercise really and explored unsuccessfully extending (atom-)asciidoc-preview which stopped working due to changes in electron versions. What DOES WORK so far "iansasciidoc-preview-frommarkdownpreview" ( temporary name).
|
@greyp9 I'd suggest installing @ianwillie's package as follows to see if it works for you:
|
@ianwillie, if you're asking how to communicate that it's mainly copied from |
The install appears to have worked:
I see the new options on right-click of an But selecting "toggle" does not appear to do anything. |
I think you want “BrowserPopup” or its key equivalent. EDIT: OK, maybe not. Perhaps @ianwillie can help you. ;-) |
Thanks. "Toggle" and "BrowserPopup" do not seem to do anything. "ZoomUp" and "ZoomDown" cause the display of an exception: stack trace:
|
Do you have any reports that |
Here is a sample
|
Honestly, I don't know. It's not popular enough of a package for us to know that sort of thing. The only major thing we've done since forking from Atom (the only thing that would affect package compatibility, anyway) is bump the version of Electron. That comes with its own bump of Node, so either of those things could result in an incompatibility. If any of us used AsciiDoc ourselves, or had need for an AsciiDoc package, we'd be able to get this fixed. But since we don't, it hasn't been a priority. If I get a moment I'll at least try to run |
OK, the good news is that the fix seems to be pretty easy. If it had been more involved than this I don't know if I would've had the stamina. I cloned the original repo and ran it locally. I managed to discover that the preview view was being created, but then nothing else was happening. I added one extra function call in the constructor and that seems to have gotten it working for me locally. @greyp9, revert what I had you do earlier:
Instead, please first uninstall any existing copy of
This ought to get things working again. I don't plan to maintain this package, but I don't plan to delete that fork from my repo, either. If you were paranoid, you could fork my fork just to have an archived copy somewhere. |
@savetheclocktower As the original package seems to have been archived, this could be a great use case for Or otherwise if you're confident in it I can just go through the commit history. Honestly considering this issue was opened before |
Hi everyone, My conclusion (at the moment!) is that fixing atom-asciidoc-preview is great but in the long term it will be far preferable to extend markdown-preview because maintenance will be straightforward after the current version settles down with the Treesitter language tools. atom-asciidoc-preview seems a fairly complex package while markdown-preview is much simpler to comprehend, is uptodate now and will be maintained as a pulsar core package. Relying, for the html generation, on asciidoctor.js which is maintained by the asciidoctor organisation relieves us of the need to maintain that side of it. Almost all configuration can be written into each asciidoctor source file and there is no need for the preview package to handles these. Such configuration includes the likes of table of contents, css file source, choice & management, how security matters are handled (unsafe, server, secure), what highlighter to use (highligh.js, rouge, etc) generally in front matter. Markdown-preview can easily be extended to have the ability to preview asciidoctor files because I have done it and use it. Alternatively a fork which previewed asciicoctor files but not markdown could be maintained. Again, I have done this and use it. These versions that I have written are programmers version which work and rely on changes being added to code rather than a config file. So, at this point, they are not for public consumption, but are proof of concept. In the near future I will get some of this onto github. These are first thoughts and I will return and edit this adding details of the source references. Many thanks to all who have helped me on the way to grasping how to write packages for pulsar-edit. |
This worked on my copy locally. |
This worked on my setup too. But I used Package Manager > Install |
And it does! Thanks very much, @savetheclocktower . |
@savetheclocktower
in some versions of the coffeescript transpiler the bare super produces an error because the latest coffeescript expects "super()" or "super arguments..." and chokes on "super" alone. see https://stackoverflow.com/questions/49858400/unexpected-indentation-in-coffee-script and http://coffeescript.org/announcing-coffeescript-2/ I cannot see how this is connected but it is odd that the transpiling error appears in the same place as your insertion which made the package render properly. Many thanks for that! I have compiled the package to all JS and it seems to work fine. |
@confused-Techie can you give more details on |
I added this to Please feel free to add comments on that issue/request to add this package. |
|
Hi Folks, I commented in a few posts earlier in May that I thought the way to go would be to modify pulsar markdown-preview to preview asciidoctor. Markdown-preview is an uptodate expertly maintained pulsar bundled package. All that is needed is to adapt it to render the preview using asciidoctor.js which is maintained by asciidoctor.org and relieves pulsar team of that burden. atom-asciidoctor-preview is no longer maintained by asciidoctor.org and I think maintenance will be more difficult than that just suggested. Well, I have had success in adapting markdown-preview in two different versions 1. which previews only asciidoc files with extensions like .adoc & .ad & 2. a different version which will preview both markdown and asciidoc files. 1.https://github.com/ianwillie/IansascidocPreviewFrommarkdownpreviewnomd/tree/releaseCandidateV0.1.0# on branch: releaseCandidateV0.1.0 branch: releaseCandidateV0.1.0 (NOT main)
This is very much an alpha proof of concept and the asciidoc only version is fully functional for me in daily use, the other is more buggy but works for me too. I will keep developing these but the recent admirable modernising changes in markdown-preview to the language tools (introduced in version 1.117.0) to update them to treesitter versions & speeding up buffer rendering have proved incompatible with my packages (based on version 1.116.0) for the moment. I will incorporate these changes when I learn more about treesitter language tools. Nonetheless, these two packages presented here based on v1.116.0 work fine for me. One caveat - this is my second experience of adapting and publishing a package, so there are very many rough edges. These are commented on in the READMEs and the spec tests wait to be adapted to these packages and do not work. I am not sure how you would install these packages because they are modified from a core pulsar package which is bundled and I could not fork them from the original. I suggest download the zip file, extract and put a link I guess that I should probably put this post somewhere else and there are comments on Discord about the process of maintaining atom-asciidoc-review: https://discord.com/channels/992103415163396136/996581846286618694/1255084745956655146 Many thanks to all of you who have helped me get so far, and encouraged me. Ian |
Thanks in advance for your bug report!
What happened?
While editing an asciidoc text file in pulsar v1.63, window opens but text does not render. See screenshots attached. I
have found that the same bug occurs in the latest flatpak version of atom but works fine in the previous release. These releases are listed below. This was tested with the file test.html.adoc . (However, I cannot
attach it because adoc files are not supported by github apparently so remove the terminal ".txt".)
So it seems that some change has occurred in both pulsar 1.63 and atom 1.63 which prevents asciidoc-preview rendering text. I use asciidoc a lot for websites because the syntax is concise and quick to type for textual work.
asciidoc-preview renders correctly in this flatpak version of atom:
sudo flatpak update
--commit=cea629ca495e72d577eae4e64bff902ead937564bc67be7fd6d584554be3de36
io.atom.Atom
Atom 1.60.0 x64 from spash screen.
Electron 9.4.4, Chrome 83.0.4103.122, Node v12.14.1
Release notes from github 1.60.0 atom-build released this (2022) Mar 8
v1.60.0 03c9ad9
asciidoc-preview opens a blank window with no rendering in this version of atom:
Commit:
04c0909c66741eaedd959d013f18df74f6244ba9455914f85511e26601d23e01
Parent:
cea629ca495e72d577eae4e64bff902ead937564bc67be7fd6d584554be3de36
Subject: Change xprop archieve (d351a5c4)
Date: 2022-12-21 20:31:23 +0000
Atom splash screen: 1.63.1 x64
Electron 11.5.0, Chrome 87.0.4280.141, Node v12.18.3
Release notes from github 1.63.1 released this (2022) Nov 23
v1.63.1 539d250
TEST.html.adoc.txt
Which OS does this happen on?
🐧 Arch based (Manjaro, Garuda, etc.)
OS details
Manjaro latest versions
Which CPU architecture are you running this on?
64-bit(x86_64)
What steps are needed to reproduce this?
Open pulsar.
Open file test.html.adoc (attached but remove terminal ".txt" containing these 5 lines:
`
= TEST asciidoc rendering
Test asciidoc rendering.
`
Install asciidoc-preview
Open above file.
With cursor in file press Ctrl+Shift+A Window opens but text does not
render.
Repeat the procedure with the two different flatpak versions of atom
listed above to see the same bug appear in the l.63 version detailed
above.
Additional Information:
Screenshot: Pulsar 1.63 showing no asciidoc-preview rendering of text

Screenshot: Atom 1.63 showing no asciidoc-preview rendering of text

Screenshot: Atom 1.60 showing full asciidoc-preview rendering of text

The text was updated successfully, but these errors were encountered: