如何使用组织模式将HTML导出中的后导码格式化? [英] How do I format the postamble in HTML-export with Org-mode?

查看:107
本文介绍了如何使用组织模式将HTML导出中的后导码格式化?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个采用组织模式的网站,并希望对后缀进行格式设置,以便仅在页面底部,中间显示创建日期和创建者,并且是横向的。



在我的.emacs中,我有
$ b

 (setq org- export-html-postamble-formatLast Updated%d。Created by%c)

and at我的index.org(和所有其他页面)的顶部

 # -  *  -  org-export-html-postamble :吨; -  *  -  

Postamble的格式如下:


日期:2012年3月16日

组织版本7.8.03与Emacs版本24



验证XHTML 1.0


垂直排列,我不太喜欢。

解决方案

它不接受你自己的postamble的原因是你必须使用#+ BIND :变量的语法,以便在导出时使用它。 (请参阅导出选项



更改设置后,我还必须稍微调整您的格式以符合所需的语法。 org-export-html-postamble-format 的默认值为:

< p class = \author \>作者:%a(%e)< / p> 
< p class = \date \>日期:%d< / p>
< p class = \creator \>由%c生成< / p>
< p class = \xhtml-validation \>%v< / p>
))

因此,您必须执行以下操作(尽可能匹配该格式):

  

然而,这不会使文本居中,它的输出如下:

 < div id =postamble> 
< p class =postamble>上次更新2012-03-16 16:22:03 Eastern Daylight Time。由Org 7.8.03版与Emacs版本24创建
< / div>

我相信您必须使用 p设置自定义样式表。 postamble {text-align:center; } 让中心工作。


I am creating a website with org-mode and would like to format the postamble so it just shows the date created and the creator at the bottom of the page, in the center, and is horizontal.

In my .emacs I have

(setq org-export-html-postamble-format "Last Updated %d. Created by %c")

and at the top of my index.org (and all other pages) I have

# -*- org-export-html-postamble:t; -*-

The postamble is formatted like this currently:

Date: 16 March 2012

Org version 7.8.03 with Emacs version 24

Validate XHTML 1.0

arrayed vertically, which I don't very much like.

解决方案

The reason it isn't accepting your own postamble is because you have to use #+BIND: syntax for the variable so that it is used on export. (See Export Options)

After changing that setting I also had to adjust your format slightly to fit the required syntax. The default value for org-export-html-postamble-format is:

(("en" "<p class=\"author\">Author: %a (%e)</p>
<p class=\"date\">Date: %d</p>
<p class=\"creator\">Generated by %c</p>
<p class=\"xhtml-validation\">%v</p>
"))

So you'd have to do the following to have it included (matching as closely as possible to that format):

(setq org-export-html-postamble-format 
      '(("en" "<p class=\"postamble\">Last Updated %d. Created by %c</p>")))

This however will not center your text, it exports as follows:

<div id="postamble">
<p class="postamble">Last Updated 2012-03-16 16:22:03 Eastern Daylight Time. Created by Org version 7.8.03 with Emacs version 24
</div>

I believe you'd have to set up a custom stylesheet with p.postamble { text-align: center; } to get the centering to work.

这篇关于如何使用组织模式将HTML导出中的后导码格式化?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆