newLISP source code documentation system

Notices and updates
Locked
Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

newLISP source code documentation system

Post by Lutz »

The newLISP documentation system newlispdoc is ready:

http://newlisp.org/code/newLISPdoc.html

and in action on a new unix.lsp import module (alpha):

http://newlisp.org/code/modules/unix.lsp.html


Lutz

m i c h a e l
Posts: 394
Joined: Wed Apr 26, 2006 3:37 am
Location: Oregon, USA
Contact:

Post by m i c h a e l »

The new newlispdoc system is bitchen, Lutz ;-) Thank you!

m i c h a e l

m i c h a e l
Posts: 394
Joined: Wed Apr 26, 2006 3:37 am
Location: Oregon, USA
Contact:

Post by m i c h a e l »

You can also use things like ⇒ or → (for more compatability) within the text of the docs! This is very cool, indeed.

m i c h a e l

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

Posted an updated version 0.91:

http://newlisp.org/syntax.cgi?code/newlispdoc.txt

The first version could not deal with CR-LF line terminations in Win32. Also updated the documentation:

http://newlisp.org/code/newLISPdoc.html

Lutz

Dmi
Posts: 408
Joined: Sat Jun 04, 2005 4:16 pm
Location: Russia
Contact:

Post by Dmi »

Lutz!

How can I specify two syntax lines for one function?
for ex:

Code: Select all

(example int-num str-text)
(example int-num str-list int-flag)
Also it would be cool to have an additional tag (for ex. @origin) to specify an internet link to the home place of the library.
WBR, Dmi

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

You could do 2 syntax lines and for the link there is already the @link tag (see the documentaion at http://newlisp.org/code/newLISPdoc.html )

Code: Select all

;; @syntax (example <int> <str>)
;; @param <int> The number.
;; @param <str> The text.
;; @syntax (example <int> <str> <int>)
;; @param <int> The number.
;; @param <str> The list of strigs.
;; @param <in> The flag.
;;
;; look for the library @link http://example.com/example.lsp here
;;
The @link tag does not need to be at the start, but can be anywhere in the text.

Lutz

Dmi
Posts: 408
Joined: Sat Jun 04, 2005 4:16 pm
Location: Russia
Contact:

Post by Dmi »

This is a workaround. Thanx!
WBR, Dmi

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Post by HPW »

There is a bug in newLISPdoc:

After this line:

Code: Select all

	(set 'page (join page "\n"))
I added this line:

Code: Select all

	(set 'page (string page "\n"))
The join only puts the linefeeds between the lines.
The last line misses the linfeed and some following replace commands fail.
Hans-Peter

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

When splitting line-feed terminated text lines into a list of lines, the last list member will be an empty string. This forces the join to add the line-feed again.

Code: Select all

> (set 'page (read-file "test"))
"123\nabc\n"
> (set 'p (parse page "\n"))
("123" "abc" "")
> (join p "\n")
"123\nabc\n"
> 
Lutz

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Post by HPW »

Oops,

I had this side effect of another change I made in a modified version for autolisp:

I changed:

Code: Select all

(set 'page (filter (fn (ln) (or (starts-with ln ";;") (= (length (trim ln)) 0))) page))
to:

Code: Select all

(set 'page (filter (fn (ln) (starts-with ln ";;") ) page))
because I want to get rid of a serious amount of empty HTML lines (Ok they do not display in the browser-rendering) but they add to files-length.
Hans-Peter

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Post by HPW »

And a last line must not have it!
newLISP v.9.1.2 on Win32.

> (set 'page (read-file "test.txt"))
"123\r\nabc"
> (set 'p (parse page "\r\n"))
("123" "abc")
> (join p "\n")
"123\nabc"
>
Hans-Peter

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

Yes, in your example the last line should not have it. 'parse' and 'join' are the inverse of each other. When you go in without a line feed ending the last line, the the join will not add a line-feed either.

For our dicussion about newlispdoc this means: Finish the last line of your text with and [enter] or it will not be processed.

Most people will do this anyway and some text editors (i.e. vi ) add a line-feed automatically.

Lutz

Locked