Mkdocs: Is there a way to support image size adjustment?

Created on 16 Nov 2018  路  6Comments  路  Source: mkdocs/mkdocs

For example ![](https://example.com/qqq.img =150x150) works on some markdown platform but not on mkdocs.

Or is there any plugin support this?

Any advice, apprentice.

Most helpful comment

You can use the attr_list extension to achieve this.
Syntax:
![](https://example.com/qqq.img){: style="height:150px;width:150px"}

All 6 comments

That is a non-standard Markdown feature and is therefore not supported by default. As documented, MkDocs uses the Python-Markdown library for processing Markdown and fully supports Python-Markdown extensions. There may be a built-in or third-party extension which offers a solution that works for you, Alternatively, you can write your own extension, which implements whatever behavior you want.

As Markdown behavior is an upstream issue, I'm closing this.

You can use the attr_list extension to achieve this.
Syntax:
![](https://example.com/qqq.img){: style="height:150px;width:150px"}

Nice, it's a solution.

This isn't working.

Markdown
![WebCapture](/img/support/prod/screenshot-web-capture.png){: style="height:150px;width:150px"}

HTML generated
<img alt="WebCapture" src="/img/support/prod/screenshot-web-capture.png">{: style="height:150px;width:150px"}

@binnyg did you enable the extension in your mkdocs.yml config file?

I know I am missing something but it worked with the extension. Thank you.

markdown_extensions:
  - attr_list
Was this page helpful?
1 / 5 - 1 ratings

Related issues

jbick picture jbick  路  4Comments

banj picture banj  路  6Comments

adrwh picture adrwh  路  5Comments

nodesocket picture nodesocket  路  6Comments

beeva-marcosromero picture beeva-marcosromero  路  4Comments