I've put together an initial version of a Markdown editor and viewer called amimarkdown and uploaded it to os4depot and aminet today. Hopefully some of you may find it useful and any feedback and suggestions are more than welcome.
It works. but crashes when I just load .md from a VIM , and press "update" in the HTMLview task. Maybe because I use os4depot's version and there some newer one?
Can you ping me the markdown file and I'll send you the debug version ofit to get the stack trace? It worked fine with my markdown files here so would be good to nail down what's happening.
The versions of the mui custom classes I've got installed are:
15.Workbench:MUI/Libs/mui> version full file TextEditor.mcc TextEditor.mcc 15.55 (18/12/2020) Copyright (C) 2005-2020 TextEditor.mcc Open Source Team [OS4/PPC] 15.Workbench:MUI/Libs/mui> version full file HTMLview.mcc HTMLview.mcc 13.4 [OS4/PPC] (20/12/2007) Copyright (C) 2005-2007 HTMLview.mcc Open Source Team
Great! I write all documentation in MarkDown on my Windows laptop, then export in various formats using Pandoc. Would be great if we had a MarkDown editor for OS4 so that I could use the PC less.
Installed and running but when opening an .md file written on a PC, the program adds too many empty lines after a paragraph. Perhaps AmiMarkDown is unaware that the PC uses the CR+LF control character combination for a line break, while AmigaOS only uses LF?
And... yes, you should think of a new name for the program Ami this and Ami that really sounds clueless
There is README.md. Load it, and click "Update" it then crashes in the HTMLview, in the DecoderThreadPC function, with 8x00000003.
Crashlog saying it can't load vimllogo.gif , and assmebler instruction which crashing is "lwz r14,12(r15)", and r14 are 0xFFFFFFFF, and r15 are 0x000000.
There is full crashlog
kernel 54.30 (1.1.2021) AmigaOne X5000 release
Machine model: 9 (AmigaOne X5000/20)
Dump of context at 0xEFA97000
Trap type: DSI exception
DSISR: 00000000 DAR: 0000000C
No matching page found
Machine State (raw): 0x0002F030
Machine State (verbose): [Critical Ints on] [ExtInt on] [User] [IAT on] [DAT on]
Instruction pointer: 0x7CCB50B0
Crashed process: HTMLview - https://github.com/vim/vim/blob/master/runtime/vimlogo.gif (0x5DD7D7B0)
DSI verbose error description: Access to address 0x0000000C not allowed by page protection in user state (protection violation)
Access was a load operation
Exception Syndrome Register: 0x00000000
0: 5D07AF20 5C93CD90 00000002 5C93CE30 6842DF50 01955038 FFFFFFFF 5CD53DF8
8: 5DD7D834 68430000 5E24CE24 6FEB3228 00000000 0000000D FFFFFFFF 00000000
16: 5EAF0D70 5C93CF90 7CCB568C 7CCB0000 5C93CDA0 6842DE0E 68430000 7CCBE330
24: 7CCC0000 FFFFFFFF 0239ECC2 00000000 5CD53DF8 5DD7D7B0 02008624 5CD53CC8
CR: 33953395 XER: E000007E CTR: 7CCB4FBC LR: 7CCB50A4
Hi yeah, it looks like the htmlview class doesn't like the image links. If I remove the top four lines of the README.md from that file, so that the first bit of content is
# MD4C Readme
then "update" works fine for me. Do you get the same?
Looking at the htmlview class, it hasn't been updated in 5 years but the latest commits are about a year after the last public release so I'll take a look at that and see if I can see what the problem is.
Thanks for the feedback guys, if you manage to find any other problems, let me know.
I'm adding the various conversion options but I guess I'll have to dive into htmlview's source code too for the image problem, I'm crossing my fingers it won't be too hard to track down the issue, famous last words!
@billyfish If it will be an issue in mui class, Thore surely will fix it. Just need to be sure if it is, and create a proper bug-report (or write to Thore directly, he very helpful when it comes to mui and mui classes fixes).
Ok a new version has been uploaded to os4depot.net. Amongst other things, I've moved to using the OS launch-handler for showing the converted html which gets rid of the image problems with HTMLview. It's still a work-in-progress, and yes the name will change @trixie . Any feedback, good, bad or indifferent, is welcome.
Thanks for working on the program, such a tool is badly needed! And... don't lose any sleep over the comments on OS4depot: looks like someone had a bad day or two.
Choose of a browser instead of an HTML view class is probably good, but it spawns a new instance for every "update" hit :) Is it possible to make it so you will have to open it one time (for the first "update" click), and then each other "update" click will refresh content in the already opened browser?
Is it possible to make it so you will have to open it one time (for the first "update" click), and then each other "update" click will refresh content in the already opened browser?
Yeah I wanted that too According to the launch handler docs, it's a single event where you instantly close the file handle that you use to launch the browser. I'll look to split the convert function into convert or "convert and launch". That way you can just use convert and then refresh the web browser window.
So I've just uploaded a new version to os4depot, quite a few nice changes in there like a proper(!) toolbar and bits for generating tables, images, etc.. As ever, any level of feedback is more than welcome.
1. Project menu both Load and Save have the same shortcut 2. It would be good to have a shortcut for the Project > Update. It can be handy 3. There is no way to save the Settings, if you do a change. They are not saved on window close, nor there are any buttons to do that. 4. In settings, "Allow blocks" and "Allow spans" have the same bubble help text 5. At the main window, at the buttons, if you have assigned any shortcuts, it would be great if you show them on help bubbles as well 6. If you start a new project, you cannot preview it. I guess because there is no way to run md4c while there is no file. Maybe create a new one only in Ram, and work with that. 7. I don't know if you have this in your plans, but it would be good if there was a way to use always a specific browser and not open new tabs all the time. I am working on ideas on that, and I will be back with proposals. I guess a good candidate would be to use NetSurf, since it doesn't need to support Javascript. Which brings us maybe to a way to set if the user wants to use OpenURL (like it is now) or use ARexx to send the url to a specific browser. And let the user create it. 8. Choices that open a new window, like adding a link, maybe it would be good to close after the user press OK. 9. The last version includes Makefile and the project file from Codebench, which might not needed.
The AmiMarkDown is getting better and better. Thank you for doing this.
Yassou George, thanks for trying it out and finding these, I'm working through them I've done 1-4 and 8 so once I've got the other ones done, I'll upload an updated version. For the others:
Quote:
5. At the main window, at the buttons, if you have assigned any shortcuts, it would be great if you show them on help bubbles as well
I'll investigate whether this can be done automatically in TheBar mcc docs as the toolbar has the shortcuts defined. If not, I can add them explicitly to the help bubbles.
Quote:
6. If you start a new project, you cannot preview it. I guess because there is no way to run md4c while there is no file. Maybe create a new one only in Ram, and work with that.
Good find, I hadn't noticed that. Yup the md to html part works ok without being saved, but it saves the html to a file with the original filename and appends ".html". So when it hasn't been saved yet, it was silently stopping at this point.
Quote:
7. I don't know if you have this in your plans, but it would be good if there was a way to use always a specific browser and not open new tabs all the time. I am working on ideas on that, and I will be back with proposals. I guess a good candidate would be to use NetSurf, since it doesn't need to support Javascript. Which brings us maybe to a way to set if the user wants to use OpenURL (like it is now) or use ARexx to send the url to a specific browser. And let the user create it.
Yeah I agree, like @kas1e mentioned too, that opening a new tab every time is a pain. Launch-Handler doesn't seem to offer the function to reload an existing tab if the url is already open. So any proposals that you have would be great!
Quote:
9. The last version includes Makefile and the project file from Codebench, which might not needed.
oops!
Again thanks for going through the pain of testing it and the bug reports, it's really appreciated