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
to:
!! 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.

[[http://dillinger.io/]]

[[https://code.google.com/p/pagedown/wiki/PageDown|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 [[http://stackoverflow.com/a/10854169/41153|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)"
  (interactive)
  (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"))
to:
(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*@]:
to:
I did get the below to work in [@*scratch*@] via [[http://www.gnu.org/software/emacs/manual/html_node/elisp/Asynchronous-Processes.html|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/README.md")
to:
(add-to-list 'exec-path (concat (getenv "APPDATA") "\\npm"))
(start-process "markdown-preview" "*scratch*" "
markdown-preview.cmd" "d:/Dropbox/projects/NaNoGenMo.yawp/ngram/README.md")
 
 
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/README.md")
(:sourceend:)


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
to:
(:source lang=lisp:)
;;; http://jblevins.org/projects/markdown-mode/
(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))

;;; https://npmjs.org/package/markdown-preview
(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]]
!! Emacs integration
[[http://jblevins.org/projects/markdown-mode/]]

For rendering, I used node's [[https://npmjs.org/package/markdown-preview|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
(:sourceend:)

And that should do it. I had no luck setting [@markdown-open-command@] to use [[https://npmjs.org/package/markdown-preview|markdown-preview]]

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

[[http://jbt.github.io/markdown-editor|in-browser editor]] can save locally
** [[https://github.com/jbt/markdown-editor|project @ github]]


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


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