Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the best way of documenting f# code?

Tags:

f#

sandcastle

I have tried Sandcastle with the patches included with the guided GUI installation, but unless I am doing something very wrong it's basically unsuitable for documenting F# code (even if it would work really well for C#). Maybe it works for others, in which case I would be very grateful for a short complete example that I could start from. Many thanks.

I am aware of Sandcastle doesn't output everything from a F# assembly , but the project referenced there does not yet appear ready for prime time.

There must surely be something that works reliably and is "good enough"? Many thanks for any suggestions.

Edit: Many thanks to everyone who replied. Brian's answer was closest to what I wanted, so I will accept it. However, the outcome is that there does not appear to be a solution that is both suited to F# and that works reliably. I will stick with textual comments for now.

I expect FsHtmlDoc.exe will start to work at some point. While I cannot rule out that it works already and I just did not use it correctly, googling it suggests I am not the only one to find it is not yet perfect.

like image 944
user1002059 Avatar asked Nov 30 '11 09:11

user1002059


2 Answers

I know next to nothing about Sandcastle, but note that like C#, in F# you can use triple-slash comments, and they will be output in the XML documentation file that the compiler outputs (in VS, on the project properties page, build tab, check the 'Xml documentation file' checkbox; on the command line, use the --doc argument to fsc.exe.)

Also, see FsHtmlDoc.exe in the PowerPack.

like image 85
Brian Avatar answered Oct 16 '22 23:10

Brian


You could also look at Focco

It produces a nice html based documentation. See here for an example:

like image 38
7sharp9 Avatar answered Oct 16 '22 22:10

7sharp9