Update styling
This commit is contained in:
parent
da63b5cc67
commit
24bdb39d40
|
|
@ -38,6 +38,9 @@ procedure Aqs2mdx is
|
||||||
Wikibook : constant League.Strings.Universal_String :=
|
Wikibook : constant League.Strings.Universal_String :=
|
||||||
+"https://en.wikibooks.org/wiki/";
|
+"https://en.wikibooks.org/wiki/";
|
||||||
|
|
||||||
|
ClassName : constant League.Strings.Universal_String :=
|
||||||
|
+"className";
|
||||||
|
|
||||||
---------------
|
---------------
|
||||||
-- Read_JSON --
|
-- Read_JSON --
|
||||||
---------------
|
---------------
|
||||||
|
|
@ -142,10 +145,10 @@ procedure Aqs2mdx is
|
||||||
Columns_Div : Pandoc.Content_Arr (1 .. Cell_List.Length);
|
Columns_Div : Pandoc.Content_Arr (1 .. Cell_List.Length);
|
||||||
|
|
||||||
Outer_Attr : constant League.JSON.Values.JSON_Value :=
|
Outer_Attr : constant League.JSON.Values.JSON_Value :=
|
||||||
Pandoc.Attr (+"className", +"multi-column");
|
Pandoc.Attr (ClassName, +"multi-column");
|
||||||
|
|
||||||
Inner_Attr : constant League.JSON.Values.JSON_Value :=
|
Inner_Attr : constant League.JSON.Values.JSON_Value :=
|
||||||
Pandoc.Attr (+"className", +"multi-column-child");
|
Pandoc.Attr (ClassName, +"multi-column-child");
|
||||||
|
|
||||||
begin
|
begin
|
||||||
pragma Assert (Content.Length = 6);
|
pragma Assert (Content.Length = 6);
|
||||||
|
|
@ -209,7 +212,9 @@ procedure Aqs2mdx is
|
||||||
return List;
|
return List;
|
||||||
end Traverse_Block;
|
end Traverse_Block;
|
||||||
|
|
||||||
function Fix_Wikilink (Target : League.Strings.Universal_String) return League.Strings.Universal_String is
|
function Fix_Wikilink (Target : League.Strings.Universal_String) return
|
||||||
|
League.Strings.Universal_String
|
||||||
|
is
|
||||||
begin
|
begin
|
||||||
if Target.Starts_With ("w:") then
|
if Target.Starts_With ("w:") then
|
||||||
return Wiki & Target.Tail_From (3);
|
return Wiki & Target.Tail_From (3);
|
||||||
|
|
@ -218,28 +223,43 @@ procedure Aqs2mdx is
|
||||||
end if;
|
end if;
|
||||||
end Fix_Wikilink;
|
end Fix_Wikilink;
|
||||||
|
|
||||||
function Is_Direct_URL ( Link_Content : League.JSON.Arrays.JSON_Array ) return Boolean is
|
function Is_Direct_URL (Content : League.JSON.Arrays.JSON_Array) return
|
||||||
Alt_List : League.JSON.Arrays.JSON_Array := Link_Content (2).To_Array;
|
Boolean
|
||||||
Target_Tuple : League.JSON.Arrays.JSON_Array := Link_Content (3).To_Array;
|
is
|
||||||
Target : League.Strings.Universal_String := Target_Tuple (1).To_String;
|
Alt_List : constant League.JSON.Arrays.JSON_Array :=
|
||||||
|
Content (2).To_Array;
|
||||||
|
Target_Tuple : constant League.JSON.Arrays.JSON_Array :=
|
||||||
|
Content (3).To_Array;
|
||||||
|
Target : constant League.Strings.Universal_String :=
|
||||||
|
Target_Tuple (1).To_String;
|
||||||
begin
|
begin
|
||||||
if Alt_List.Length /= 1 then
|
if Alt_List.Length /= 1 then
|
||||||
return False;
|
return False;
|
||||||
else
|
else
|
||||||
declare
|
declare
|
||||||
Alt_Text_Object : League.JSON.Objects.JSON_Object := Alt_List (1).To_Object;
|
Alt_Text_Object : constant League.JSON.Objects.JSON_Object :=
|
||||||
Alt_Text : League.Strings.Universal_String := Alt_Text_Object(Pandoc.Content_String).To_String;
|
Alt_List (1).To_Object;
|
||||||
|
Alt_Text : constant League.Strings.Universal_String :=
|
||||||
|
Alt_Text_Object (Pandoc.Content_String).To_String;
|
||||||
begin
|
begin
|
||||||
return Alt_Text = Target;
|
return Alt_Text = Target;
|
||||||
end;
|
end;
|
||||||
end if;
|
end if;
|
||||||
end Is_Direct_URL;
|
end Is_Direct_URL;
|
||||||
|
|
||||||
function Create_String ( Data : League.Strings.Universal_String ) return League.JSON.Values.JSON_Value is
|
function Create_String (Data : League.Strings.Universal_String) return
|
||||||
Block : League.JSon.Objects.JSON_Object;
|
League.JSON.Values.JSON_Value
|
||||||
|
is
|
||||||
|
Block : League.JSON.Objects.JSON_Object;
|
||||||
begin
|
begin
|
||||||
Block.Insert (Pandoc.Type_String, League.JSON.Values.To_JSON_Value (+"Str"));
|
Block.Insert (
|
||||||
Block.Insert (Pandoc.Content_String, League.JSON.Values.To_JSON_Value (Data));
|
Pandoc.Type_String,
|
||||||
|
League.JSON.Values.To_JSON_Value (Pandoc.To_String (Inline_String))
|
||||||
|
);
|
||||||
|
Block.Insert (
|
||||||
|
Pandoc.Content_String,
|
||||||
|
League.JSON.Values.To_JSON_Value (Data)
|
||||||
|
);
|
||||||
|
|
||||||
return Block.To_JSON_Value;
|
return Block.To_JSON_Value;
|
||||||
end Create_String;
|
end Create_String;
|
||||||
|
|
@ -254,8 +274,8 @@ procedure Aqs2mdx is
|
||||||
Copy : League.JSON.Objects.JSON_Object := Block;
|
Copy : League.JSON.Objects.JSON_Object := Block;
|
||||||
Args : League.JSON.Arrays.JSON_Array := Copy (+"c").To_Array;
|
Args : League.JSON.Arrays.JSON_Array := Copy (+"c").To_Array;
|
||||||
Link : League.JSON.Arrays.JSON_Array := Args (3).To_Array;
|
Link : League.JSON.Arrays.JSON_Array := Args (3).To_Array;
|
||||||
Target : League.Strings.Universal_String := Link (1).To_String;
|
Target : constant League.Strings.Universal_String := Link (1).To_String;
|
||||||
Title : League.Strings.Universal_String := Link (2).To_String;
|
Title : constant League.Strings.Universal_String := Link (2).To_String;
|
||||||
begin
|
begin
|
||||||
|
|
||||||
if Title = +"wikilink" then
|
if Title = +"wikilink" then
|
||||||
|
|
|
||||||
|
|
@ -98,6 +98,9 @@ package body Pandoc is
|
||||||
function Get_Type (B : League.JSON.Objects.JSON_Object)
|
function Get_Type (B : League.JSON.Objects.JSON_Object)
|
||||||
return Object_Type is (Type_Mapping (B (Type_String).To_String));
|
return Object_Type is (Type_Mapping (B (Type_String).To_String));
|
||||||
|
|
||||||
|
function To_String (T : Object_Type) return League.Strings.Universal_String
|
||||||
|
is (Obj_String_Representation (T));
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
|
||||||
for Key in Object_Type loop
|
for Key in Object_Type loop
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,8 @@ package Pandoc is
|
||||||
|
|
||||||
function Get_Type (B : League.JSON.Objects.JSON_Object) return Object_Type;
|
function Get_Type (B : League.JSON.Objects.JSON_Object) return Object_Type;
|
||||||
|
|
||||||
|
function To_String (T : Object_Type) return League.Strings.Universal_String;
|
||||||
|
|
||||||
function "+" (T : Wide_Wide_String) return League.Strings.Universal_String
|
function "+" (T : Wide_Wide_String) return League.Strings.Universal_String
|
||||||
renames League.Strings.To_Universal_String;
|
renames League.Strings.To_Universal_String;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user