Comments (2)
The most ideal way would of course be to support JS directly, and without Doxygen in the loop :) So, for example, using JSDoc to parse the JS code + comments and give the parsed output back in some JSON, which would then be processed to a template that actually matches JS features (instead of trying to fit it into the C++-oriented template). Given this wouldn't require undoing ugly Doxygen bugs, and assuming JSDoc gives out something already usable, I think it could be quite manageable. The Python doc generator is made from scratch as well, and the main complexity there was mostly about type annotations and lacking introspection/reflection capabilites, something I think you wouldn't run into with JSDoc.
What's already builtin is a feature allowing you to specify additional keywords with @m_keyword{}
and @m_keywords{}
, Poxy should support those commands directly without having to edit any Doxyfile. So, at the very least, you could add the JS symbols as keywords to the page, so searching for them would lead you to the page/file itself. But just the page/file, not an anchor, and there wouldn't be a way to distinguish functions from objects etc.
/**
@file util.js
@m_keywords{vue_mixins}
...
*/
Another option, and quite easy implementation-wise, could be to expose a config option with a list of tokens that get fed directly into the search data in state.search
and processed in build_search_data()
. The configuration in m.css can be a Python script so it'd be for example
SEARCH_EXTRA = [
# name, url, type
('vue_mixins', 'util_8js.html#vue_mixins', 'CLASS'),
('vue_export_from_class', 'envue_8js.html#vue_export_from_class', 'FUNC'),
...
]
Given the config is scriptable, it shouldn't be too laborous, however it's still pretty much tied to the set of type IDs used for the Doxygen symbols (so no "module", for example), to various C++-isms, and is quite low-level compared to what a builtin JS generator could do. A minimal (untested) patch to allow this would be something like this:
diff --git a/documentation/doxygen.py b/documentation/doxygen.py
index 2d5a6f9a..ecc506fb 100755
--- a/documentation/doxygen.py
+++ b/documentation/doxygen.py
@@ -145,6 +147,7 @@ copy a link to the result using <span class="m-label m-dim">⌘</span>
""",
'SEARCH_BASE_URL': None,
'SEARCH_EXTERNAL_URL': None,
+ 'SEARCH_EXTRA': [],
'SHOW_UNDOCUMENTED': False,
'VERSION_LABELS': False
@@ -2501,8 +2504,18 @@ def build_search_data(state: State, merge_subtrees=True, add_lookahead_barriers=
def strip_tags(text):
return strip_tags_re.sub('', text)
+ search = state.search.copy()
+ for name, url, type in state.config['SEARCH_EXTRA']:
+ result = Empty()
+ result.flags = ResultFlag.from_type(ResultFlag(0), EntryType[type])
+ result.url = url
+ result.prefix = []
+ result.name = name
+ result.keywords = []
+ search += [result]
+
symbol_count = 0
- for result in state.search:
+ for result in search:
# Decide on prefix joiner. Defines are among the :: ones as well,
# because we need to add the function macros twice -- but they have no
# prefix, so it's okay.
Would it make sense to be done this way? For Poxy AFAIK there's a TOML configuration file so this would have to be propagated through from there somehow, which might hinder the scriptability aspect. Or @marzer do you have a way to "pass through" a python script directly to a m.css conf.py
?
from m.css.
Or @marzer do you have a way to "pass through" a python script directly to a m.css conf.py?
Not currently, but would be pretty easy to expose. There's been a few debugging situations where it would have been useful for me, too 😅
from m.css.
Related Issues (20)
- Does htmlify leave alone string between [ and ] HOT 3
- Feature Request: Doxygen: Support line number in code block output
- Feature Request: Doxygen: Support line numbers in code blocks
- ARGH! FontAwesome is not so Awesome. HOT 2
- Getting listed on Pelican-Themes? HOT 2
- Doxygen: `friend` keyword sneaks through as part of the type for `constexpr` operators
- Doxygen: m.css ignores `constexpr="yes"` attribute HOT 1
- warning: unknown <sectiondef> kind property and failure with AssertionError HOT 3
- RELATIVE_URLS not respected for css styling in local preview (WIndows) HOT 1
- Adding search, for an m.css newbie HOT 2
- PlantUML Support HOT 1
- m.css theme applied on main page but not on others HOT 1
- I've tried to build my site at github pages using m.css but seems github pages only build from Jekyll, not pellican HOT 4
- Assertion error when running HOT 9
- libgs not in expected path error HOT 6
- Python 3.12 Deprecation Warnings and Runtime script error HOT 1
- Cover image doesn't render on my Windows 10 HOT 2
- Unable to find {path to file}, skipping url replacement HOT 1
- Changes to my content files do not reflect on the rendered website HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from m.css.