mintlify / writer

✍️ AI powered documentation writer
https://www.mintlify.com/writer
MIT License
2.8k stars 129 forks source link

Fails to document python functions in jupyter notebook #104

Open rabyj opened 1 year ago

rabyj commented 1 year ago

Context

Python: 3.10.9 Mintlify Doc Writer: 2.2.1

Problem

Mintlify does not manage to properly read python when it is in a .ipynb notebook, but it still manages simple functions with the highlight method. It declares that Language not supported, so no general functions are available, but I do not know the exact failure conditions.

Here are two examples of results when you highlight and use the context menu (within a cell).

Examples

Example that does not work (fails with a *|MARKER_CURSOR|* result)

from sklearn.model_selection import cross_val_score
def model_score(X,y,class_model,params) -> float:
    scores = cross_val_score(
        estimator=class_model,
        X=X,
        y=y,
        scoring="Accuracy",
        cv=5,
        **params
    )
    return scores.mean()

Minimal example that works

# Defining a function called `a_fct` that takes two arguments, `x` and `y`, and returns the sum of `x` and `y`.
def a_fct(x, y):
    return x + y
smohiuddin commented 11 months ago

+1

rabyj commented 11 months ago

@smohiuddin product appears abandoned, consider switching to another workflow if you're still using Mintlify.