xjDocs - a code documentation generator for Xojo

I think MultiMarkdown has a way to use XSLT to transform its output, but I haven’t gotten that far. The templates / css that are used by xjDocs can be customized for more control.

I’m open to ideas, for making other things easier (like easier syntax for simple or specific tables…)

[quote=65398:@scott boss]Like it so far also. Is there some advice/docs/whatever to generate html templates that we can use instead of the default one?
Also is there advice/docs/etc for using an alternative CSS file?

[/quote]

I haven’t had a chance to squeeze the documentation of the template system out of my brain in a coherent way yet (and custom templates is also a place where the current state of error reporting may be an issue – imagine building your own template and having it fail with no more information than “the template couldn’t be processed”. Ouch.)

If you haven’t dug it out yet, the default template is stored in the application bundle -> Contents -> Resources -> BuiltInTemplate_Default

If you want to play:

  1. Make a new folder somewhere to store your custom templates

  2. In the xjDocs preferences, tell it where that templates folder is

  3. Copy that “BuiltInTemplate_Default” folder into your templates folder and rename it.

  4. Reload the templates (if xjDocs is running)

The simplest changes would be to the CSS alone - duplicate Main.css and call it anything (.css) - it should become a “style” option for your new template copy, with the style having the same name as the css file.

If you look at the template files, you can probably get at least some idea how things work, but documentation and good error reporting will be crucial to the sanity of anyone making a template set. :slight_smile:

[quote=65400:@Paul Messias]If you haven’t dug it out yet, the default template is stored in the application bundle -> Contents -> Resources -> BuiltInTemplate_Default

If you look at the template files, you can probably get at least some idea how things work, but documentation and good error reporting will be crucial to the sanity of anyone making a template set. :-)[/quote]

I managed to work out the template thing for myself before coming back here and seeing that you posted instructions. DOH! Anyway, I basically did exactly what you described, messed with the CSS, and managed to get the MMD tables to look mostly like your Constants table. I’ll definitely be playing more with the CSS. I’m fond of XOJO’s doc style, and would like to craft a template that follows that style.

I also looked at your template html files and they reminded me of PHP templates, like WordPress uses, but using HTML comments for the code instead of PHP. Did you create the language and parser for your templates? I don’t recognize it.

At any rate, you’ve built a really nice system that’s easy to use and customize.

I’ve been thinking about it, and I think maybe something similar to other doc systems could work, like:

'] param:: paramOne No letters here.
'] param:: paramTwo It floats. 
']
'] return:: Pure *magic.

The template would then deal with how those get displayed. (I left out the parameter types, thinking that info can be extracted from the real parameter list automatically)

(and no extra XJD tag needed)

It’s something I created (most likely influenced subconsciously by other things I had seen). That was back in 2003 (can it really be that long?)

Thank you.

I just realized I did this already for MMD tables in other places, just not down in methods - I should fix that too…

[quote=64952:@Tim Jones]Since I’m a C / C++ programmer for the bulk of my coding efforts, I use the “//[SPACE]” comment option. Could you update the project to support “// [” as the delimiter as well?
[/quote]

For the next version, I have made it more flexible - you can start with either ’ or // and have spacing in between, for example anything like these:

']
' ]
//]
// ]
//              ]

(OK, maybe the last one is extreme…)

Windows Installer coming soon :slight_smile:

[quote=69851:@Paul Messias]For the next version, I have made it more flexible - you can start with either ’ or // and have spacing in between, for example anything like these:

']
' ]
//]
// ]
//              ]

(OK, maybe the last one is extreme…)[/quote]
WARNING:

Xojo trim pastes: if you paste "// ", Xojo just writes “//” in the IDE (without the quotes, of course).

I’m hoping to have Windows and Linux builds in the next release (soon) - basic functionality seems ok, but they may be more rough around the edges than the Mac version…

Version 2.0a2 is now ready.

Highlights:

  • parameter and return value marking
  • more flexible comment marking
  • Windows and Linux versions

http://www.parkbenchsoftware.com/xjDocs/

Downloaded.
Will test as soon as I have a bit of time.
Thank you.

Looks good.
Would really like to see a fully user configurable magic comment marker.
My own document generator uses ‘///’ :slight_smile:
And “NO!” it will never be released into the wild - it’s way too personalised to my way of doing things :stuck_out_tongue:
Besides which it’s largely written in SED and AWK, with a bit of Perl thrown in for good measure.

I went back and forth with the idea of making it configurable, and at one point it was. What concerned me, and maybe I was over thinking it, was that if multiple people were sharing code, and all used their own marker, then documenting the shared code wouldn’t work. But would you be documenting other people’s code? If you were, couldn’t you agree on a marker? But what if you already had a lot of your own code marked your way? What if you used some of the same code, shared with different people who all used different markers? (See what I mean by over thinking?)

Sure :slight_smile:
I have seen teams use three documentation ‘markers’; Personal, Team and Project. Only the Project marker was intended for resolving by an automated documentation system. Of course people would forget to change markers, or use the wrong one. But that is no worse than checking in multiple fixes in one shot, or forgetting to comment check-ins at all!

But seriously, if a custom marker is desirable, I will consider it (with the setting being on a project by project basis).

The question is, would people want to override the existing options and use only their own custom marker, or use the built in ones in addition to a custom one?

Custom marker/s in addition to the built-in set.

Thanks for this application Paul, it’s helped me out a great deal. Not sure if this is already known, but if xjd_Info is contained within a Folder it does not get parsed and does not work as expected.

Great app!

[quote=70446:@Paul Messias]But seriously, if a custom marker is desirable, I will consider it (with the setting being on a project by project basis).

The question is, would people want to override the existing options and use only their own custom marker, or use the built in ones in addition to a custom one?[/quote]

Check all markers used in the project ?
Will this be so much code / trouble ?

I believe that was intentional - so that there was only one, and we knew exactly where it was. If that causes issues, we can rethink the decision.