help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: text formating


From: Gottfried
Subject: Re: text formating
Date: Wed, 8 Feb 2023 16:49:47 +0000

Hi Jean,
I installed markdown-mode in Emacs, but I have Emacs 28.2, so I can’t set the keymap for C-c a.

I also installed Pandoc and emacs-pandoc-mode

I opended emacs and evoked markdown-mode and it opened my file in markdown-mode. So at least it works.

So now there is only the question how to use it.

Kind regards

Gottfried


Am 07.02.23 um 23:28 schrieb Jean Louis:
* Gottfried <gottfried@posteo.de> [2023-02-07 20:26]:
Hi Jean,

a side question:
................................................................
I installed markdown and Asccidoc in my distro GNU Guix, in order to try it
out.

...................................................................
but markdown can be used only in installing "ReText" or "ghostwriter"


How do you use them in Emacs?

Search for discount markdown, it has table of contents feature, and
valid HTML, and is fastest.

You can install markdown-mode for Emacs.

markdown is basically used on command line, in shell, like:

echo "## Hello" | markdown
<h2>Hello</h2>

Emacs helps you to make that conversion easily. markdown-mode has
preview already.

Can you install markdown-mode?

The same with Asccidoc.

I have made functions so I just press single key for conversion.

How can I bind that function to some key like C-c a ?

(defun rcd-markdown-preview ()
    "Preview Markdown."
    (interactive)
    (let* ((output (rcd-markdown (buffer-string)))
         (file (concat (buffer-file-name) "-MD.html")))
      (with-temp-file file (insert output))
      (browse-url file)))

You can do following:

(keymap-set markdown-mode-map "C-c a" #'rcd-markdown-preview)

You need Emacs 29.1 for that function to work.

I have just tried it, it works well.


--



Attachment: OpenPGP_0x61FAF349C9FB7F94.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]