Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.12.0-b1
    • Component/s: None
    • Labels:
      None

      Description

      Extension files should be generated based on templates. These templates should be formatted such that:

      1. Optional files can be included/excluded on an individual basis
      2. Tag replacement can be used to insert a value such as a module class name
      3. Commented code blocks can be included/excluded

      A class should be created ExtensionTemplateParser

      With:

      /**
       * string $extension_type The type of extension for which to parse files
       * array $options A list of options for parsing the template file including:
       *
       *  - comment_code True to include commented out code examples
       *  - language_code The language code for which to create a language file
       *  - replacements A list of tag names and their replacements
       *  - optional_methods A list method names to include
       */
      __constructor($extension_type, array $options)
      
      setExtensionType
      setOptions
      setOutputDir
      parseAndOutput
      

      Commented code blocks will be marked with "////"

      Replacement tags will be in the format tagname

      Optional methods will be bookended by tags in the format

      {method_name}

        Activity

        Hide
        jonathan Jonathan Reissmueller added a comment -

        The parser ended up being different then noted here and will eventually have documentation. These are the rules so far:

        • //// - When placed at the beginning of a line will mark it as part of a code example comment block
        • tagname - Marks a tag with a scalar value
        • array:tagname}}content{{array:tagname - Marks an array tag and will duplicate the content for each item in the array (including newlines)
        • tagname.array_key - Usable within an array tag to output one of the array's values (e.g. array:people}}My name is {{people.fullnamearray:people)
        • if:tagname:value}}true content{{else}}false content{{if:tagname - Outputs content based on whether the replacement value equals the value from the tag
        • function:functionname}}The whole php text of a function{{function:functionname - Checked against the list of optional functions and removed if set to do so
        Show
        jonathan Jonathan Reissmueller added a comment - The parser ended up being different then noted here and will eventually have documentation. These are the rules so far: //// - When placed at the beginning of a line will mark it as part of a code example comment block tagname - Marks a tag with a scalar value array:tagname}}content{{array:tagname - Marks an array tag and will duplicate the content for each item in the array (including newlines) tagname.array_key - Usable within an array tag to output one of the array's values (e.g. array:people}}My name is {{people.fullname array:people ) if:tagname:value}}true content{{else}}false content{{if:tagname - Outputs content based on whether the replacement value equals the value from the tag function:functionname}}The whole php text of a function{{function:functionname - Checked against the list of optional functions and removed if set to do so

          People

          • Assignee:
            jonathan Jonathan Reissmueller
            Reporter:
            jonathan Jonathan Reissmueller
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Fix Release Date:
              17/Sep/20

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 1 day, 1 hour, 31 minutes
              1d 1h 31m

                Agile