Documenter.jl: cannot control image size in html output

Created on 8 Feb 2017  路  6Comments  路  Source: JuliaDocs/Documenter.jl

I tried all the recommendations from the following page, none of them lets me control the size of the images in HTML output. Can you suggest a workaround?

http://stackoverflow.com/questions/14675913/how-to-change-image-size-markdown

Question

Most helpful comment

one possibility would be to just do the whole table in html

<table>
  <tbody>
    <tr>
      <th>Header1</th>
      <th>Header2</th>
    </tr>
    <tr>
      <td>row1 content1</td>
      <td>row1 content2</td>
    </tr>
    <tr>
      <td>row2 content1</td>
      <td>row2 content2</td>
    </tr>
  </tbody>
</table>

i use this workaround to mix html with markdown. Its the opposite of your use-case though.

` @raw html


```@contents
Pages = ["losses/distance.md"]
Depth = 2

```@raw html


![distance-based losses](https://rawgithub.com/JuliaML/FileStorage/master/LossFunctions/distance.svg)

```@raw html
</td></tr></tbody></table>

````

for

imgtable

(see http://juliaml.github.io/LossFunctions.jl/stable/#Loss-Functions-for-Regression-1)

All 6 comments

The ![]() syntax doesn't support image size. However, you should be able to use the @raw block to insert custom HTML with an <img> tag as follows:

markdown ```@raw html <img src="..." height="..." width="..."> ```

Thanks!

What if you want to put the image in a table? I tried this:

| Color separations & SVD |
|-------------------------|
| ```@raw html <img src="assets/demos/color_separations_svd.jpg" alt="svd" width="200"/>``` |

but got this in the rendered document:
image

(Yes, I know it's silly to use a table for one image, but this will be a placeholder for more "thumbnails".)

one possibility would be to just do the whole table in html

<table>
  <tbody>
    <tr>
      <th>Header1</th>
      <th>Header2</th>
    </tr>
    <tr>
      <td>row1 content1</td>
      <td>row1 content2</td>
    </tr>
    <tr>
      <td>row2 content1</td>
      <td>row2 content2</td>
    </tr>
  </tbody>
</table>

i use this workaround to mix html with markdown. Its the opposite of your use-case though.

` @raw html


```@contents
Pages = ["losses/distance.md"]
Depth = 2

```@raw html


![distance-based losses](https://rawgithub.com/JuliaML/FileStorage/master/LossFunctions/distance.svg)

```@raw html
</td></tr></tbody></table>

````

for

imgtable

(see http://juliaml.github.io/LossFunctions.jl/stable/#Loss-Functions-for-Regression-1)

also note. if it is something repetitive (in the sense that you have a lot of those tables with fixed sized images) you can also just set the width in a custom .css file

e.g.

table td img {
    width: 200px;
}

i do something like that here: http://juliaml.github.io/LossFunctions.jl/stable/losses/distance/

Cool. I am hoping to replicate something like http://scikit-image.org/docs/stable/auto_examples/ for JuliaImages. Time to learn CSS & HTML!

Was this page helpful?
0 / 5 - 0 ratings