Commit 5a75e3b6 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Generate doc in Wiki table format

parent eea51dfd
......@@ -104,6 +104,7 @@ package body TASTE.Backend.Code_Generators is
Create (File => Output_File,
Mode => Out_File,
Name => Model.Configuration.Output_Dir.Element & "/Makefile");
Document_Template (Template_Main_Makefile, Content_Set);
Put_Line (Output_File, Parse (Tmplt, Content_Set));
Close (Output_File);
end Generate_Global_Makefile;
......@@ -116,6 +117,7 @@ package body TASTE.Backend.Code_Generators is
Tmplt_Sign : constant String := Path & "interface.tmplt";
begin
for Each of Interfaces loop
Document_Template (Template_Skeleton_Interface, Each);
Result := Result & String'(Parse (Tmplt_Sign, Each));
end loop;
return Result;
......@@ -135,6 +137,7 @@ package body TASTE.Backend.Code_Generators is
CP_File_Dash : Unbounded_String;
begin
Document_Template (Template_Context_Parameters, CP_Tmpl);
-- To keep backward compatibility, file name uses dash
for C of CP_File loop
CP_File_Dash := CP_File_Dash & (if C = '_' then '-' else C);
......@@ -200,6 +203,7 @@ package body TASTE.Backend.Code_Generators is
Output_Dir : constant String := Output_Lang & Output_Sub;
begin
Document_Template (Template_Skeleton_Makefile, Make_Tmpl);
-- Create directory tree (output/function/language/src)
Create_Path (Output_Dir);
if File_Name /= "" then
......@@ -328,6 +332,12 @@ package body TASTE.Backend.Code_Generators is
and then Strip_String (Parse
(Path & "/trigger.tmplt", Trig_Tmpl)) = "TRUE");
begin
Document_Template (Template_Skeleton_Function_Filename,
File_Tmpl);
Document_Template (Template_Skeleton_Makefile_Filename,
File_Tmpl);
Document_Template (Template_Skeleton_And_Glue_Trigger,
Trig_Tmpl);
if Trigger then
-- Output code and Makefile from this template folder
Process_Template (F => Each,
......
......@@ -64,11 +64,19 @@ package body TASTE.Parser_Utils is
procedure Document_Template (Category : Template_Category;
Tags : Translate_Set)
is
Result : Unbounded_String := "# Tags for " & US (Category'Img);
Result : Unbounded_String :=
"{| class=""wikitable""" & ASCII.LF
& "!Parameter name" & ASCII.LF
& "!Description" & ASCII.LF
& US ("|-");
procedure Action (Item : Association; Quit : in out Boolean) is
begin
Result :=
Result & ASCII.LF & US (Templates_Parser.Query.Variable (Item));
Result & ASCII.LF
& "|" & US (Templates_Parser.Query.Variable (Item)) & ASCII.LF
& "|@@ADD DESCRIPTION@@" & ASCII.LF
& "|-";
-- & Templates_Parser.Query.Kind (Item)'Img);
Quit := False;
end Action;
......@@ -81,6 +89,9 @@ package body TASTE.Parser_Utils is
end if;
Put_Debug ("Documenting template category: " & Category'Img);
Iterate (Tags);
Result :=
Result & ASCII.LF
& "|}";
Doc_Map.Insert (Key => Category, New_Item => To_String (Result));
end Document_Template;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment