Browse Source

Made launching a project and exporting and Org file work without
errors, but it still not works out correctly, since the files are not served.

tj 8 years ago
parent
commit
1aa928e55b
2 changed files with 264 additions and 26 deletions
  1. 230 0
      docroot/bugpile-static-bugreport-guidelines.html
  2. 34 26
      iorg/lisp/iorg-controller.el

+ 230 - 0
docroot/bugpile-static-bugreport-guidelines.html

@@ -0,0 +1,230 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+	       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> 
+<head>
+<title>Bugpile - Guidelines for Bugreporting</title>
+
+<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"/>
+<meta name="title" content="Bugpile - Guidelines for Bugreporting"/>
+<meta name="generator" content="Org-mode"/>
+<meta name="generated" content="2012-07-01 21:26:03 CEST"/>
+<meta name="author" content="Thorsten Jolitz"/>
+<meta name="description" content="nil"/>
+<meta name="keywords" content="nil"/>
+<style type="text/css">
+ <!--/*--><![CDATA[/*><!--*/
+  html { font-family: Times, serif; font-size: 12pt; }
+  .title  { text-align: center; }
+  .todo   { color: red; }
+  .done   { color: green; }
+  .tag    { background-color: #add8e6; font-weight:normal }
+  .target { }
+  .timestamp { color: #bebebe; }
+  .timestamp-kwd { color: #5f9ea0; }
+  .right  {margin-left:auto; margin-right:0px;  text-align:right;}
+  .left   {margin-left:0px;  margin-right:auto; text-align:left;}
+  .center {margin-left:auto; margin-right:auto; text-align:center;}
+  p.verse { margin-left: 3% }
+  pre {
+	border: 1pt solid #AEBDCC;
+	background-color: #F3F5F7;
+	padding: 5pt;
+	font-family: courier, monospace;
+        font-size: 90%;
+        overflow:auto;
+  }
+  table { border-collapse: collapse; }
+  td, th { vertical-align: top;  }
+  th.right  { text-align:center;  }
+  th.left   { text-align:center;   }
+  th.center { text-align:center; }
+  td.right  { text-align:right;  }
+  td.left   { text-align:left;   }
+  td.center { text-align:center; }
+  dt { font-weight: bold; }
+  div.figure { padding: 0.5em; }
+  div.figure p { text-align: center; }
+  div.inlinetask {
+    padding:10px;
+    border:2px solid gray;
+    margin:10px;
+    background: #ffffcc;
+  }
+  textarea { overflow-x: auto; }
+  .linenr { font-size:smaller }
+  .code-highlighted {background-color:#ffff00;}
+  .org-info-js_info-navigation { border-style:none; }
+  #org-info-js_console-label { font-size:10px; font-weight:bold;
+                               white-space:nowrap; }
+  .org-info-js_search-highlight {background-color:#ffff00; color:#000000;
+                                 font-weight:bold; }
+  /*]]>*/-->
+</style><style type="text/css">#outline-container-introduction{ clear:both; }</style>
+<script type="text/javascript">
+<!--/*--><![CDATA[/*><!--*/
+ function CodeHighlightOn(elem, id)
+ {
+   var target = document.getElementById(id);
+   if(null != target) {
+     elem.cacheClassElem = elem.className;
+     elem.cacheClassTarget = target.className;
+     target.className = "code-highlighted";
+     elem.className   = "code-highlighted";
+   }
+ }
+ function CodeHighlightOff(elem, id)
+ {
+   var target = document.getElementById(id);
+   if(elem.cacheClassElem)
+     elem.className = elem.cacheClassElem;
+   if(elem.cacheClassTarget)
+     target.className = elem.cacheClassTarget;
+ }
+/*]]>*///-->
+</script><script type="text/javascript" src="http://orgmode.org/mathjax/MathJax.js">
+<!--/*--><![CDATA[/*><!--*/
+    MathJax.Hub.Config({
+        // Only one of the two following lines, depending on user settings
+        // First allows browser-native MathML display, second forces HTML/CSS
+        //  config: ["MMLorHTML.js"], jax: ["input/TeX"],
+            jax: ["input/TeX", "output/HTML-CSS"],
+        extensions: ["tex2jax.js","TeX/AMSmath.js","TeX/AMSsymbols.js",
+                     "TeX/noUndefined.js"],
+        tex2jax: {
+            inlineMath: [ ["\\(","\\)"] ],
+            displayMath: [ ['$$','$$'], ["\\[","\\]"], ["\\begin{displaymath}","\\end{displaymath}"] ],
+            skipTags: ["script","noscript","style","textarea","pre","code"],
+            ignoreClass: "tex2jax_ignore",
+            processEscapes: false,
+            processEnvironments: true,
+            preview: "TeX"
+        },
+        showProcessingMessages: true,
+        displayAlign: "center",
+        displayIndent: "2em",
+
+        "HTML-CSS": {
+             scale: 100,
+             availableFonts: ["STIX","TeX"],
+             preferredFont: "TeX",
+             webFont: "TeX",
+             imageFont: "TeX",
+             showMathMenu: true,
+        },
+        MMLorHTML: {
+             prefer: {
+                 MSIE:    "MML",
+                 Firefox: "MML",
+                 Opera:   "HTML",
+                 other:   "HTML"
+             }
+        }
+    });
+/*]]>*///-->
+</script>
+</head>
+<body><div id="org-div-home-and-up" style="text-align:right;font-size:70%;white-space:nowrap;">
+ <a accesskey="h" href="index.html"> UP </a>
+ |
+ <a accesskey="H" href="http://orgmode.org/worg/"> HOME </a>
+</div>
+<div id="content">
+<h1 class="title">Bugpile - Guidelines for Bugreporting</h1>
+<div id="table-of-contents">
+<h2>Table of Contents</h2>
+<div id="text-table-of-contents">
+<ul>
+<li><a href="#sec-1">About Bugtrackers</a>
+<ul>
+<li><a href="#sec-1-1">Why bugtrackers matter</a></li>
+<li><a href="#sec-1-2">Elements of a good bug report</a></li>
+</ul>
+</li>
+</ul>
+</div>
+</div>
+<p>
+<i>About Bugtrackers and good Bugreporting</i></p>
+
+<div id="outline-container-1" class="outline-2">
+<h2 id="sec-1">About Bugtrackers</h2>
+<div id="outline-container-1-1" class="outline-3">
+<h3 id="sec-1-1">Why bugtrackers matter</h3>
+<div class="outline-text-3" id="text-1-1">
+<p>
+The following quote from Joel Spolsky emphases the importance of
+bugtrackers for good software development:</p>
+
+<blockquote>
+<p>
+Do you have a bug database?</p>
+
+<p>
+I don't care what you say. If you are developing code, even on a team
+of one, without an organized database listing all known bugs in the
+code, you are going to ship low quality code. Lots of programmers
+think they can hold the bug list in their heads. Nonsense. I can't
+remember more than two or three bugs at a time, and the next morning,
+or in the rush of shipping, they are forgotten. You absolutely have to
+keep track of bugs formally.</p>
+
+<p>
+Bug databases can be complicated or simple. A minimal useful bug
+database must include the following data for every bug:</p>
+
+<ul>
+<li>complete steps to reproduce the bug
+</li>
+<li>expected behavior
+</li>
+<li>observed (buggy) behavior
+</li>
+<li>who it's assigned to
+</li>
+<li>whether it has been fixed or not
+</li>
+</ul>
+
+<p>
+If the complexity of bug tracking software is the only thing stopping
+you from tracking your bugs, just make a simple 5 column table with
+these crucial fields and start using it.</p>
+</blockquote>
+</div>
+</div>
+
+<div id="outline-container-1-2" class="outline-3">
+<h3 id="sec-1-2">Elements of a good bug report</h3>
+<div class="outline-text-3" id="text-1-2">
+<p>
+Again citing Joel Spolsky, here are the three fundamental elements
+of a good bug report:</p>
+
+<blockquote>
+<p>
+It's pretty easy to remember the rule for a good bug report. Every
+good bug report needs exactly three things.</p>
+
+<ol>
+<li>Steps to reproduce,
+</li>
+<li>What you expected to see, and
+</li>
+<li>What you saw instead.
+</li>
+</ol>
+</blockquote>
+</div>
+</div>
+</div>
+
+</div>
+<div id="postamble">
+<p class="date"> Date: 2012-07-01 21:26:03 CEST </p> 
+<p class="author"> Author : Thorsten Jolitz</p>
+<p class="creator"> Generated by Org mode 7.8.09 in Emacs 24.0.93.1. </p><a href="http://validator.w3.org/check?uri=referer">Validate XHTML 1.0</a>
+
+</div>
+</body>
+</html>

+ 34 - 26
iorg/lisp/iorg-controller.el

@@ -111,28 +111,35 @@ their counterparts in 'iorg-projects-config'"
 (defun iorg-controller--serve-docroot (project proj-config &rest args)
   "Make a webserver that serves the static files in projects's docroot.
 
-Use data from the alists PROJ-CONFIG or ARGS to configure the server."
+ Use data from the alists PROJ-CONFIG or ARGS to configure the server."
   ;; make sure all .org files in docroot have been exported to html
   ;; and the html files are up-to-date
   (let* ((docroot-dir
-         (iorg-projects--get-project-info project :docroot))
-        (docroot-files
-         (directory-files docroot-dir)))
+          (iorg-projects--get-project-info project :docroot))
+         (docroot-files
+          (directory-files docroot-dir)))
     (mapc
      (lambda (file)
        (and (string= (file-name-extension file) "org")
             (let ((absolute-file-name
                    (expand-file-name
                     file docroot-dir)))
-            (unless
-                (and 
-                 (member
-                  (concat
-                   (file-name-sans-extension file) ".html") docroot-files)
-                 (file-newer-than-file-p
-                  (concat (file-name-sans-extension file) ".html")
-                  (concat (file-name-sans-extension file) ".org")))
-              (org-export-to-file 'e-html absolute-file-name)))))
+              (unless
+                  (and 
+                   (member
+                    (concat
+                     (file-name-sans-extension file) ".html") docroot-files)
+                   (not (file-newer-than-file-p
+                    (concat (file-name-sans-extension file) ".org")
+                    (concat (file-name-sans-extension file) ".html"))))  
+                (with-current-buffer
+                    (find-file absolute-file-name)
+                  (org-export-to-file
+                   'e-html
+                   (concat
+                    (file-name-sans-extension absolute-file-name)
+                    ".html"))
+                  (kill-buffer (find-file absolute-file-name)))))))
      docroot-files))
   ;; define the webserver handler
   (set (intern
@@ -146,19 +153,20 @@ Use data from the alists PROJ-CONFIG or ARGS to configure the server."
         (iorg-projects--get-project-info project :docroot)))
   ;; start an elnode server that serves all the static html files
   ;; in projects docroot 
-  (elnode-start (quote (intern-soft
-                        (concat
-                         project "-"
-                         (if (and args (assoc :controller args))
-                             (cdr (assoc :controller args))
-                           (cdr (assoc :controller proj-config)))
-                         "-docroot-handler")))
-                (if (and args (assoc :docroot-port args))
-                    (string-to-int (cdr (assoc :docroot-port args)))
-                  (string-to-int (cdr (assoc :docroot-port proj-config))))
-                (if (and args (assoc :host args))
-                    (cdr (assoc :host args))
-                  (cdr (assoc :host proj-config)))))
+  (elnode-start (intern-soft
+                 (concat
+                  project "-"
+                  (if (and args (assoc :controller args))
+                      (cdr (assoc :controller args))
+                    (cdr (assoc :controller proj-config)))
+                  "-docroot-handler"))
+                :port (if (and args (assoc :docroot-port args))
+                          (string-to-int (cdr (assoc :docroot-port args)))
+                        (string-to-int (cdr (assoc :docroot-port proj-config))))
+                :host  (if (and args (assoc :host args))
+                           (cdr (assoc :host args))
+                         (cdr (assoc :host proj-config)))))
+
               
 
 (defun iorg-change-state-handler (httpcon)