Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support [.pagewide] role for tables and images #1415

Open
alexandre-frey opened this issue Nov 28, 2019 · 8 comments
Open

Support [.pagewide] role for tables and images #1415

alexandre-frey opened this issue Nov 28, 2019 · 8 comments
Milestone

Comments

@alexandre-frey
Copy link

Text content can now be globally indented (theme property section_indent, see #737).
But then, a table that has the [.stretch] role is only stretched to that section indent, not to the page margin.
It is useful for some wide tables to stretch them to the page margins.
I suggest the converter should support the role [.pagewide] for that. The role should be applicable to tables and to images.

@alexandre-frey
Copy link
Author

I implemented this role in a custom converter. Here is the code for tables:

#
# Implement the role ".pagewide" for tables. The effect is to strech 
# the table up to the page margins, instead of only to the section width
#
def convert_table node
    if (node.has_role? 'pagewide')
        indent_l, indent_r = inflate_indent @theme[:section_indent]
    else 
        indent_l, indent_r = 0,0
    end
    indent -indent_l, -indent_r do
        super
    end
end

@mojavelinux
Copy link
Member

mojavelinux commented Jan 19, 2020

I like this idea, but I'm not convinced the name is correct. Page-wide implies that it stretches the width of the whole page. In fact, we have a similar option for block images already named align-to-page. What we're really talking about here is column-wide.

If you only anticipate needing to make the table break out of the section indent, then I would suggest the option name outdent. If you anticipate also wanting to stretch the table edge to edge of the page, then we might need an attribute like relative-to=page|column.

@mojavelinux mojavelinux added this to the v2.0.0 milestone Jan 19, 2020
@mojavelinux
Copy link
Member

Basically, this feature needs terminology improvement. The idea is great.

@mojavelinux
Copy link
Member

How do you feel about container-wide as the role name?

@alexandre-frey
Copy link
Author

Hi! I initially thought pagestretch, but you suggested pagewide in this comment.
To be honest, I don't have a preference, pagestretch, pagewide, container-wide are fine.
Note that in DITA, the system I'm trying to replace with asciidoc, the attribute is called pgwide and means "1=page width; 0=resize to galley or column".

@mojavelinux
Copy link
Member

Note that in DITA, the attribute is called pgwide...

That's very useful input. I'll dig into that.

@mojavelinux
Copy link
Member

To follow up on that, here are the docs from DITA:

For PDF, the value "1" places the element on the left page margin; "0" aligns the element with the left margin of the current text line and takes indention into account.

So it's clearly a toggle, which would be best suited by a role (e.g., %pagewide).

@mojavelinux
Copy link
Member

DITA also has an attribute named expanse which has a very similar purpose. The values are page, column, and textline. Perhaps we could consider the option name %expand. So to make a table that stretches to the page margins, you'd use .stretch%expand.

Here are the two proposals on the table:

  • .stretch%expand
  • .stretch%pagewide

At first, I had said page-wide could be confused with the width spanning from edge-to-edge of the document, but I now realize it would be more appropriate / accurate to refer to that as the canvas (i.e., canvas-wide).

If we do anticipate needing both of those options for other elements (like an image), perhaps we should consider an enumerated attribute:

  • extent=container (default)
  • extent=page
  • extent=canvas

@graphitefriction graphitefriction modified the milestones: v2.0.0, v2.1.x Apr 25, 2022
@mojavelinux mojavelinux modified the milestones: v2.1.x, v2.2.x Jun 21, 2022
@mojavelinux mojavelinux modified the milestones: v2.2.x, v2.3.x Jul 22, 2022
@mojavelinux mojavelinux modified the milestones: v2.3.x, v3.0.x Aug 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants