Question on DOxygen use

General FreeBASIC programming questions.
Post Reply
wallyg
Posts: 276
Joined: May 08, 2009 7:08
Location: Tucson Arizona

Question on DOxygen use

Post by wallyg »

I have looked into and plan to use DOxygen for documenting my next project.

I was wondering if there were any special things I need to consider or do because FB is not in the list of languages that DOxygen talks about? Any suggestions or comments would be welcome on getting started. Or any gotchas I need to consider?

Thanks in advance for any help.

Wallly
marcov
Posts: 3488
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Re: Question on DOxygen use

Post by marcov »

Since such applications are based on a language parser to retrieve function and type signatures from source, that will be difficult without a supported parser.
wallyg
Posts: 276
Joined: May 08, 2009 7:08
Location: Tucson Arizona

Re: Question on DOxygen use

Post by wallyg »

Thank you for your response. Any suggestions for a post processor to pull documentation embedded in source code into a user manual?

Wally
paul doe
Moderator
Posts: 1818
Joined: Jul 25, 2017 17:22
Location: Argentina
Contact:

Re: Question on DOxygen use

Post by paul doe »

wallyg wrote: May 19, 2024 17:11 Thank you for your response. Any suggestions for a post processor to pull documentation embedded in source code into a user manual?
Certainly: code it.

That depends on which format is the documentation written in. You can do something akin to .Net languages, with XML comments:

Code: Select all

  ''' <summary>
  ''' Snaps the specified vertex to the block grid.
  ''' </summary>
  ''' <param name="v">The vertex to snap to grid, expressed in world coordinates.</param>
  ''' <returns></returns>
  Protected Function SnapToGrid(v As Vec2) As Vec2
    Dim hbsx As Single = IIf(v.x >= 0, GridSize * 0.5, -GridSize * 0.5)
    Dim hbsy As Single = IIf(v.y >= 0, GridSize * 0.5, -GridSize * 0.5)

    Return (New Vec2((v.x + hbsx) \ GridSize, (v.y + hbsy) \ GridSize) * GridSize)
  End Function
That way, you pass the source code to the preparser, which can then extract the needed info for any symbols you document (XML is easy to parse; there are several parsers available in this forum).
marcov
Posts: 3488
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Re: Question on DOxygen use

Post by marcov »

wallyg wrote: May 19, 2024 17:11 Thank you for your response. Any suggestions for a post processor to pull documentation embedded in source code into a user manual?
I've no idea if that is even possible. Anyway, these are questions for Doxygen, though they might benefit from a formal FB dialect spec.

Maybe, very maybe, there is some shortcut via LSP (the per language bit of Visual Studio Code). But I personally I'm not too deep into those.
wallyg
Posts: 276
Joined: May 08, 2009 7:08
Location: Tucson Arizona

Re: Question on DOxygen use

Post by wallyg »

Thanks, Paul. I will certainly look into this as a possibility.
St_W
Posts: 1629
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: Question on DOxygen use

Post by St_W »

You may have a look at "fbdoc": https://github.com/DTJF/fbdoc
Post Reply