Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Injection of search data #23

Open
tim-janik opened this issue Mar 3, 2023 · 1 comment
Open

Injection of search data #23

tim-janik opened this issue Mar 3, 2023 · 1 comment
Assignees
Labels
feature An entirely new feature.

Comments

@tim-janik
Copy link

tim-janik commented Mar 3, 2023

Is your feature request related to a problem? Please describe.

I would like to have a way to inject a list of [ (keyword,link), ... ] pairs into the search_data.

The Anklang project now uses Poxy to generate its C++ and JS API reference documentation. Since C++ is supported directly by Poxy + Doxygen, search works here, but the JS docs are provided as generated html snippets (using JsDoc + pandoc under the hood) and included via @file f.js \n @htmlinclude[block] f.js.html.
You can take a peek here: https://tim-janik.github.io/docs/anklang/files.html

Due to the @htmlinclude, the JS symbols are not searchable.
Generating a list of interesting symbol names and anchors is doable with some effort, e.g.:

symbols = [ ( 'vue_mixins', 'https://tim-janik.github.io/docs/anklang/util_8js.html#vue_mixins-class' ), ]

But then i still need a way to inject those into the poxy or m.css search_data list.

Describe the solution you'd like

Ideally, I could configure poxy.toml to include a searchdata.json (or searchdata.py) list of symbols+links into searchdata-v2.js.

Additional context

I can start base85 decoding searchdata-v2.js to inject the search list myself, but I figured I'd ask before going through that effort. ;-)

BTW, another use case for injecting search data could be to add tokens from content included via the Doxygen \page command, but making the JS docs searchable is most pressing for me atm.

@tim-janik tim-janik added the feature An entirely new feature. label Mar 3, 2023
@marzer
Copy link
Owner

marzer commented Mar 3, 2023

This is a great idea, but I should probably point out that all the search implementation is 100% m.css; poxy is mostly XML fixes and Doxygen post-processes. Consider suggesting this on the m.css repo?

I could reverse engineer the search implementation, but in general I'd like to keep a decent amount of parity with m.css, and contribute features (or ideas) there wherever possible.

I don't mind implementing entirely new things (e.g. dark/light theme switching), but always the intent in those situations is to contribute back to m.css in some fashion.

cc @mosra

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature An entirely new feature.
Projects
None yet
Development

No branches or pull requests

2 participants