簡體   English   中英

當body-only為t時,如何使用org-mode導出帶有TOC(目錄)的html?

[英]How can I use org-mode to export html with TOC (table-of-content) when body-only is t?

我使用org-mode導出博客的內容,然后使用jekyll生成結果博客頁面。

我發現,當我將僅主體設置為true時,org-project導出不包含org文件的TOC (目錄)。

如何配置以讓emacs生成目錄?

這是我的.emacs配置:

;; org-mode project define                                                                                                            
(setq org-publish-project-alist
      '(
        ("org-blog-content"
         ;; Path to your org files.                                                                                                   
         :base-directory "~/ChinaXing.org/org/"
         :base-extension "org"

         ;; Path to your jekyll project.                                                                                              
         :publishing-directory "~/ChinaXing.org/jekyll/"
         :recursive t
         :publishing-function org-publish-org-to-html
         :headline-levels 4
         :html-extension "html"
         :table-of-contents t
         :body-only t ;; Only export section between <body></body>                                                                    
         )

        ("org-blog-static"
         :base-directory "~/ChinaXing.org/org/"
         :base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|swf\\|php"
         :publishing-directory "~/ChinaXing.org/jekyll/"
         :recursive t
         :publishing-function org-publish-attachment)
        ("blog" :components ("org-blog-content" "org-blog-static"))
        ))

根據這個帖子的組織模式的郵件列表中,...

[...]如果僅正文為t,HTML導出器將拒絕包含目錄; 原子導出器和“通過漫游癖發送HTML消息”黑客都依賴於這種行為,這就是為什么在官方組織機構存儲庫中未更改此行為的原因。

一種解決方案是修補org-mode的源代碼,如下所示:

http://thread.gmane.org/gmane.emacs.orgmode/24227

伊恩·巴頓(Ian Barton)顯然已經實現了使用jQuery動態生成目錄的另一種方法。 如果您對該解決方案的詳細信息感興趣,可以考慮回復主題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM