Closed deepakjois closed 1 month ago
You need to import extra::algebra
to use this function (https://numbat.dev/doc/list-functions-math.html?highlight=quadra#algebra)
use extra::algebra
Thanks! I suspected I wasnt importing something. But I couldnt find the use
keyword anywhere even after skimming the docs multiple times. Maybe worth putting this info somewhere in the docs where it can be found easily?
This place may be a bit too obscure, and i initially thought it might be for custom modules that we write and not for modules that are available by default
It might be a good idea in general to explicitly tell if a module is auto imported or if you should use
it first. I imagine a single line under the
Defined in:
extra::algebra
Maybe something like:
requires using:
use extra::algebra
It would require some changes to the build script in book, but I wouldn't mind taking a stab at it if @sharkdp agrees that something like this would be beneficial.
Edit: after taking a look at the documentation I noticed that some of the module lines lists multiple modules. It should still be possible to implement, but some thought should be put into how it is formatted in those cases.
An alternative approach I just thought of that would be much easier is to just change the sidebar so that it contains prelude modules as a subcategory of The prelude and all other predefined functions stay as a subcategory of Predefined functions, which then just gets a bit descriptive text about how to use the modules found there. It's much easier, probably more intuitive and would avoid repeating basically the same line everywhere.
This place may be a bit too obscure, and i initially thought it might be for custom modules that we write and not for modules that are available by default
True. Let's improve this.
requires using:
use extra::algebra
I have another idea. Since #566 has been merged, we now have example code for every function Numbat. See https://numbat.dev/doc/list-functions-math.html?highlight=quadra#quadratic_equation-solve-quadratic-equations, for example. Maybe we should add use extra::algebra
as an additional line to the examples that require it? We already add the use extra::algebra
line when you click on the "Run this code" button. FYI: @Bzero
Maybe we should add
use extra::algebra
as an additional line to the examples that require it?
I like that way of doing it. It keeps it close to the function and makes it obvious how the example was able to call the it.
I have another idea. Since #566 has been merged, we now have example code for every function Numbat. See https://numbat.dev/doc/list-functions-math.html?highlight=quadra#quadratic_equation-solve-quadratic-equations, for example. Maybe we should add
use extra::algebra
as an additional line to the examples that require it? We already add theuse extra::algebra
line when you click on the "Run this code" button. FYI: @Bzero
That should be quite easy to do, the necessary use
statements are already there, they just don't get printed. I didn't add them to the examples to keep them concise but I agree that it would make it more obvious how to use non-prelude functions.