Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: .NET documentation help  (Read 3758 times)

0 Members and 1 Guest are viewing this topic.

johnnywz00

  • Newbie
  • *
  • Posts: 18
    • View Profile
    • Email
.NET documentation help
« on: November 16, 2024, 03:52:30 pm »
I am trying to learn C# for a potential job opportunity in the future. I have played around with C++ SFML for several years and I'd really like to just get my feet wet by more or less translating some of my existing projects to C#/SFML.Net.
Could anyone send me/point me to the C# API docs *in HTML form*? Or give me clear step by step instructions how to produce them? All that I see docwise that came with the .Net download are four .xml files corresponding to each of the main four SFML libraries. I have wasted an entire free evening trying to figure out how to generate or get a hold of a simple doc system where I click on index.html and from there everything is linked and displayed properly in a browser. Can the C# development environment display them somehow? I tried downloading Doxygen source but first it talked about some obscure command line program that was out of date even though I have just updated my new Mac to the latest Sequoia. After some tedious wading and arcane online research, I got CMake to recognize a newer version of bison rather than the old one, and got Doxygen built. And then I was lost again, generating a default Doxyfile from the Doxygen binary, and seeing that its contents were as long as an encyclopedia and I was meant to fill it out.
« Last Edit: November 16, 2024, 04:11:10 pm by johnnywz00 »

johnnywz00

  • Newbie
  • *
  • Posts: 18
    • View Profile
    • Email
How to generate SFML.Net documentation
« Reply #1 on: November 17, 2024, 05:35:36 am »
Never mind... I finally got AI to teach me how to generate it. I sure lost some hair in the process, though. Here is what I did. Happy are those who already knew how to generate documentation.

Download source for Doxygen (1.12.0 at the time of posting)
Build with CMake. Oh, wait... your version of "bison" isn't good enough for Doxygen? Download bison 2.7. (On Mac I used the Terminal command `brew install bison@2.7`). What, CMake still thinks your version of "bison" isn't good enough? Click on CMake's "Environment" button (GUI CMake), and where you see PATH, enter the full path to where bison 2.7 is located, and then a colon, BEFORE the paths that are currently typed there. If you used `brew install`, this path is likely to be something like `/opt/homebrew/Cellar/bison@2.7/2.7.1_1/bin`.
Now CMake should configure correctly and generate a Makefile.
In Terminal navigate to the Doxygen/build folder and enter `make`.
If you want you can install the `doxygen` binary somewhere in your PATH like /usr/local/bin. Or you can use it right where it sits and include its full path to invoke it.
You should have the source code download for SFML.Net. In Terminal, navigate to the `src` folder within that folder. Once there, enter:
`/path/to/doxygen -g Doxyfile.sfml.net`
Then open that file with a text editor. The AI recommended that I fill out the following fields: there may be more that you'll want, but this should at least give you something. The default generated Doxyfile is large, so just use the Find command to look for these keywords:

PROJECT_NAME = "SFML.Net"
PROJECT_BRIEF = "Simple and Fast Multimedia Library for .NET"
INPUT = /path/to/sfml.net/source/code   (if the Doxyfile is located in .../SFML.Net.x.x.x/src/ this can be blank)
FILE_PATTERNS = *.cs
RECURSIVE = YES
OUTPUT_DIRECTORY = ./docs
GENERATE_HTML = YES
HTML_OUTPUT = html
EXTRACT_ALL = YES
EXTRACT_PRIVATE = YES
EXTRACT_PACKAGE = YES
EXTRACT_STATIC = YES
GENERATE_LATEX = NO
HAVE_DOT = NO

Save and close the Doxyfile.
In Terminal type:
`/path/to/doxygen Doxyfile.sfml.net`
There should now be a "docs" folder located within "src". Go inside "docs", make an alias/symlink of "index.html", and put that alias somewhere easy to access.
You've finally got C# SFML Docs, and a lot less hair.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11058
    • View Profile
    • development blog
    • Email
Re: .NET documentation help
« Reply #2 on: November 27, 2024, 12:27:19 pm »
Glad you figured it out!

Yeah, currently the Sandcastle solution isn't really viable anymore.
doxygen seems to generate good-enough docs and is easy enough to use.

There's an option issue about this here: https://github.com/SFML/SFML.Net/issues/275
Official FAQ: https://www.sfml-dev.org/faq/
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/