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
The new newlispdoc system is bitchen, Lutz ;-) Thank you!
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
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
Lutz!
How can I specify two syntax lines for one function?
for ex:
(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.
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 )
;; @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
This is a workaround. Thanx!
There is a bug in newLISPdoc:
After this line:
(set 'page (join page "n"))
I added this line:
(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.
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.
> (set 'page (read-file "test"))
"123nabcn"
> (set 'p (parse page "n"))
("123" "abc" "")
> (join p "n")
"123nabcn"
>
Lutz
Oops,
I had this side effect of another change I made in a modified version for autolisp:
I changed:
(set 'page (filter (fn (ln) (or (starts-with ln ";;") (= (length (trim ln)) 0))) page))
to:
(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.
And a last line must not have it!
Quote
newLISP v.9.1.2 on Win32.
> (set 'page (read-file "test.txt"))
"123rnabc"
> (set 'p (parse page "rn"))
("123" "abc")
> (join p "n")
"123nabc"
>
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