Message Boards Message Boards

1
|
2959 Views
|
4 Replies
|
3 Total Likes
View groups...
Share
Share this post:

A FE version of copying symbols/text as plain text like the copy as?

Posted 2 years ago

Looking for a method to copy as text of boxes of System function definitions and return the without the low level boxes. That is without having to manually using the menu item 'copy as text'. Thanks.

POSTED BY: Andrew Meit
4 Replies
Posted 2 years ago

Has, how can I contact you? Would you be interested in helping me directly? Thanks.

POSTED BY: Andrew Meit
Posted 2 years ago

Thanks, another route; however what kind of data format is it? TextSentences fail as gaining access to the text block. Clues, please.

Text@Information[AndersonDarlingTest]["Usage"]

I can do this:

TextSentences@Apply[Text, Information@Plot][[1, 2]]

so, I can do this:

Part[TextSentences@Apply[Text, Information@Plot][[1, 2]], 1]

What I really, really want is a way to pull out the function template for each usage grabbed. ie parse the boxes to get Plot template. BTW the text show below can only be done by copy as text manually. However, there are special boxes for quoted txt etc...

Plot[f,{x,Subscript[x, min],Subscript[x, max]}]

generates a plot of f as a function of x from Subscript[x, min] to Subscript[x, max].

What I desire is this: Plot[f,{x,x,x}] I was told the command line access has better plain text representation of System` symbols. WolframLanguageData has too many parsing problems for giving the usage info.

Thoughts, thanks so much for your help. :-)

=======

Ok who can improve or warn of edge cases for this parsing code. I had this for 10 yrs but was not ready to use it fully. This the next to last step for my project. If there is a way to replace argument slots with PlaceHolders that would be the last step.

Thank you!

GetTemplates3[x_] :=   Module[{},    stuff = "\n" <> Information[x, "Usage"];    mnuitms = 
StringCases[stuff, "\n\!\(\*RowBox" ~~ Shortest[__] ~~ "}]\) "];    StringReplace[
mnuitms, {"\n" -> "", ", " -> ",", "\) " -> "\)",  "TI" | "TR" -> ""}]    ];
POSTED BY: Andrew Meit
Posted 2 years ago

Another way to do it:

enter image description here

POSTED BY: Hans Milton
Posted 2 years ago

Something like the following?

(As a picture, does not render well here when copied as code)

enter image description here

POSTED BY: Hans Milton
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract