TABLE OF CONTENTS
- 1. Yass/Config
- 1.1. Config/Config.Excluded_Container
- 1.2. Config/Config.Parser_Config
- 1.3. Config/Config.TableTags_Container
- 1.4. Config/Config.Tags_Container
- 1.5. Config/Config.Default_Parser_Configuration
- 1.6. Config/Config.Global_Table_Tags
- 1.7. Config/Config.Site_Directory
- 1.8. Config/Config.Site_Tags
- 1.9. Config/Config.Yass_Config
- 1.10. Config/Config.Invalid_Config_Data
- 1.11. Config/Config.Create_Config
- 1.12. Config/Config.Create_Interactive_Config
- 1.13. Config/Config.Parse_Config
Yass/Config [ Packages ]
FUNCTION
Provide code for manipulate config file
SOURCE
package Config is
Config/Config.Excluded_Container [ Types ]
FUNCTION
Used to store list of excluded files
SOURCE
package Excluded_Container is new Ada.Containers.Indefinite_Vectors (Index_Type => Positive, Element_Type => String);
Config/Config.Parser_Config [ Types ]
FUNCTION
Data structure for setting for parser
SOURCE
type Parser_Config is record Output_Directory: Unbounded_String := To_Unbounded_String(Source => "_output"); Layouts_Directory: Unbounded_String := To_Unbounded_String(Source => "_layouts"); Modules_Directory: Unbounded_String := To_Unbounded_String(Source => "_modules"); Excluded_Files: Excluded_Container.Vector; Server_Enabled: Boolean := True; Server_Port: Positive := 8_888; Monitor_Interval: Duration := 5.0; Base_Url: Unbounded_String := To_Unbounded_String(Source => "http://localhost:8888"); Sitemap_Enabled: Boolean := True; Atom_Feed_Source: Unbounded_String := To_Unbounded_String(Source => "none"); Site_Name: Unbounded_String := To_Unbounded_String(Source => "New Site"); Atom_Feed_Amount: Positive := 25; Markdown_Comment: Unbounded_String := To_Unbounded_String(Source => "--"); Stop_Server_On_Error: Boolean := False; Browser_Command: Unbounded_String := To_Unbounded_String(Source => "none"); Monitor_Config_Interval: Duration := 60.0; Author_Name: Unbounded_String := To_Unbounded_String(Source => "John Doe"); Author_Email: Unbounded_String := To_Unbounded_String(Source => "johndoe@example.com"); Language: Unbounded_String := To_Unbounded_String(Source => "en"); end record;
PARAMETERS
Output_Directory - Path to directory with generated site Layouts_Directory - Path to directory where site layouts are Modules_Directory - Path to directory where program modules for this site are Excluded_Files - List of excluded files (and directories) from site Server_Enabled - Did web server is enabled Server_Port - Port on which web server listen Monitor_Interval - Interval (in seconds) how often program should check for changes in site to regenerate it Base_Url - Base URL for site, needed mostly for creating sitemap Sitemap_Enabled - Did creating sitemap is enabled Atom_Feed_Source - Source of atom feed entries. Possible values are: none (don't create atom feed, default), tags (create entries from tags in markdown files) and [filename] (path to markdown file which will be used as a source of feed) Site_Name - Name of the site, needed for atom feed Atom_Feed_Amount - Number of entries in the Atom feed of the site Markdown_Comment - String used to mark comments in markdown files Stop_Server_On_Error - Did sever should go down if encounter error during creating site Browser_Command - Command used to open web browser (if empty, don't open anything) Monitor_Config_Interval - Interval (in seconds) how often program should check for changes in site configuration to reconfigure it Author_Name - Name of author of the site, needed for atom feed Author_Email - Email address of author of the site, needed for atom feed Language - ISO code of the language of the site
Config/Config.TableTags_Container [ Types ]
FUNCTION
Used to store AWS template table tags
SOURCE
package TableTags_Container is new Ada.Containers.Indefinite_Hashed_Maps (Key_Type => String, Element_Type => Vector_Tag, Hash => Ada.Strings.Hash, Equivalent_Keys => "=");
Config/Config.Tags_Container [ Types ]
FUNCTION
Used to store AWS template tags
SOURCE
package Tags_Container is new Ada.Containers.Indefinite_Hashed_Maps (Key_Type => String, Element_Type => String, Hash => Ada.Strings.Hash, Equivalent_Keys => "=");
Config/Config.Default_Parser_Configuration [ Constants ]
[ Top ] [ Config ] [ Constants ]
FUNCTION
Default parser configuration values
SOURCE
Default_Parser_Configuration: constant Parser_Config := (others => <>);
Config/Config.Global_Table_Tags [ Variables ]
[ Top ] [ Config ] [ Variables ]
FUNCTION
Global table tags, used in @@TABLE@@ statement
SOURCE
Global_Table_Tags: TableTags_Container.Map;
Config/Config.Site_Directory [ Variables ]
[ Top ] [ Config ] [ Variables ]
FUNCTION
Directory where site files are
SOURCE
Site_Directory: Unbounded_String;
Config/Config.Site_Tags [ Variables ]
[ Top ] [ Config ] [ Variables ]
FUNCTION
Site tags (like title, author, etc)
SOURCE
Site_Tags: Tags_Container.Map;
Config/Config.Yass_Config [ Variables ]
[ Top ] [ Config ] [ Variables ]
FUNCTION
Settings for the program
SOURCE
Yass_Config: Parser_Config := Default_Parser_Configuration;
Config/Config.Invalid_Config_Data [ Exceptions ]
[ Top ] [ Config ] [ Exceptions ]
FUNCTION
Raised when invalid data found in site config file
SOURCE
Invalid_Config_Data: exception;
Config/Config.Create_Config [ Subprograms ]
[ Top ] [ Config ] [ Subprograms ]
FUNCTION
Create default config in directory with full path Directory_Name
SOURCE
procedure Create_Config(Directory_Name: String) with Pre => Directory_Name'Length > 0, Test_Case => (Name => "Test_Create_Config", Mode => Nominal);
PARAMETERS
Directory_Name - Full path to the directory where config file will be created
Config/Config.Create_Interactive_Config [ Subprograms ]
[ Top ] [ Config ] [ Subprograms ]
FUNCTION
Create configuration file based on the user answers to the program questions
SOURCE
procedure Create_Interactive_Config(Directory_Name: String) with Pre => Directory_Name'Length > 0;
PARAMETERS
Directory_Name - Full path to the directory where config file will be created
Config/Config.Parse_Config [ Subprograms ]
[ Top ] [ Config ] [ Subprograms ]
FUNCTION
Parse config file and set all settings and tags for site in directory with full path Directory_Name
SOURCE
procedure Parse_Config(Directory_Name: String) with Pre => Directory_Name'Length > 0, Test_Case => (Name => "Test_Parse_Config", Mode => Nominal);
PARAMETERS
Directory_Name - Full path to the directory from which config file will be parsed