Skip to content

Unable to make assets (images) work #1382

@gadmm

Description

@gadmm

I have read with interest the documentation on the new feature of incorporating assets (e.g. images)

I am sorry to report that I was unable to make it work in any possible combination and any possible interpretation of the documentation.

Here is what my attempt looks like:

/tmp/odoc-example/asset-example/doc$ ls
dune  image.png  index.mld
/tmp/odoc-example/asset-example/doc$ cat index.mld 
{0 heading}

Example text

{{image!image.png}Alt text}

/tmp/odoc-example/asset-example/doc$ cat dune 
(documentation)
(install
  (section doc)
  (files (image.png as odoc-pages/image.png)))
/tmp/odoc-example/asset-example/doc$ cd ..
/tmp/odoc-example/asset-example$ dune build @doc
File "../../../../doc/index.mld", line 5, characters 0-27:
Warning: Failed to resolve reference ./image.png Path 'image.png' not found
/tmp/odoc-example/asset-example$ odoc --version
3.1.0

At this point I have no clue what might be wrong and what I might have missed from the documentation. Do you see any obvious problem with my attempt? Or maybe could you please share a minimal working example from which I will investigate further?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions