Pascal source code text to wiki text parser - LauraRozier/kam_remake GitHub Wiki
##How to format your code to work with this tool
The tool requires three specific lines to be present in the code to function.
Take note that the tool will ignore wrongly formatted code, as you will see in the example.
The requirements are as follows:
- The first line should start with:
//* Version:
Note: Must be exact match, no spaces in front of the definition. - Then you can add multiple lines to describe the procedure/function as long as it starts with:
//*
Note: Must be exact match, no spaces in front of the definition, must end on a space. - Then you need to start with either one of these:
procedure [ClassName].[ProcedureName]<([Parameters])>;
or
function [ClassName].[FunctionName]<([Parameters])>: [Result type];
Note: Must be exact match, no spaces in front of the definition, parameters are optional.
Here is an example of how it should be done:
//* Version: 24
//* Does some really awesome stuff.
//* It even supports multi-line descriptions. :D
// hello
//*tester
// Tester //* di test
procedure TForm1.Sample1(aString: String; aInt: Integer);
var
// Snip
begin
// Snip
end;
//* Version: 4
//* Another sample.
procedure TForm1.Sample2;
var
// Snip
begin
// Snip
end;
//* Version: 1
//* Yet another sample.
//* It returns a string.
function TForm1.Sample3: String;
var
// Snip
begin
// Snip
end;
The result of this will be:
| Version | Name | Description | Parameters and types | Returns |
| ------- | ---- | ----------- | -------------------- | ------- |
| 24 | Sample1 | Does some really awesome stuff. It even supports multi-line descriptions. :D | `aString: String; aInt: Integer` | |
| 4 | Sample2 | Another sample. | | |
| 1 | Sample3 | Yet another sample. It returns a string. | | `String` |
And look like this:
Version | Name | Description | Parameters and types | Returns |
---|---|---|---|---|
24 | Sample1 | Does some really awesome stuff. It even supports multi-line descriptions. :D | aString: String; aInt: Integer |
|
4 | Sample2 | Another sample. | ||
1 | Sample3 | Yet another sample. It returns a string. | String |
An image if how the GUI will look like after scanning a file (the text box is set to read-only):