Documentation in spad files

25 views
Skip to first unread message

Alasdair McAndrew

unread,
Oct 31, 2015, 8:04:19 PM10/31/15
to fricas...@googlegroups.com
I have belatedly discovered that HyperDoc picks up the documentation from compiled user-created spad files.  That is very very nice.

Where can I find some information on formatting docstrings?  I'm also finding that HyperDoc sometimes produces odd results: not entering a \newline, or introducing strange characters.

One more HyperDoc question: how can I get rid of those inferior FriCAS windows which occasionally appear to run commands in?  If I kill such a window, then on my system. both HyperDoc and FriCAS crash.

Thanks,
Alasdair

--
http://www.facebook.com/alasdair.mcandrew https://plus.google.com/+AlasdairMcAndrew/posts https://www.linkedin.com/pub/alasdair-mcandrew/a/178/108 https://twitter.com/amca01 http://numbersandshapes.net

Themos

unread,
Nov 2, 2015, 5:21:11 AM11/2/15
to FriCAS - computer algebra system
Hello Alasdair,

You may find the pages I wrote a long time ago useful. In fricas, you can see them by clicking on Reference at the top HyperDoc page and then HyperDoc (penultimate button).

Regards
Themos Tsikas

Themos

unread,
Nov 2, 2015, 6:21:10 AM11/2/15
to FriCAS - computer algebra system
Hello Alasdair,

to get rid of command windows generated by HyperDoc clicks, try ")close". You can see the system commands help if you follow "Settings" from HyperDoc top-level and then "Commands".

Themos Tsikas

On Sunday, 1 November 2015 00:04:19 UTC, Alasdair wrote:

Alasdair McAndrew

unread,
Nov 2, 2015, 6:40:27 AM11/2/15
to fricas...@googlegroups.com
Many thanks - I did in fact have a look through those pages.  But they seem more geared to producing stand-alone hypertex files.  What I was hoping to find was how to format text on lines starting with ++ in a spad file. 

Thanks again,
Alasdair

--
You received this message because you are subscribed to a topic in the Google Groups "FriCAS - computer algebra system" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/fricas-devel/iWEN3BoUOg8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to fricas-devel...@googlegroups.com.
To post to this group, send email to fricas...@googlegroups.com.
Visit this group at http://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.

Ralf Hemmecke

unread,
Nov 2, 2015, 7:01:56 AM11/2/15
to fricas...@googlegroups.com
On 11/02/2015 12:40 PM, Alasdair McAndrew wrote:
> Many thanks - I did in fact have a look through those pages. But they seem
> more geared to producing stand-alone hypertex files. What I was hoping to
> find was how to format text on lines starting with ++ in a spad file.

Most interesting is perhaps the part from util.ht that I give below.

https://github.com/fricas/fricas/blob/master/src/doc/ht/util.ht

BUT... I shouldn't recommend this. Personally, I'd rather want
reStructuredText in ++ docstrings. It would be much more readable
(although it probably won't work together with HyperDoc).

All this LaTeX-looking stuff is not handled by TeX, but by an adhoc
program in FriCAS. One can do basic things but not fancy LaTeX stuff.

As I said normally people learn from other .spad files. This is highly
unsatisfactory, because errors my easily be propagated. But I don't know
of any better way to learn how to write ++ docstrings.

Ralf

==================================================================

% use this for syntax punctuation: \spadSyntax{::}
\newcommand{\spadSyntax}[1]{``{\tt #1}''}

% constructors
\newcommand{\spadtype}[1]{\lispdownlink{#1}{(|spadType| '|#1|)}}
\newcommand{\nonLibAxiomType}[1]{{\it #1}} % things that browse
can't handle
\newcommand{\pspadtype}[1]{\nonLibAxiomType{#1}}

\newcommand{\spad} [1]{{\tt #1}} % note font
\newcommand{\spadvar} [1]{\spad{#1}} % exists in ++ comments;
to be removed
\newcommand{\s} [1]{\spad{#1}}

\newcommand{\httex}[2]{#1}
\newcommand{\texht}[2]{#2}

% Function names:
%
% The X versions below are used because AXIOM function names that end
% in ``!'' cause problems for makeindex for had-copy.
%
% Example: \spadfunFromX{reverse}{List} prints as reverse!
%
% In the "From" versions, the first arg is function name, second is
constructor
% where exported.
%
% Use the "op" flavors of "-", "+", "*" etc, otherwise the "fun" flavors

\newcommand{\userfun} [1]{{\bf #1}} % example, non-library
function names

\newcommand{\fakeAxiomFun}[1]{{\bf #1}} % not really a library
function
\newcommand{\pspadfun} [1]{\fakeAxiomFun{#1}}

\newcommand{\spadfun} [1]{\lispdownlink{#1}{(|oPage| '|#1|)}}
\newcommand{\spadfunX}[1]{\spadfun{#1!}}

\newcommand{\spadfunFrom}[2]{\lispdownlink{#1}{(|oPageFrom| '|#1| '|#2|)}}
\newcommand{\spadfunFromX}[2]{\spadfunFrom{#1!}{#2}}

\newcommand{\spadop} [1]{\lispdownlink{#1}{(|oPage| '|#1|)}}

\newcommand{\spadopFrom}[2]{\lispdownlink{#1}{(|oPageFrom| '|#1| '|#2|)}}

% redundant defns for system commands
\newcommand{\syscom}[1]{\lispdownlink{)#1}{(|syscomPage| '|#1|)}}
%
\newcommand{\spadsyscom}[1]{{\tt #1}}
\newcommand{\spadcmd}[1]{\spadsyscom{#1}}
\newcommand{\spadsys}[1]{\spadsyscom{#1}}


% Following macros should be phased out in favor of ones above:

\newcommand{\gloss}[1]{\spadgloss{#1}}
\newcommand{\spadglos}[1]{\spadgloss{#1}}
\newcommand{\glossSee}[2]{\spadglossSee{#1}{#2}}

Reply all
Reply to author
Forward
0 new messages