So I made a documentation generator for Clockwork. I already looked into existing ones, but they just weren’t practical for what I’m after, so I wrote my own. It scans the entire Clockwork project for specific tags within comment blocks, and then generates a JSON array of documented functions, hooks, libraries and classes.

I’m currently working on a website which uses the generated JSON array to provide a neat interface for viewing the Clockwork documentation. Users will be able to post both comments and examples for each object, and other users can upvote the best ones to the top of the page.

--[[
	© 2011 CloudSixteen.com do not share, re-distribute or modify
	without permission of its author ([email protected]).
--]]

--[[
	@codebase Server
	@details Provides an interface to the hints system.
	@field stored A table containting a list of stored hints.
--]]
Clockwork.hint = Clockwork:NewLibrary("Hint");
Clockwork.hint.stored = {};

--[[
	@codebase Server
	@details Add a new hint to the list.
	@param String A unique identifier.
	@param String The body of the hint.
	@param Function A callback with the player as an argument, return false to hide.
--]]
function Clockwork.hint:Add(name, text, Callback)
	self.stored[name] = {
		Callback = Callback,
		text = text
	};
end;

--[[
	@codebase Server
	@details Remove an existing hint from the list.
	@param String A unique identifier.
--]]
function Clockwork.hint:Remove(name)
	self.stored[name] = nil;
end;

--[[
	@codebase Server
	@details Find a hint by its identifier.
	@param String A unique identifier.
	@returns Table The hint table matching the identifier.
--]]
function Clockwork.hint:Find(name)
	return self.stored[name];
end;