解析普通列表时的组织模式导出抽屉(html)

时间:2013-08-06 23:14:18

标签: org-mode

所以我有一个文件,我目前在抽屉中保存了一堆数据(在这个特定情况下,是一个笔和纸RPG角色)。我覆盖了抽屉的工作方式,因此我可以实现一个切换按钮来隐藏/显示。这样可以正常工作,除非看起来内容没有被解析,我认为它应该如何。

主要问题是它似乎没有解析普通列表。因此,我如何更改函数以便解析普通列表,而不会损坏其他输出?

导出抽屉功能:

(require 'org-publish)
(setq org-publish-project-alist
      '(
("org-notes"
 :base-directory "~/shared/"
 :base-extension "org"
 :publishing-directory "~/public_html/org/"
 :recursive t
 :drawers t
 :creator-info nil
 :publishing-function org-publish-org-to-html
 :headline-levels 5             ; Just the default for this project.
 :auto-preamble t
 )
      ))

(defun my-org-export-format-drawer (name content)
  (format
   (concat "@<h6>"
           (capitalize name)
           "@<button class=\"dbut\" type=\"button\">toggle@</button>@</h6>"
           "@<div class=\"drawer "
           (downcase name)
           "\">"
           "%s @</div>")
   content))
(setq org-export-format-drawer-function 'my-org-export-format-drawer)

带抽屉的示例文件:

#+DRAWERS: ABILITYSCORES FEATS
* Test
:ABILITYSCORES:

#+ATTR_HTML: :border 2 :rules all :frame border
| Stat | Value | Mod |
|------+-------+-----|
| Str  |    18 |   4 |
| Dex  |    10 |   0 |
| Con  |    16 |   3 |
| Int  |    12 |   1 |
| Wis  |    14 |   2 |
| Cha  |    10 |   0 |

*KOM:* Str; *KDM:* Con; *BAB:* 2

:END:

:FEATS:

- Cataphract :: Bonus, +2 to attack rolls, +2 to damage rolls with Power attack
                ignore AC charge penalty (all while mounted)
- Mighty Smash :: 1, +2 damage, after being hit by three Mighty Smashes opponent
                  takes -1 to attack rolls for [Encounter], max -4.

:END:

js-fiddle of result

0 个答案:

没有答案