Stream: helpdesk (published)

Topic: How to include verbatim HTML from file in Documenter.jl?


view this post on Zulip Júlio Hoffimann (May 16 2025 at 21:11):

GeoStats.jl's README has a section built by a bot on GitHub, which tracks contributors. How can I show this same section on a Documenter.jl page?

https://github.com/JuliaEarth/GeoStats.jl?tab=readme-ov-file#contributors

I am aware of @raw html blocks, but can't find a way to insert the contents in the block from the README.

The following code can be used to extract the text from the README:

  path = joinpath(dirname(@__DIR__), "README.md")
  text = read(path, String)
  html = last(split(text, "##"))

How can I "paste" the value of html into the @raw html block?

view this post on Zulip Sundar R (May 17 2025 at 02:27):

It looks like you can use the all-contributors bot itself to do the bulk of the work:

That would avoid having to do any hacky copy-paste script or anything, and seems a well supported way of doing it.

view this post on Zulip Sundar R (May 17 2025 at 02:31):

I guess your contributors.md should start out looking something like

```@raw html
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->

<!-- ALL-CONTRIBUTORS-LIST:END -->
```

Last updated: May 17 2025 at 04:42 UTC