asciidoctor-intellij-plugin icon indicating copy to clipboard operation
asciidoctor-intellij-plugin copied to clipboard

Enhance the Create Table dialogue

Open ellipticview opened this issue 4 years ago • 4 comments

The current Create Table dialogue provides these fields:

  • Title
  • No of rows
  • No of colums

This small enhancement is to fix the typo in "colums", and to add these fields:

  • Header (checkbox)
  • Footer (checkbox)
  • Width

This would result in:

[width="100%",options="header,footer"]
|====================
|  |  
|  |  
|====================

ellipticview avatar May 05 '20 14:05 ellipticview

  • The header row should be implicit (as it is currently).
  • Full-width should be represented by the stretch role, not an explicit value
  • The footer option should be shorthand
  • The delimiter line should be limited to 4 characters

That would look like:

[.stretch%footer]
|===
| Col A | Col B

| A1
| B1

| A2
| B2
|===

We don't want to enter any more characters than we need.

(Note that the plugin adheres to these rules already, except it doesn't add the block attribute line).

mojavelinux avatar May 05 '20 20:05 mojavelinux

Dan,

The rendering in Intellij (which prompted this enhancement) is a little strange, as it renders tables as ribboned. It does not format table headers or footers. See this screenshot, based on attached file. screenshot

Attaching sample file as .txt (github does not accept .adoc files as attachment) tables_adoc.txt

Regarding your comments:

  • Is this a guideline for the header row to be implicit by the extra blank line? I prefer the explicitness of the options and find it more consistent with the footer option. Just like I prefer the horizontal layout of the rows.
  • Full-width: If not specified, I assume 100% is the default and indeed no need to explicitly specify.
  • I don't understand the table footer option. Specifying [options="footer"] results in a table footer . It's not clear to me what [.stretch%footer] does. In the HTML this results in:
    <table class="tableblock frame-all grid-all stretch stretch">
    

    instead of

    <table class="tableblock frame-all grid-all stretch">
    

ellipticview avatar May 06 '20 17:05 ellipticview

The rendering in Intellij (which prompted this enhancement) is a little strange

That's a stylesheet issue. I think we're at the point now where we could start to refresh / sync the styles to have a more consistent look overall, but that should be a separate issue. I'd be glad to help.

Is this a guideline for the header row to be implicit by the extra blank line?

Yes, we prefer brevity. Though, in the end, it is just a matter of style.

Full-width: If not specified, I assume 100% is the default and indeed no need to explicitly specify.

Yes, you're absolutely right. I got mixed up. What must be explicit is to have autowidth, which would be the %autowidth option.

Specifying [options="footer"] results in a table footer

The preferred syntax for specifying options are modifiers on the first positional argument, which is what %footer is. options= is too verbose.

As for the stretch role, I misspoke. That's the default, so it doesn't need to be specified. If you want to reverse it, then you need %autowidth.

mojavelinux avatar May 06 '20 19:05 mojavelinux

Full-width should be represented by the stretch role, not an explicit value

So to rephrase this, the table will stretch by default. The table dialog should offer a field to switch to automatic width, which would apply the %autowidth option.

mojavelinux avatar May 06 '20 19:05 mojavelinux