【问题标题】:Asciidoc formatting options for semi-tabular data半表格数据的 Asciidoc 格式化选项
【发布时间】:2016-11-30 08:10:29
【问题描述】:

我有一个关于如何在 Asciidoc 中布局一些半表格数据的问题。

我目前拥有的逐字 Asciidoc 是这样的,包括一些来自周围叙述的常规文本(它来自关于 Java GC 的部分,使用非常简化的案例研究):

The heap parameters are set up as shown, and we assume that they do not change over time. 
Of course a real application would normally have a dynamically resizing heap, but this 
example is to illustrate a simple case study.

----
Overall heap size:   2G

Old generation:    1.5G

Young generation:  500M
        Eden:      400M
        S1:         50M
        S2:         50M
----

After the application has reached its steady state, the following GC metrics 
are observed:

----
Allocation rate: 100M/s
Young GC time:      0ms
Full GC time:     100ms
Object lifetime:  200ms
----

So at steady state, a young GC will occur every 4 seconds.

我的问题是:这是解决这个问题的唯一方法吗?还有哪些其他方法?我是一个相当熟练的 Asciidoc 用户,但不断发现新功能,这让我觉得也许我可以采用另一种布局方法。

【问题讨论】:

  • 您使用哪个工具链?基于 Gradle?
  • 嗨 - 不知道为什么工具链很重要,但主要目标是 Atlas,我使用 AsciidocFX 作为我的开发环境。
  • 我问是因为使用 gradle,很容易为 asciidoc 编写扩展...
  • 谢谢@rdmueller - 很好。在这种情况下,扩展绝对不是一种选择。

标签: text-formatting asciidoc asciidoctor


【解决方案1】:

如果您想以一种好的方式格式化您的数据,您可以将数据格式化为表格。将“分隔符分隔”(dsv) 指定为格式,您将得到一个漂亮的表格。

此外,您可以指定分隔符以确保仅使用:(第二个示例):

The heap parameters are set up as shown, and we assume that they do not change over time. 
Of course a real application would normally have a dynamically resizing heap, but this 
example is to illustrate a simple case study.

[format="dsv"]
|====
Overall heap size:   2G

Old generation:    1.5G

Young generation:  500M
        Eden:      400M
        S1:         50M
        S2:         50M
|====

After the application has reached its steady state, the following GC metrics 
are observed:

[format="dsv",separator=":"]
|====
Allocation rate: 100M/s
Young GC time:      0ms
Full GC time:     100ms
Object lifetime:  200ms
|====

So at steady state, a young GC will occur every 4 seconds.

这使您还可以在表格的属性中指定对齐、宽度和其他单元格属性:http://www.methods.co.nz/asciidoc/chunked/ch23.html

这就是你要找的东西吗?

【讨论】:

    猜你喜欢
    • 2012-08-13
    • 1970-01-01
    • 2019-04-14
    • 1970-01-01
    • 1970-01-01
    • 2015-04-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多