(json-encode
`((title . ,(ox-qmdx--export-get-title))
(body . ,(with-current-buffer (org-qmd-export-as-markdown) (buffer-substring-no-properties (point-min) (point-max))))
(coediting . :json-false)
(group_url_name . nil)
(private . ,(ox-qmdx--export-get-private))
(tweet . ,(ox-qmdx--export-get-tweet))
(tags . ,(ox-qmdx--export-get-tags))
))
{"title":"Qiita記事をEmacsから投稿する","body":"```el\n(require 's)\n(require 'dash)\n\n\n(defun ox-qmdx--get-export-setting (header-name)\n \"Get export setting value.\n\nThe export settings are those described in `#+FOO: BAR`.\nThis function moves point internally.p\nHowever, the position is restored as soon as the function completes.\n\"\n (save-excursion\n (goto-char 0)\n (re-search-forward (format \"^[ \\t]*#\\\\+%s: \\\\(.+\\\\)\" header-name) nil t) \n (match-string-no-properties 1)))\n\n\n(defun ox-qmdx--get-org-source ()\n \"Return markdown comment style string of Org document source in the current buffer.\"\n (format \"\\n\\n<!---ORG\\n%s\\n--->\"\n\t (buffer-substring-no-properties (point-min) (point-max))))\n\n\n(defun org-qmdx-export-as-markdown (&optional async subtreep visible-only)\n \"Export current buffer to a Qiita Markdown buffer and source.\"\n (let ((src-buf (current-buffer))\n\t(export-buf (org-qmd-export-as-markdown)))\n (with-current-buffer export-buf\n (end-of-buffer)\n (insert (with-current-buffer src-buf \n\t\t(ox-qmdx--get-org-source)))\n export-buf)))\n\n\n(defun ox-qmdx--export-get-title ()\n (ox-qmdx--get-export-setting 'title))\n\n\n(defun ox-qmdx--export-get-item-id ()\n (or (ox-qmdx--get-export-setting 'qiita_item_id) \n nil))\n\n\n(defun ox-qmdx--export-get-private ()\n (case (ox-qmdx--get-export-setting 'qiita_private)\n (\"t\" :json-false)\n (\"nil\" t)\n (otherwise t)))\n\n\n(defun ox-qmdx--export-get-tweet ()\n (case (ox-qmdx--get-export-setting 'qiita_tweet)\n (\"t\" t)\n (\"nil\" :json-false)\n (otherwise :json-false)))\n\n\n(defun ox-qmdx--export-get-tags ()\n (-map (lambda (name) `((:name . ,name)))\n\t(s-split \" \"\n\t\t (ox-qmdx--get-export-setting 'qiita_tags))))\n```\n\n```el\n(json-encode\n `((title . ,(ox-qmdx--export-get-title))\n (body . ,(with-current-buffer (org-qmdx-export-as-markdown) (buffer-substring-no-properties (point-min) (point-max))))\n (coediting . :json-false)\n (group_url_name . nil)\n (private . ,(ox-qmdx--export-get-private))\n (tweet . ,(ox-qmdx--export-get-tweet))\n (tags . ,(ox-qmdx--export-get-tags))\n ))\n```\n\n\n\n<!---ORG\n#+TITLE: Qiita記事をEmacsから投稿する\n#+QIITA_TAGS: emacs emacs-lisp\n#+QIITA_PRIVATE: t\n#+QIITA_ITEM_ID: d4f07e962cfbf3828803\n#+QIITA_TWEET: nil\n\n#+BEGIN_SRC emacs-lisp\n(require 's)\n(require 'dash)\n\n \n(defun ox-qmdx--get-export-setting (header-name)\n \"Get export setting value.\n\nThe export settings are those described in `#+FOO: BAR`.\nThis function moves point internally.p\nHowever, the position is restored as soon as the function completes.\n\"\n (save-excursion\n (goto-char 0)\n (re-search-forward (format \"^[ \\t]*#\\\\+%s: \\\\(.+\\\\)\" header-name) nil t) \n (match-string-no-properties 1)))\n\n\n(defun ox-qmdx--get-org-source ()\n \"Return markdown comment style string of Org document source in the current buffer.\"\n (format \"\\n\\n<!---ORG\\n%s\\n--->\"\n\t (buffer-substring-no-properties (point-min) (point-max))))\n\n\n(defun org-qmdx-export-as-markdown (&optional async subtreep visible-only)\n \"Export current buffer to a Qiita Markdown buffer and source.\"\n (let ((src-buf (current-buffer))\n\t(export-buf (org-qmd-export-as-markdown)))\n (with-current-buffer export-buf\n (end-of-buffer)\n (insert (with-current-buffer src-buf \n\t\t(ox-qmdx--get-org-source)))\n export-buf)))\n\n\n(defun ox-qmdx--export-get-title ()\n (ox-qmdx--get-export-setting 'title))\n\n\n(defun ox-qmdx--export-get-item-id ()\n (or (ox-qmdx--get-export-setting 'qiita_item_id) \n nil))\n\n\n(defun ox-qmdx--export-get-private ()\n (case (ox-qmdx--get-export-setting 'qiita_private)\n (\"t\" :json-false)\n (\"nil\" t)\n (otherwise t)))\n\n\n(defun ox-qmdx--export-get-tweet ()\n (case (ox-qmdx--get-export-setting 'qiita_tweet)\n (\"t\" t)\n (\"nil\" :json-false)\n (otherwise :json-false)))\n\n\n(defun ox-qmdx--export-get-tags ()\n (-map (lambda (name) `((:name . ,name)))\n\t(s-split \" \"\n\t\t (ox-qmdx--get-export-setting 'qiita_tags))))\n#+END_SRC\n\n\n#+BEGIN_SRC emacs-lisp\n(json-encode\n `((title . ,(ox-qmdx--export-get-title))\n (body . ,(with-current-buffer (org-qmdx-export-as-markdown) (buffer-substring-no-properties (point-min) (point-max))))\n (coediting . :json-false)\n (group_url_name . nil)\n (private . ,(ox-qmdx--export-get-private))\n (tweet . ,(ox-qmdx--export-get-tweet))\n (tags . ,(ox-qmdx--export-get-tags))\n ))\n#+END_SRC\n\n\n--->","coediting":false,"group_url_name":null,"private":true,"tweet":false,"tags":[{"name":"emacs"},{"name":"emacs-lisp"}]}