]> granicus.if.org Git - cgit/commitdiff
Merge branch 'lh/embedded'
authorLars Hjemli <hjemli@gmail.com>
Sat, 25 Jul 2009 10:29:22 +0000 (12:29 +0200)
committerLars Hjemli <hjemli@gmail.com>
Sat, 25 Jul 2009 10:29:22 +0000 (12:29 +0200)
Conflicts:
cgitrc.5.txt
ui-shared.c

1  2 
cgit.c
cgit.h
cgitrc.5.txt
ui-shared.c

diff --cc cgit.c
Simple merge
diff --cc cgit.h
Simple merge
diff --cc cgitrc.5.txt
index 683f3b54853cd398c2159886ebc51dab22eb92a3,771bb7dfcfd5b3783c40c302344d8998ef337a6e..a207fe07aadb9eb2863b1c47165e804772a12e5b
@@@ -59,7 -59,12 +59,12 @@@ css:
        Url which specifies the css document to include in all cgit pages.
        Default value: "/cgit.css".
  
 -embedded
++embedded::
+       Flag which, when set to "1", will make cgit generate a html fragment
+       suitable for embedding in other html pages. Default value: none. See
+       also: "noheader".
+       
 -enable-index-links
 +enable-index-links::
        Flag which, when set to "1", will make cgit generate extra links for
        each repo in the repository index (specifically, to the "summary",
        "commit" and "tree" pages). Default value: "0".
@@@ -153,7 -154,11 +158,11 @@@ nocache:
        deprecated, and will not be honored starting with cgit-1.0. Default
        value: "0".
  
 -noheader
++noheader::
+       Flag which, when set to "1", will make cgit omit the standard header
+       on all pages. Default value: none. See also: "embedded".
 -renamelimit
 +renamelimit::
        Maximum number of files to consider when detecting renames. The value
         "-1" uses the compiletime value in git (for further info, look at
          `man git-diff`). Default value: "-1".
diff --cc ui-shared.c
index 66d5b8220de122d69a8398119592f09114c83731,5e03a7a52ef7697f039b684f2fc1779fecbb9270..015c52b6c044f2a280ca7259c68c6d6f5040711b
@@@ -467,10 -456,9 +467,13 @@@ void cgit_print_age(time_t t, time_t ma
  
  void cgit_print_http_headers(struct cgit_context *ctx)
  {
 +      const char *method = getenv("REQUEST_METHOD");
 +
+       if (ctx->cfg.embedded)
+               return;
 +      if (ctx->page.status)
 +              htmlf("Status: %d %s\n", ctx->page.status, ctx->page.statusmsg);
        if (ctx->page.mimetype && ctx->page.charset)
                htmlf("Content-Type: %s; charset=%s\n", ctx->page.mimetype,
                      ctx->page.charset);