docs(html): add a topbar extension slot for post-processing add-ons#4184
docs(html): add a topbar extension slot for post-processing add-ons#4184grandixximo wants to merge 1 commit into
Conversation
|
A local search is not a bad idea as such. But it is a bad idea to have this in the tree IMO. Getting code via curl is a Bad ThingTM, even if it is pinned (not happy about rtai either). If you want a search index, then I think it should be a separate project that a user can do. |
|
Thanks, that is fair. The network fetch during the build is the part I am least comfortable with too, so I would rather drop it than defend it on precedent. Before I rework this, could you help me understand where you would draw the line, so I build the right thing the first time:
Either is fine by me. I just want to match what you would be willing to merge before spending the effort. The only goal here is to give the docs the search readers keep asking for, without a fetched binary in the build. |
|
The base build should be a minimalist approach and not expect anything special from the host system. Anything else are bells and whistles that can be bolted on. But it is nice to add support for bells and whistles. An infrastructure placeholder for a search or any other thing could be provided in-tree. Then, when someone wants it, they can plug into the placeholder and put in their stuff using some post-processing. The trick is to add strategic but generic comments, placeholder classes and data-placeholder attributes in the base HTML where appropriate. |
Provide a generic, empty slot in the docs topbar (data-lcnc-slot="topbar-end") that out-of-tree post-processing can fill, for example to bolt on search. Empty in the base build; nothing is fetched or required.
Following the discussion here, this is reduced to the minimal in-tree piece: a generic, empty extension slot in the docs topbar.
The base build stays minimalist and fetches nothing. The slot (
data-lcnc-slot="topbar-end") is an empty placeholder that out-of-tree post-processing can fill, for example to bolt on search, without the LinuxCNC build depending on anything extra. It is empty in the base build, so a plain docs build is unchanged.As a concrete consumer, I built search as a separate project that downloads the docs artifact, plugs a pagefind search box into this slot, builds a per-language index, and emits searchable docs: https://github.com/grandixximo/linuxcnc-doc-search . Anyone can run their own post-processing against the same slot.