documentation generation

Scripted ALFA systems & related tech discussions (ACR)

Moderators: ALFA Administrators, Staff - Technical

User avatar
ç i p h é r
Retired
Posts: 2904
Joined: Fri Oct 21, 2005 4:12 pm
Location: US Central (GMT - 6)

Post by ç i p h é r »

Thanks for the clarification. It's clearly very intentional then.
User avatar
peterdin
Orc Champion
Posts: 456
Joined: Sat Jul 09, 2005 3:40 pm
Location: GMT+1

Post by peterdin »

I have changed the comments of all ISS files currently in the repository

results can be found here http://www.chalana.nl/alfa2/

If needed I can commit the changed files back to the repository so we have a start here.

let me know what is needed.
A.K.A Pee Dee

past PC: Maha Tari, aka. Alinia Mountain curiousity killed the cat

All those moments, lost in time.
Like tears in the rain.
Time to die.
User avatar
ç i p h é r
Retired
Posts: 2904
Joined: Fri Oct 21, 2005 4:12 pm
Location: US Central (GMT - 6)

Post by ç i p h é r »

Interesting. I looked at one of the files I committed using the comment standard you noted above (//!) but it seems as though it's now picking up all comments? Is this what you modified?

I'm not sure if the output needs tweaking or if it's how I've commented, but I'm seeing comments from within functions show up now and comments around prototypes that do not show up at all. Look at acr_resting_i for instance under RULES. Seems a bit off....
User avatar
peterdin
Orc Champion
Posts: 456
Joined: Sat Jul 09, 2005 3:40 pm
Location: GMT+1

Post by peterdin »

can you give an example of a missing prototype documentation and one of the comments from within a function.

can't find them that quickly :)
A.K.A Pee Dee

past PC: Maha Tari, aka. Alinia Mountain curiousity killed the cat

All those moments, lost in time.
Like tears in the rain.
Time to die.
User avatar
ç i p h é r
Retired
Posts: 2904
Joined: Fri Oct 21, 2005 4:12 pm
Location: US Central (GMT - 6)

Post by ç i p h é r »

Source:

http://svn.sourceforge.net/viewvc/alfa- ... iew=markup

Document:

http://www.chalana.nl/alfa2/acr__resting__i_8nss.html

Look at any of the function prototypes and their comments. Only the first line appears to get used. Am I using the wrong comment prefix?
User avatar
peterdin
Orc Champion
Posts: 456
Joined: Sat Jul 09, 2005 3:40 pm
Location: GMT+1

Post by peterdin »

if you look at a previous post there is a brief comment and an extended comment

I adjusted the comments such that the first line only shows up in the brief comments and the rest will show up in the extended comments (this can be read when you clik on the function name on the top, it'll jump to the function documentation showing more detail)

it is good to remember that the brief comment can hold only 1 line.

does this solve the issue?
A.K.A Pee Dee

past PC: Maha Tari, aka. Alinia Mountain curiousity killed the cat

All those moments, lost in time.
Like tears in the rain.
Time to die.
User avatar
ç i p h é r
Retired
Posts: 2904
Joined: Fri Oct 21, 2005 4:12 pm
Location: US Central (GMT - 6)

Post by ç i p h é r »

Sounds like it. Let me take another look.
User avatar
peterdin
Orc Champion
Posts: 456
Joined: Sat Jul 09, 2005 3:40 pm
Location: GMT+1

Post by peterdin »

any news on this yet?

The sooner we get this into the archive the better it is.
As said, I have changed all the _i files and they're ready to be posted.
A.K.A Pee Dee

past PC: Maha Tari, aka. Alinia Mountain curiousity killed the cat

All those moments, lost in time.
Like tears in the rain.
Time to die.
User avatar
ç i p h é r
Retired
Posts: 2904
Joined: Fri Oct 21, 2005 4:12 pm
Location: US Central (GMT - 6)

Post by ç i p h é r »

Yeah, there is. While I now understand the brief/expanded views, there are still some quirks. Refer to the code and documentation for comparison as linked above:

1. indentation in the documentation is odd, it doesn't match the actual comments - see _playerHasBedroll()
2. expanded display is really off in some places - see _playerCanRest()
3. it looks like standard comments using the prefix // are being picked up in the expanded view (they shouldn't - only //! should, right?) - see _playerCanRest()

Other than that, it looks great! Good work peterdin. :D
User avatar
peterdin
Orc Champion
Posts: 456
Joined: Sat Jul 09, 2005 3:40 pm
Location: GMT+1

Post by peterdin »

I'll have a look at it and sort it out.
A.K.A Pee Dee

past PC: Maha Tari, aka. Alinia Mountain curiousity killed the cat

All those moments, lost in time.
Like tears in the rain.
Time to die.
User avatar
peterdin
Orc Champion
Posts: 456
Joined: Sat Jul 09, 2005 3:40 pm
Location: GMT+1

Post by peterdin »

ç i p h é r wrote:Yeah, there is. While I now understand the brief/expanded views, there are still some quirks. Refer to the code and documentation for comparison as linked above:

1. indentation in the documentation is odd, it doesn't match the actual comments - see _playerHasBedroll()
2. expanded display is really off in some places - see _playerCanRest()
3. it looks like standard comments using the prefix // are being picked up in the expanded view (they shouldn't - only //! should, right?) - see _playerCanRest()

Other than that, it looks great! Good work peterdin. :D
1: has todo with the use of "-" in the comments. use \param for parameter descriptio and \return for return description
2: see 1
3: that's because I did a global replace of // whit //!

I have uploaded some changes at the url provided earlier (only the resting file I've changed )
It looks better now, there's only 1 thing: new lines are not included. It glues everything together.
I have to sort out why, but I run out of time.
A.K.A Pee Dee

past PC: Maha Tari, aka. Alinia Mountain curiousity killed the cat

All those moments, lost in time.
Like tears in the rain.
Time to die.
User avatar
ç i p h é r
Retired
Posts: 2904
Joined: Fri Oct 21, 2005 4:12 pm
Location: US Central (GMT - 6)

Post by ç i p h é r »

Ok so just to be clear:

INCORRECT:
//! - Param1: first argument
//! - Returns:
//! - 1: success
//! - 0: fail

CORRECT:
//! \param Param1: first argument
//! \return Returns:
//! \return 1: success
//! \return 0: fail

Is this the right interpretation? Or does anything after \param or \return need to be on one line as well?

Things look better but yeah, still needs a few tweaks.
User avatar
peterdin
Orc Champion
Posts: 456
Joined: Sat Jul 09, 2005 3:40 pm
Location: GMT+1

Post by peterdin »

CORRECT:
//! \param Param1 first argument
//! \return
//! 1: success
//! 0: fail

question: does the script compiler support this style:
/* \param Param1 first argument
\return
1: success
0: fail
*/
it looks like the doc generator has some problems with multiple lines in combination with the //! style comment.
A.K.A Pee Dee

past PC: Maha Tari, aka. Alinia Mountain curiousity killed the cat

All those moments, lost in time.
Like tears in the rain.
Time to die.
User avatar
peterdin
Orc Champion
Posts: 456
Joined: Sat Jul 09, 2005 3:40 pm
Location: GMT+1

Post by peterdin »

well Ihave figured it out (at last *sighs)
have a look at the resting doc on the previous posted link.
Doxgen will glue everything togehter in one paragraph. If a new line is needed, add a \n.


snippet of the code:
//! This function determines if a player is allowed to rest (heal and restore spells).

//! \param oPC: player attempting to rest
//! \return
//! 1 - can rest\n
//! 0 - is not tired\n
//! "-1" - cannot rest\n
//!
//! Triggers must be setup for the following conditions:\n
//! indoor rest zone (for inns/rooms only - does not require bedroll)\n
//! outdoor rest zone (for wilderness only - requires bedroll but rest anytime)\n
//! Spot/Search widget - detect rest zones (terrain suitable for resting w/o a bedroll)\n
int _playerCanRest(object oPC);

btw: followoing gives the same results, perhaps a matter of taste(or style guide). btw: do we have a rule which says which style to use?
/*! This function determines if a player is allowed to rest (heal and restore spells).

\param oPC: player attempting to rest
\return
1 - can rest\n
0 - is not tired\n
"-1" - cannot rest\n

Triggers must be setup for the following conditions:\n
indoor rest zone (for inns/rooms only - does not require bedroll)\n
outdoor rest zone (for wilderness only - requires bedroll but rest anytime)\n
Spot/Search widget - detect rest zones (terrain suitable for resting w/o a bedroll)\n
*/
A.K.A Pee Dee

past PC: Maha Tari, aka. Alinia Mountain curiousity killed the cat

All those moments, lost in time.
Like tears in the rain.
Time to die.
User avatar
ç i p h é r
Retired
Posts: 2904
Joined: Fri Oct 21, 2005 4:12 pm
Location: US Central (GMT - 6)

Post by ç i p h é r »

I see. Definitely more orderly now but it looks to me like the brief description (one liner) is gone. Do you notice that too?

About // vs /* */, no there's no hard style rule on that but I prefer // for most comments (it's easier) and reserve /* */ for when I need to comment out blocks of code that I don't want to delete. Also, I find that the // prefix on evey comment line makes files more readable, but again, it's mostly preference. If we need to standard to accommodate doxygen, then we can go with strictly one method.
Locked