all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Gottfried <gottfried@posteo.de>
To: "help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>,
	Jean Louis <bugs@gnu.support>
Subject: Re: asciidoctor
Date: Fri, 10 Feb 2023 15:20:19 +0000	[thread overview]
Message-ID: <1116049b-1bbf-e1c0-ff33-f5f5400702f0@posteo.de> (raw)
In-Reply-To: <Y+U+SW2VW7OLBwhs@protected.localdomain>


[-- Attachment #1.1.1: Type: text/plain, Size: 2122 bytes --]

Hi Jean,

thank you very much.

I copied it into my init.el file and it works.

when I did a

C-c a my browser Icecat opened and the file was shown.

I am very happy.

kind regards

Gottfried


Am 09.02.23 um 19:41 schrieb Jean Louis:
> * Gottfried <gottfried@posteo.de> [2023-02-09 19:51]:
>> Hi everybody,
>>
>> I installed asccidoc and asciidoctor
>>
>> and I was able to open adoc-mode in emacs.
>>
>> But what are with those messages?
> 
> You need not put attention on it. It is not critical. adoc-mode will
> work.
> 
> Here are some handy functions, I have modified it for you that you get
> preview of Asciidoc by using `asciidoctor` implementation (not
> asciidoc one). Both are good, but try this one first.
> 
> You need to put functions somewhere.
> 
> If you are in markdown or asciidoc mode you will get preview with C-c a
> 
> (defun string-to-file-force (string file)
>    "Prints string into file, matters not if file exists. Return FILE as file name."
>    (with-temp-file file
>      (insert string))
>    file)
> 
> (defun rcd-command-output-from-input (program input &rest args)
>    "Return output string from PROGRAM with given INPUT string and optional ARGS."
>    (let* ((output (with-temp-buffer
> 		   (insert input)
> 		   (apply #'call-process-region nil nil program t '(t nil) nil args)
> 		   (buffer-string))))
>      output))
> 
> (defun rcd-asciidoctor (string &rest args)
>    "Return HTML by using Asciidoctor markup STRING."
>    (let ((asciidoctor (executable-find "asciidoctor")))
>      (apply 'rcd-command-output-from-input "asciidoctor" string "-" args)))
> 
> (defun rcd-asciidoctor-preview ()
>    "Preview asciidoctor"
>    (interactive)
>    (let ((asciidoctor (executable-find "asciidoctor")))
>      (when asciidoctor
>        (let* ((output (buffer-string))
> 	     (output (rcd-asciidoctor output))
> 	     (file (string-to-file-force output "asciidoctor-preview.html")))
> 	(browse-url file)))))
> 
> (require 'adoc-mode)
> (define-key adoc-mode-map (kbd "C-c a") #'rcd-asciidoctor-preview)
> 
> 


[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3191 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

      reply	other threads:[~2023-02-10 15:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-09 16:50 asciidoctor Gottfried
2023-02-09 17:04 ` asciidoctor Eli Zaretskii
2023-02-09 18:41 ` asciidoctor Jean Louis
2023-02-10 15:20   ` Gottfried [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1116049b-1bbf-e1c0-ff33-f5f5400702f0@posteo.de \
    --to=gottfried@posteo.de \
    --cc=bugs@gnu.support \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.