9
$\begingroup$

Is it possible to collect all inputs programmatically from every function in the Documentation Center in a list and wrap them in a HoldComplete?

My case: With some fundamental functions modified, I would like run a test of all functions to see what function will fail to execute.

$\endgroup$
4
  • $\begingroup$ Use NotebookImport on Documentation directory restricting it to InputCells. It is quite slow but you only have to do it once. $\endgroup$
    – Kuba
    Commented Jul 9, 2016 at 9:35
  • $\begingroup$ keep in mind that some examples are meant to fail to show some issues or are just Messages related. $\endgroup$
    – Kuba
    Commented Jul 9, 2016 at 9:36
  • $\begingroup$ @Kuba thanks for the hint. In this case I may try to avoid importing the inputs from "possible issues", etc $\endgroup$
    – vapor
    Commented Jul 9, 2016 at 9:38
  • $\begingroup$ You can but I bet it is not the only section where messages are generated. $\endgroup$
    – Kuba
    Commented Jul 9, 2016 at 9:39

1 Answer 1

13
$\begingroup$

You may use the "DocumentationExampleInputs" property of the "WolframLanguageSymbol" entity or WolframLanguageData function.

With "WolframLanguageSymbol" entity:

EntityValue[Entity["WolframLanguageSymbol", "Round"], "DocumentationExampleInputs"]

For more than one at a time you can use "EntityAssociation" to have the entities as keys.

EntityValue[RandomEntity["WolframLanguageSymbol", 2], "DocumentationExampleInputs", 
   "EntityAssociation"]

Similarly for WolframLanguageData function:

WolframLanguageData["Round", "DocumentationExampleInputs"]

Getting all may take a few moments to download.

EntityValue[WolframLanguageData[], "DocumentationExampleInputs", 
       "EntityAssociation"]

Hope this helps.

$\endgroup$
1
  • $\begingroup$ Thanks! This is a lot more easier than extracting by hand. $\endgroup$
    – vapor
    Commented Jul 9, 2016 at 13:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.