summaryrefslogtreecommitdiff
path: root/doc/_extensions/autojsdoc
AgeCommit message (Collapse)Author
2019-02-18[FIX] doc: workarounds for weirdo code & refsXavier Morel
Make UnknownNS more capable (of giving no fucks) so the documentation builder blows up less on weird-ass code at module toplevels. UnknownNS should probably be split out from NSDoc though, that requires odd workarounds in `__getitem__`.
2018-11-02[MERGE] forward port branch saas-11.4 up to f6ca72b3ce9Christophe Simonis
2018-10-23[FIX] doc: building on Python 3.6.7, 3.7.1, possibly 2.7.???Xavier Morel
https://bugs.python.org/issue33899 tokenize.generate_tokens was altered to match the C tokenizer, previously it would end the tokenization with just an ENDMARKER, in the titled releases it adds a NEWLINE before the ENDMARKER if none is present, this broke the parsing of jsdoc type specifications as Python's tokenizer is used under the cover. closes odoo/odoo#28056
2018-10-01[FIX] doc: implement delegation/inheritance in JS documenterXavier Morel
Else website_sale_wishlist.wishlist blows up the documenter: ``events`` is set to sAnimations.Class.events but that is not an "own property" of sAnimation.Class, it is instead inherited from Widget. If delegation is not implemented, the value resolves to <nothing>, which blows up when trying to set its name to the "property name" (by calling ``set_name``).
2018-08-27[FIX] doc building and warningsXavier Morel
doc: * fix incorrect doc comments (documenting params which don't exist) * correctly quote non-refs * fix role label syntax (backticks must be escaped) * add newline to fix warning JS doc parser: * fix handling of already-resolved objects * fix handling of non-string properties (e.g. foo[0] at module toplevel) * don't blow up if subject of .include call can't be resolved (just ignore) Others: * add translator support for ``problematic`` node (apparently used for some refs by recent Sphinx)
2018-07-24[FIX] various broken JS docstringsXavier Morel
Resulting in sphinx warnings or ill-formatted doc all the way to the doc not building at all.
2018-04-05[FIX] doc: non-module JS autodocumentersXavier Morel
Also when there is both a docstring and directive-level content put the docstring first. That seems to match what Sphinx's autodoc does and looks less odd. Possible future improvement: a parameter to suppress the docstring? Possibly a way to reorder the non-docstring content (e.g. members documentation)?
2018-04-05[FIX] doc: non-module JS autodocumentersXavier Morel
Also when there is both a docstring and directive-level content put the docstring first. That seems to match what Sphinx's autodoc does and looks less odd. Possible future improvement: a parameter to suppress the docstring? Possibly a way to reorder the non-docstring content (e.g. members documentation)?
2018-02-19[FIX] doc: tokenization of nested generics in JS docstringsXavier Morel
With more than 1 level of generic type, the "closure" of generic parameters would get tokenized by python as a single right shift (>>) rather than two gt (>, >) leading to our own tokenizing pass getting lost and blowing up. Fix by explicitly recognizing and splitting (>>) into (>, >). We could consider writing the entire tokenizer ourselves instead of post-processing Python's but given the entire post-processing function is currently shorter than just Pythons' tokenizer's regexes... Anyway issue found by vsc while trying to write better docstrings.
2018-01-10[FIX] doc: informal sub-paramsXavier Morel
Revert 6cb12273e2c1e1385098e38880317ae162dc902e which reverted 08d48b0fff0938e7ac004767dddfab13d3cff30b. Issue was the support for sub-parameters (aka @param {type} foo.bar) where the "parent" parameter was not formal (only present in a function's docstring, but not in the function's parameters list), subtype creation would fail to find a root parameter to attach the sub-parameter to. This has not actually been fixed, but for the specific case where the formal parameters list is *completely empty* we fall back on a list of the docstring's parameters, which works well enough for this case.
2017-10-30[FIX] doc: handle unknown browser globals betterXavier Morel
Before this, if a new global was added to JS code (module toplevel, function bodies are not considered) it would blow up when attempting to resolve variable refs & uses. Make the toplevel scope a defaultdict such that if e.g. a "foo" is looked up in a module but not a local variable of that module it's assumed to be an UnknownNS object (from which further UnknownNS can be deref'd).
2017-10-10[FIX] building documentation with P3Xavier Morel
* fix P3 incompatibilities in doc/_extensions * vendor pyjsdoc, strip out everything we're not using and make what's left P3-compatible (upstream is not P3 compliant) * drop undeclared dependency on attrs as it turns out not to be much used
2017-09-18[ADD] doc: JS document extraction systemXavier Morel
* Fix a bunch of ill-documented/incomplete/incorrect method docs * add start of Sphinx extension to extract & integrate jsdoc into Sphinx documentation: - parse JS files (and don't blow up), uses a fork of pyjsparser as the project currently does not parse comments - extract cross-module dependency information - parse JsDoc comments using pyjsdoc and infer structure from code & jsdoc - ``ast`` CLI printing a simplified AST of the input files - ``dependencies`` creating a dependency graph of either all modules in the provided input files or the modules matching the specified filters (warning: will not work if missing dependencies), generates a .dot file - ``extractor`` generating a plain text module documentation (mix of rst and markdown styles, not anything formal) * sphinx extension with an "automodule" directive taking a module name and generating the documentation for it