Loading ...
Sorry, an error occurred while loading the content.

[Cheetahtemplate-discuss] Loss of newline when using directiveStartToken and commentStartToken

Expand Messages
  • Jonathan Giddy
    Hi, I am a user of Bcfg2, using their support for Cheetah templating. In this context, I am using Cheetah within Unix shell-style files, where # is the comment
    Message 1 of 3 , Aug 3, 2009
    • 0 Attachment
      Hi, I am a user of Bcfg2, using their support for Cheetah templating. In
      this context, I am using Cheetah within Unix shell-style files, where #
      is the comment marker. As such I attempt to "rename" the Cheetah
      directive and comment markers.

      I am finding that whitespace goes missing after "blank" comment lines.
      Instead of being passed through as literals, the text "# \n" becomes "",
      and "## \n" becomes "#". Any spaces before the newline are also
      swallowed up.

      I was originally using Cheetah 2.0.1 on CentOS 5.3, but this problem
      occurs in 2.2.1 on Ubuntu 8.04 as well. As an example, my template is:
      ## '#' and '##' have special meaning to Cheetah, rename them to '@' and '@@'
      #compiler-settings
      directiveStartToken = @
      directiveEndToken = @
      commentStartToken = @@
      #end compiler-settings
      @@ Actual file starts on next line
      ## Here is a comment followed by a blank comment line
      ##
      echo 1
      ## The echo command should not be commented out
      ##
      ## Do I have 2 or 3 # marks?
      #
      # Can you see a blank comment line above?

      Running "cheetah compile template" gives a template whose output is:
      ## Here is a comment followed by a blank comment line
      #echo 1
      ## The echo command should not be commented out
      ### Do I have 2 or 3 # marks?
      # Can you see a blank comment line above?



      ------------------------------------------------------------------------------
      Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
      trial. Simplify your report design, integration and deployment - and focus on
      what you do best, core application coding. Discover what's new with
      Crystal Reports now. http://p.sf.net/sfu/bobj-july
      _______________________________________________
      Cheetahtemplate-discuss mailing list
      Cheetahtemplate-discuss@...
      https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
    • Jonathan Giddy
      ... I have discovered the existence of the compiler setting EOLSlurpToken. Adding EOLSlurpToken = None to the compiler settings fixed the problem. I just
      Message 2 of 3 , Aug 3, 2009
      • 0 Attachment
        > I am finding that whitespace goes missing after "blank" comment lines.
        > Instead of being passed through as literals, the text "# \n" becomes "",
        > and "## \n" becomes "#". Any spaces before the newline are also
        > swallowed up.
        >
        I have discovered the existence of the compiler setting EOLSlurpToken.
        Adding
        EOLSlurpToken = None
        to the compiler settings fixed the problem. I just didn't realise that
        the docs on the website were for pre-2.0.

        Thanks,
        Jon.

        ------------------------------------------------------------------------------
        Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
        trial. Simplify your report design, integration and deployment - and focus on
        what you do best, core application coding. Discover what's new with
        Crystal Reports now. http://p.sf.net/sfu/bobj-july
        _______________________________________________
        Cheetahtemplate-discuss mailing list
        Cheetahtemplate-discuss@...
        https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
      • R. Tyler Ballance
        ... Yeah, the documentation on the website is a little behind the times to say the least. I ve been slowly working on Sphinx-based documentation, but Cheetah
        Message 3 of 3 , Aug 4, 2009
        • 0 Attachment
          On Tue, 04 Aug 2009, Jonathan Giddy wrote:

          >
          > > I am finding that whitespace goes missing after "blank" comment lines.
          > > Instead of being passed through as literals, the text "# \n" becomes "",
          > > and "## \n" becomes "#". Any spaces before the newline are also
          > > swallowed up.
          > >
          > I have discovered the existence of the compiler setting EOLSlurpToken.
          > Adding
          > EOLSlurpToken = None
          > to the compiler settings fixed the problem. I just didn't realise that
          > the docs on the website were for pre-2.0.


          Yeah, the documentation on the website is a little behind the times to
          say the least. I've been slowly working on Sphinx-based documentation,
          but Cheetah certainly has a wide number of options and configurations to
          document ;)

          Glad you found what you needed :)


          >
          > Thanks,
          > Jon.
          >
          > ------------------------------------------------------------------------------
          > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
          > trial. Simplify your report design, integration and deployment - and focus on
          > what you do best, core application coding. Discover what's new with
          > Crystal Reports now. http://p.sf.net/sfu/bobj-july
          > _______________________________________________
          > Cheetahtemplate-discuss mailing list
          > Cheetahtemplate-discuss@...
          > https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
          -R. Tyler Ballance
          Slide, Inc.
        Your message has been successfully submitted and would be delivered to recipients shortly.