0

当我*.adoc在 awestruct 的文件中有此代码时:

This website was generated on {localdatetime}.

我得到:

This website was generated on 2015-11-30 11:01:50 CET.

但我希望它像这样很好地格式化:

This website was generated on Fri 11 November 2015 11:01:50 CET.

我尝试了这些,但它们不起作用:

This website was generated on #{Time.now.strftime('%a %-d %B %Y')}.
This website was generated on #{localdatetime.strftime('%a %-d %B %Y')}.

这很奇怪,因为#{rubyVariable.someMethod()}在 adoc 文件中调用 Ruby 方法确实有效。

4

1 回答 1

0

:page-interpolate: true*.adoc文件顶部添加

= Website info
:awestruct-description: Website technology and feedback
:page-interpolate: true

然后这个工作:

 This website was generated on #{Time.now.strftime('%a %-d %B %Y at %H:%M:%S %Z')}.

输出:

 This website was generated on Fri 4 December 2015 at 12:31:09 CET.
于 2015-12-04T11:31:58.660 回答