Skip to content

Use relative path in the report #134

@JiaxiangBU

Description

@JiaxiangBU

I try to use create_report to build a report and display it on the GitHub. But I find the rendered figures is under the absolute paths. So If I want to display a markdown document on the GitHub. It cannot display the unlinked figure.

Temporally, after using create_report, I manually the figure paths in the markdown document. So is there any suggestion I fix this in the create_report. I guess here::here is used in create_report.

I will add a reproducible example.

Here is the reproducible code.

https://github.com/JiaxiangBU/test-DataExplorer/blob/91f9f1c278b24d73a75de4607433549a5b9b80c5/analysis/sample.Rmd#L2-L4

In the markdown document, the figure path is absolute.
JiaxiangBU/test-DataExplorer@91f9f1c#diff-4093ad3d0ac407c51df5ad563a5ad529R22

![](D:/work/test-DataExplorer/output/df_files/figure-gfm/plot_intro-1.png)<!-- -->

After I change them into the relative way.

https://github.com/JiaxiangBU/test-DataExplorer/blame/91f9f1c278b24d73a75de4607433549a5b9b80c5/output/df.md#L22

![](D:/work/test-DataExplorer/output/df_files/figure-gfm/plot_intro-1.png)<!-- -->

The rendered markdown document works, here is the address https://github.com/JiaxiangBU/test-DataExplorer/blob/master/output/df.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions