Skip to content
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

Preview commands for various tasks #2

Open
lassik opened this issue Jun 21, 2019 · 2 comments
Open

Preview commands for various tasks #2

lassik opened this issue Jun 21, 2019 · 2 comments

Comments

@lassik
Copy link
Owner

lassik commented Jun 21, 2019

Preview Unix manual page written in AsciiDoc:

(defun my-live-preview-asciidoc-manpage (src-buf)
  (insert (with-current-buffer src-buf (buffer-string)))
  (shell-command-on-region
   (point-min) (point-max)
   "asciidoctor -b manpage -o - - | mandoc"
   (current-buffer))
  (Man-fontify-manpage))

MacOS packages: brew install asciidoctor mandoc

@lassik
Copy link
Owner Author

lassik commented Jun 21, 2019

Preview Unix manual page written directly in nroff using man/mdoc macros:

(defun my-live-preview-manpage (src-buf)
  (insert (with-current-buffer src-buf (buffer-string)))
  (shell-command-on-region (point-min) (point-max) "mandoc" (current-buffer))
  (Man-fontify-manpage))

@lassik
Copy link
Owner Author

lassik commented Jun 21, 2019

One can also use nroff -man instead of mandoc in the above shell commands. Formatting will be slightly different.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant