unofficial mirror of emacs-orgmode@gnu.org
 help / color / Atom feed
* [PATCH] Add markdown support to contrib/org-man export
@ 2020-06-14 20:56 Jb
  2020-06-23  4:05 ` Kyle Meyer
  0 siblings, 1 reply; 2+ messages in thread
From: Jb @ 2020-06-14 20:56 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1236 bytes --]

Hey Org-mode enthusiasts,

Find attached a patch adding export of manual links for markdown.

I wanted to get links to man pages to work nicely for my blog 
using ox-hugo, an org exporter based on markdown, built by 
well-known org enthusiast Kaushal Modi.


Org snippet to demonstrate export to markdown feature:

--8<---------------cut here---------------start------------->8---
I sure love [[man:emacs][GNU Emacs]].
--8<---------------cut here---------------end--------------->8---

org-md-export-to-markdown before (link description missing, booh):

--8<---------------cut here---------------start------------->8---
I sure love http://man.he.net/?topic=emacs&section=all.
--8<---------------cut here---------------end--------------->8---

Export to markdown after (pretty, valid markdown, yey):

--8<---------------cut here---------------start------------->8---
I sure love [GNU 
Emacs](http://man.he.net/?topic=emacs&section=all).
--8<---------------cut here---------------end--------------->8---

This is my first contribution (I welcome feedback regarding patch 
formatting etc). No FSF papers due to contrib/.
Happy I can finally contribute /something/ back, and scratching 
that itch feels nice.

Have a fantastic day.

--
Jb


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-contrib-ol-man.el-Add-markdown-support-to-org-man-ex.patch --]
[-- Type: text/x-diff, Size: 799 bytes --]

From c7c2fe978a134347a0b6c30667015c687803eb12 Mon Sep 17 00:00:00 2001
From: Jb DOYON <jb@jiby.tech>
Date: Sun, 14 Jun 2020 21:19:20 +0100
Subject: [PATCH] contrib/ol-man.el: Add markdown support to org-man export

---
 contrib/lisp/ol-man.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/contrib/lisp/ol-man.el b/contrib/lisp/ol-man.el
index 580556a..5cb7e01 100644
--- a/contrib/lisp/ol-man.el
+++ b/contrib/lisp/ol-man.el
@@ -68,6 +68,7 @@ PATH should be a topic that can be thrown at the man command."
      ((eq format 'latex) (format "\\href{%s}{%s}" path desc))
      ((eq format 'texinfo) (format "@uref{%s,%s}" path desc))
      ((eq format 'ascii) (format "%s (%s)" desc path))
+     ((eq format 'md) (format "[%s](%s)" desc path))
      (t path))))
 
 (provide 'ol-man)
-- 
2.20.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Add markdown support to contrib/org-man export
  2020-06-14 20:56 [PATCH] Add markdown support to contrib/org-man export Jb
@ 2020-06-23  4:05 ` Kyle Meyer
  0 siblings, 0 replies; 2+ messages in thread
From: Kyle Meyer @ 2020-06-23  4:05 UTC (permalink / raw)
  To: Jb; +Cc: emacs-orgmode

Jb writes:

> Hey Org-mode enthusiasts,
>
> Find attached a patch adding export of manual links for markdown.

Thanks for the patch.

> This is my first contribution (I welcome feedback regarding patch 
> formatting etc).

Looks good.  Things are more lax in contrib/, but commit messages tend
to still follow the format described at
<https://orgmode.org/worg/org-contribute.html>.

Applied, adding a changelog entry to the message, in 2fa1dc34b.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-14 20:56 [PATCH] Add markdown support to contrib/org-man export Jb
2020-06-23  4:05 ` Kyle Meyer

unofficial mirror of emacs-orgmode@gnu.org

Archives are clonable:
	git clone --mirror https://yhetil.org/orgmode/0 orgmode/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 orgmode orgmode/ https://yhetil.org/orgmode \
		emacs-orgmode@gnu.org
	public-inbox-index orgmode

Example config snippet for mirrors

Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.emacs.orgmode
	nntp://news.gmane.io/gmane.emacs.orgmode


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git