From ab0956c15008b77ae72c6e60615d5655d9236fcf Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Sun, 23 Aug 2015 13:50:43 -0700 Subject: [PATCH] change default file-extension escape char to underscore --- scribblings/formats.scrbl | 4 ++-- scribblings/world.scrbl | 2 +- world.rkt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scribblings/formats.scrbl b/scribblings/formats.scrbl index 4473208..f06bc39 100644 --- a/scribblings/formats.scrbl +++ b/scribblings/formats.scrbl @@ -163,9 +163,9 @@ This can be useful you're managing your project with git. Most likely you'll wan Pollen relies extensively on the convention of naming source files by adding a source extension to an output-file name. So the Pollen markup source for @filepath{index.html} would be @filepath{index.html.pm}. -This convention occasionally flummoxes other programs that assume a file can only have one extension. If you run into such a situation, you can @italic{escape} the output-file extension using the @racket[world:extension-escape-char], which defaults to @litchar{!}. +This convention occasionally flummoxes other programs that assume a file can only have one extension. If you run into such a situation, you can @italic{escape} the output-file extension using the @racket[world:extension-escape-char], which defaults to the underscore @litchar{_}. -So instead of @filepath{index.html.pm}, your source-file name would be @filepath{index!html.pm}. When this source file is rendered, it will automatically be converted into @filepath{index.html} (meaning, the escaped extension will be converted into a normal file extension). +So instead of @filepath{index.html.pm}, your source-file name would be @filepath{index_html.pm}. When this source file is rendered, it will automatically be converted into @filepath{index.html} (meaning, the escaped extension will be converted into a normal file extension). This alternative-naming scheme is automatically enabled in every project. You can also set the escape character on a per-project basis (see @racket[world:current-extension-escape-char]). Pollen will let you choose any character, but of course it would be unwise to pick one with special meaning in your filesystem (for instance, @litchar{/}). diff --git a/scribblings/world.scrbl b/scribblings/world.scrbl index 1daeb20..823ee94 100644 --- a/scribblings/world.scrbl +++ b/scribblings/world.scrbl @@ -65,7 +65,7 @@ Determines the default HTTP port for the project server. Initialized to @racket[ @defoverridable[server-extras-dir string?]{Name of directory where server support files live. Initialized to @tt{server-extras}.} -@defoverridable[extension-escape-char char?]{Character for escaping output-file extensions within source-file names. Initialized to @racket[#\!].} +@defoverridable[extension-escape-char char?]{Character for escaping output-file extensions within source-file names. Initialized to @racket[#\_].} diff --git a/world.rkt b/world.rkt index 91b7c90..fd8a332 100644 --- a/world.rkt +++ b/world.rkt @@ -82,7 +82,7 @@ (define-settable publish-directory-name "publish") -(define-settable extension-escape-char #\!) +(define-settable extension-escape-char #\_) (define-settable compile-cache-active #t) (define-settable compile-cache-max-size (* 10 1024 1024)) ; = 10 megabytes