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

Syntax for block-level images #87

Open
matklad opened this issue Nov 10, 2022 · 6 comments
Open

Syntax for block-level images #87

matklad opened this issue Nov 10, 2022 · 6 comments

Comments

@matklad
Copy link
Contributor

matklad commented Nov 10, 2022

Obligatory [XKCD 927](https://xkcd.com/927/):

![xkcd 927](https://imgs.xkcd.com/comics/standards.png)

An obvious idea is to use Rust for task automation.

The intention here is for the image to be a block-level element. We however wrap it in a paragraph in this case:

doc
  para
    str s="Obligatory "
    link destination="https://xkcd.com/927/"
      str s="XKCD 927"
    str s=":"
  para
    image destination="https://imgs.xkcd.com/comics/standards.png"
      str s="xkcd 927"
  para
    str s="An obvious idea is to use Rust for task automation."

AsciiDoctor have separate sytaxes for inline-vs-block images: image:url vs image::url. But presumably we can just notice that the image stands alone and not wrap it into a paragraph?

Or maybe this already is working as intended, and it's on the converter to auto-magically treat single-image paragraphs as block images?

@matklad
Copy link
Contributor Author

matklad commented Nov 10, 2022

@jgm
Copy link
Owner

jgm commented Nov 11, 2022

it's on the converter to auto-magically treat single-image paragraphs as block images

This is what pandoc currently does (and has done for a long time) -- it's the implicit_figures extension.
However, we've realized (also for a long time) that it would be better to have an explicit markup for block figures.
jgm/pandoc#3177

@bpj
Copy link

bpj commented Nov 11, 2022

IMO the right syntax is fairly obvious:

{width=18cm}
!!!
![Alt text](path/to/image.ext)
: Caption goes here
!!!

Of course with 3 being the minimal number of bangs in the fence.

@chrisjsewell
Copy link

Note this has some overlap with #28

@chrisjsewell
Copy link

Would something as simple as having multiple ! be ok?

!![block level image](path/to/image.ext)

@uvtc
Copy link
Contributor

uvtc commented Dec 5, 2022

It seems like this issue is related to #31 , no? I'd assume that a figure would be a block-level element that would likely contain one or more images.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants