-
-
Notifications
You must be signed in to change notification settings - Fork 65
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
Include text/html using markdown and pandoc #549
Comments
Check out markdown switch in composer 😉 requires cmark or similar. See
config if using custom processor.
søn. 9. sep. 2018 kl. 11:41 skrev dnebauer <[email protected]>:
… Found a fascinating conversation on Hacker News about scripting mutt to
include a html message in outgoing email, as well as plaintext, by writing
emails in markdown and having pandoc convert it to standlone html prior to
sending (see here <https://news.ycombinator.com/item?id=12325767>, and
here <https://news.ycombinator.com/item?id=12324506> for the full thread).
Is there any way for astroid users to do something similar using its
current capabilities, i.e., without having to patch astroid itself?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#549>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AADd-8xHCmlC-R-Qqpx0ADneEKiNdtIoks5uZOJRgaJpZM4WgN3C>
.
|
Not sure what you mean by "markdown switch in composer" -- can you point me to anywhere with more information (wiki? github pages?). Does this switch, whatever it is, control whether an html part is included in outgoing messages? By "See config if using custom processor" do you mean the |
See this issue: #430, is that what you mean? You can write your e-mail as normal, but with markdown formatting. If you flip the Markdown switch on the e-mail will be written as two parts: the raw message as text/plain and a processed text/html part which has been piped through cmark (or the processor of your choice). Make sure you have it installed. Note that there are some preview issues: #532 |
This feels like one of those conversations where everybody else knows something I don't. My new message window does not have a markdown switch: Here is the editor section of my config file:
I've also tried marked and pandoc as markdown processors, with not effect. The processors cmark, marked and pandoc are all installed. Is there some step I have to take to enable the markdown switch? Maybe this feature is available with editors other than gvim? |
It is only visible in the preview view, so either with external editor or
if you :wq vim. Note that you can always open grim again with enter.
man. 10. sep. 2018 kl. 16:45 skrev dnebauer <[email protected]>:
… This feels like one of those conversations where everybody else knows
something I don't. My new message window does not have a markdown switch:
[image: astroid_new_message]
<https://user-images.githubusercontent.com/1834722/45304183-b0a1aa80-b556-11e8-877e-682235435f20.png>
Here is the editor section of my config file:
"editor": {
"cmd": "gvim -geom 10x10 --servername %2 --socketid %3 -f '+set ft=mail' '+set fileencoding=utf-8' '+set ff=unix' '+set enc=utf-8' '+set fo+=w' '+/^To:/' '+startinsert!' %1",
"external_editor": "false",
"charset": "utf-8",
"save_draft_on_force_quit": "true",
"attachment_words": "attach",
"attachment_directory": "~",
"markdown_processor": "cmark"
},
I've also tried marked and pandoc as markdown processors, with not effect.
The processors cmark, marked and pandoc are all installed.
Is there some step I have to take to enable the markdown switch? Maybe
this feature is available with editors other than gvim?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#549 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AADd-_HoKvxk8cxgr45nb3wX4yKXvx-oks5uZnsJgaJpZM4WgN3C>
.
|
First, *doh*, I've sent hundreds of emails using astroid and can't believe I never noticed the Markdown and Signature switches on the preview window. Talk about inattentional blindness... Second, *sigh*, that just leads to another problem. When I toggle the Markdown switch the html display is suppressed, with an "Alternative part (type: text/html) - potentially sketchy" widget appearing in its place: This is the usual behaviour when displaying emails, and in those cases I can open the html part by moving focus to the "sketchy" widget with Ctrl-j and opening it by pressing Enter on my keyboard. When previewing an outbound email, I can jump to the "sketchy" widget with Ctrl-j as usual but the Enter key press is intercepted and used to open the email once again for editing. According to #19 it should be possible to open the "sketchy" widget with the 'o' key when it has focus, but in preview mode this has no effect (nor does pressing capital 'O'). I experimented with the Is there any way to open the html part in preview mode? (I'm sure it's ridiculously easy when you know the trick.) Is there any way to ensure that html displays by default in preview mode? I should add that I've checked the raw email using 'V' and the html part is present and correct. |
dnebauer writes on September 11, 2018 4:58:
This is the usual behaviour when displaying emails, and in those cases I can open the html part by moving focus to the "sketchy" widget with Ctrl-j and opening it by pressing Enter on my keyboard. When previewing an outbound email, I can jump to the "sketchy" widget with Ctrl-j as usual but the Enter key press is intercepted and used to open the email once again for editing. According to #19 it should be possible to open the "sketchy" widget with the 'o' key when it has focus, but in preview mode this has no effect (nor does pressing capital 'O').
It should work with C+Space, but it does not seem to do so! This is a
bug. The normal ThreadView bindings work (though they don't show in the
help view - a bug), though they are shadowed by EditMode keybindings if
they conflict.
I experimented with the `thread_view.preferred_type` and `thread_view.preferred_html_only` settings but they made no difference in preview mode.
You should be able to get HTML to always show, I think this is possible,
but there are some other issues with that: #532.
It also made no difference whether I used internal gvim or external gvim to edit emails.
This should not make any difference. I mentioned it just because you
cannot see the Markdown-switch with internal gvim untill you close the
editor.
Is there any way to open the html part in preview mode? (I'm sure it's ridiculously easy when you know the trick.)
This might be a bug --- for now you can probably save the message as
draft, and open the draft like a normal email and preview it.
Is there any way to ensure that html displays by default in preview mode?
(covered above)
I should add that I've checked the raw email using 'V' and the html part is present and correct.
|
I should point out that the original issue reported here -- writing plain text emails in markdown and including an html part in the resulting email -- has been resolved. The remaining problem is getting the html part to always display in the preview. It currently takes 5 key presses to show: M (Markdown switch), Ctrl-j (to move focus to "sketchy" widget) and Ctrl-Space (to open html part). That is annoying if you want to routinely preview html output, which I do. If I'm reading it correctly, though, #532 is addressing this problem so I'll subscribe to it and close this issue. Thanks for your prompt replies throughout this issue and, as always, thanks for astroid. |
No worries 😊 should definitely fix #532. This should avoid having to push
any keys. If there is interest for it markdown switch default could also be
made configurable.
you could also experiment with simpler key bindings to get key count down.
tir. 11. sep. 2018 kl. 08:52 skrev dnebauer <[email protected]>:
… I should point out that the original issue reported here -- writing plain
text emails in markdown and including an html part in the resulting email
-- has been resolved.
The remaining problem is getting the html part to always display in the
preview. It currently takes 5 key presses to show: M (Markdown switch),
Ctrl-j (to move focus to "sketchy" widget) and Ctrl-Space (to open html
part). That is annoying if you want to routinely preview html output, which
I do. If I'm reading it correctly, though, #532
<#532> is addressing this
problem so I'll subscribe to it and close this issue.
Thanks for your prompt replies throughout this issue and, as always,
thanks for astroid.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#549 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AADd-1XUA_7fIjlirDQ75ycbz_ja8pNAks5uZ12_gaJpZM4WgN3C>
.
|
Please add my vote to making it possible to configure the Markdown switch to be on by default. |
dnebauer writes on September 11, 2018 11:31:
Please add my vote to making it possible to configure the Markdown switch to be on by default.
`editor.markdown_on` option added in master.
|
Found a fascinating conversation on Hacker News about scripting mutt to include a html message in outgoing email, as well as plaintext, by writing emails in markdown and having pandoc convert it to standlone html prior to sending (see here, and here for the full thread).
Is there any way for astroid users to do something similar using its current capabilities, i.e., without having to patch astroid itself?
The text was updated successfully, but these errors were encountered: