SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Tools and Files

Reply
 
Thread Tools Display Modes
Old 01/02/2018, 10:07 PM   #1
yugecin
Big Clucker
 
Join Date: Oct 2009
Location: Belgium
Posts: 83
Reputation: 82
Default Improved pawn doc style

improved is subjective

About

Some of you may know you can write documentation in your PAWN code and the compiler can generate a report for you. See [Tutorial] Pawn Documentation Comments/Tags or just read the PAWN language guide (around page 52).

I found some things were annoying, so I changed the style a little bit.
Here are the most notable changes:
  • more uniform style
  • member types each have a different color
  • fixed showing empty properties in firefox and chromium
  • generated index table
  • larger fontsize
  • auto link to sa-mp wiki for every member
  • support for <b> <strong> <a> tags
  • ignore __file __date __time members

Examples/Demo

If you want to compare, check out the demo reports with the normal style and with my modified style. (Requires a browser that can do XSLT. Demo code partly copied from the PAWN language guide.)

Download/Usage

pawndoc.xsl
After the report has been generated, change the xml-stylesheet href in the generated xml file (should be on the 2nd line) to pawndoc.xsl and put the xsl file in the same folder. Then open the xml file with your favorite browser (that supports XSLT).

https://github.com/yugecin/pawndocimproved
__________________
robin_be
yugecin is offline   Reply With Quote
Old 01/02/2018, 11:03 PM   #2
Y_Less
Beta Tester
 
Y_Less's Avatar
 
Join Date: Jun 2008
Location: 629 - git.io/Y
Posts: 15,129
Reputation: 3170
Default Re: Improved pawn doc style

Nice. Too few people use this. One small personally subjective point - I like the look, when it is scaled to about 80% of current size. Right now everything is quite huge.

This is the custom .XSL I use for YSI and fixes.inc:

https://github.com/Open-GTO/sa-mp-fi...ter/custom.xsl

A lot of them are very fixes.inc specific, but I've found some of them useful for larger scripts, like <section>, <subsection>, <library>, <seealso>, etc. Would be nice to see the visual style of yours mixed with the added organisational features of mine.

Edit: Might as well mention this here for anyone else interested. The default SA:MP compiler has a bug in documentation generation when states (automata) are used and the resulting XML is invalid*. I use the following regex to remove these bad tags:

Search: <transition target[^/]+/>
Replace: (nothing)

Also, note 2, you can use <!-- XML comments --> in PAWNDoc comments:

PHP Code:
/**
<!-- A comment in a comment -->
*/ 
And the result will be output as a comment in the resulting XML.

* Technically it just puts garbage data in the file, so you may get lucky and not get an invalid file one time, but that's unlikely.
Y_Less is offline   Reply With Quote
Old 02/02/2018, 06:05 PM   #3
Freaksken
Gangsta
 
Freaksken's Avatar
 
Join Date: Mar 2009
Location: Belgium
Posts: 619
Reputation: 287
Default Re: Improved pawn doc style

Quote:
Originally Posted by yugecin View Post
Some of you may know you can write documentation in your PAWN code and the compiler can generate a report for you.
Didn't even know :O. This is how I did it before seeing this:
Attached Images
File Type: png Naamloos.png (14.2 KB, 199 views)
__________________
Always keep in mind that a lot of people are active on this forum in their spare time.
They are sacrificing time they could easily spend on things they would rather do, to help you instead.


[Include] FCNPC A.I. - [Tutorial] Speedometer - [WIP] Single-player-like co-op mission - [Other] List of all my work
Freaksken is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[FilterScript] Job Builder V2 improved vegaltasendai Filterscripts 8 24/06/2014 04:08 AM
Skins Walking style/Run style KaliKs Scripting Help 0 07/02/2014 11:35 AM
Have I improved? BigAl Everything and Nothing 1 10/09/2011 12:17 AM
Pawn Style! rafay Everything and Nothing 101 27/02/2009 07:45 PM


All times are GMT. The time now is 07:19 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.