Skip to content

allow plugins to pass asset additions #1612

@LazyScholar

Description

@LazyScholar

It would be nice to allow plugins like DocumenterCitations.jl to pass css-style additions to the Documenter.jl html-writer assets.

This would allow to add own plugin specific css styles to enhance readability of elements which are added to the HTML documentation by a plugin (without starting to clutter the Documenter.jl default style).

This might also allow the creation of plugins with advanced .js capabilities (a option to limit additions of assets like .css or .js to the scope of the plugin (instead of each page) might be needed here).

Currently this could only be done by raw html insertion into the markdown (by the user or the plugin), by element wise css modification by the plugin or by manually adding a css asset .


Probably related/conflicting: #615 #982 #1433


Examples which could be improved by small plugin css additions:

DocumenterCitations.jl

```@raw html
<style>
dl {
display: grid;
grid-template-columns: max-content auto;
}
dt {
grid-column-start: 1;
}
dd {
grid-column-start: 2;
margin-bottom: 0.75em;
}
</style>
```

```@bibliography
```
pure with css addition
bib1 bib2

DocStringExtensions.jl

```@raw html
<style>
#horlist ul {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(25ch, 1fr));
grid-gap: 4px;
list-style: none;
}
</style>
<div id="horlist">
```

```@docs
NURBStoolbox
```

```@raw html
</div>
```
pure with css addition
exp1 exp2

DocStringExtensions.jl

```@raw html
<style>
#horfield li > p + p::before {
content: ": ";
}
#horfield li > p {
display: contents;
}
</style>
<div id="horfield">
```

```@docs
NURBS
NURBS1D
NURBS2D
```

```@raw html
</div>
```
pure with css addition
field1 field2

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions