Programming.MarkDown History

Hide minor edits - Show changes to output - Cancel

November 21, 2014, at 08:58 AM by MichaelPaulukonis -
Changed lines 3-10 from:
!! First heading
!! a small markup format
I use markdown so much for github readmes, on StackExchange and Discourse that I'm really, really getting used to it.

I wish I could use it as an ''alternate'' markup here in PmWiki; not main markup, as so many other markups are possible here in the wiki. But for simple things like headings, lists, links, &c I am very VERY happy with it.


[[|PageDown]] is ''the JavaScript Markdown previewer used on Stack Overflow and the rest of the Stack Exchange network.''
December 09, 2013, at 10:35 PM by OtherMichael -
Added lines 48-50:

;;; redefine the keymapping in markdown-mode only
(define-key markdown-mode-map (kbd "C-c C-c p") 'markdown-preview-buffer)
December 09, 2013, at 03:49 PM by OtherMichael -
Added line 50:
cf [[|notes on [@start@] and [@cmd@]]]
December 09, 2013, at 02:16 PM by OtherMichael - simple defun to open current buffer
Added lines 42-47:

;; so then this should work:
(defun markdown-preview-buffer ()
  "open current buffer with markdown-preview (node.js)"
  (start-process "markdown-preview" nil "markdown-preview.cmd" (buffer-file-name)))
December 09, 2013, at 02:11 PM by OtherMichael - use file-name-as-directory to avoid having to deal with slashes. ugh.
Changed line 40 from:
(add-to-list 'exec-path (concat (getenv "APPDATA") "\\npm"))
(add-to-list 'exec-path (concat (file-name-as-directory (getenv "APPDATA")) "npm"))
December 09, 2013, at 02:03 PM by OtherMichael - more notes on asynchonously launching markdown-preview
Changed lines 37-38 from:
I did get the below to work in [@*scratch*@]:
I did get the below to work in [@*scratch*@] via [[|emacs' Asynchronous Processes notes]]:
Changed lines 40-41 from:
(start-process "markdown-preview" "*scratch*" "c:/Users/mpaulukonis/AppData/Roaming/npm/markdown-preview.cmd" "d:/Dropbox/projects/NaNoGenMo.yawp/ngram/")
(add-to-list 'exec-path (concat (getenv "APPDATA") "\\npm"))
(start-process "markdown-preview" "*scratch*" "
markdown-preview.cmd" "d:/Dropbox/projects/NaNoGenMo.yawp/ngram/")
December 09, 2013, at 01:48 PM by OtherMichael -
Added lines 31-49:

'''NOTE:''' [@markdown-mode.el@] runs a shell-command, which waits for a return value.
This ties up the buffer (actually, ALL of Emacs) preventing further changes.
Which is a shame, since [@markdown-preview@] watches the file and performs live-updates.

I did get the below to work in [@*scratch*@]:

(:source lang=lisp:)
(start-process "markdown-preview" "*scratch*" "c:/Users/mpaulukonis/AppData/Roaming/npm/markdown-preview.cmd" "d:/Dropbox/projects/NaNoGenMo.yawp/ngram/")

The second parameter [@"*scratch*"@] associated that buffer with the process, appending [@stdout@] to the buffer -- to see errors, in particular. Remove for other uses.

BUT how to get [@markdown-mode.el@] to use this?
Or just skip the mode entirely, and wire up my own thing?

The docs on [@markdown-mode.el@] speak of [@markdown@] as a program you'd just find lying about, ready to do all sorts of things. While I haven't been able to find it at all for Win32 or Gnu.
December 09, 2013, at 09:17 AM by OtherMichael - cusomization code
Changed lines 17-19 from:
(:source lang=text:)
markdown-command: markdown-preview
markdown-command-needs-filename: t
(:source lang=lisp:)
(autoload '
markdown-mode "markdown-mode"
  "Major mode for editing Markdown files" t)
(add-to-list 'auto-mode-alist '("\\.text\\'" . markdown-mode))
(add-to-list 'auto-mode-alist '("\\.markdown\\'" . markdown-mode))
(add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode))

(setq markdown-command "markdown-preview")
(setq markdown-command-needs-filename t)
December 08, 2013, at 10:53 PM by OtherMichael -
Added lines 9-24:
!! Emacs integration

For rendering, I used node's [[|markdown-preview]], for which I contributed a bug-fix the day I started using it.

!!! customize

(:source lang=text:)
markdown-command: markdown-preview
markdown-command-needs-filename: t

And that should do it. I had no luck setting [@markdown-open-command@] to use [[|markdown-preview]]

Added line 28:
[[]] for editing
November 15, 2013, at 09:09 AM by OtherMichael -
Added lines 1-15:
(:description a markup format :)
!! First heading

[[|in-browser editor]] can save locally
** [[|project @ github]]

!! See Also
[[Git]] - used on github, amongst other locations

[[#tags]] [[#categories]]
!! Category tags