]> source.dussan.org Git - gitblit.git/commitdiff
Building site content and documentation from Markdown.
authorJames Moger <james.moger@gitblit.com>
Wed, 18 May 2011 02:06:07 +0000 (22:06 -0400)
committerJames Moger <james.moger@gitblit.com>
Wed, 18 May 2011 02:06:07 +0000 (22:06 -0400)
25 files changed:
.gitignore
build.xml
distrib/UninstallService.bat [deleted file]
distrib/UninstallService64.bat [deleted file]
distrib/gitblit.properties
distrib/installService.bat [deleted file]
distrib/installService.cmd [new file with mode: 0644]
distrib/installService64.bat [deleted file]
distrib/installService64.cmd [new file with mode: 0644]
distrib/makekeystore.cmd [new file with mode: 0644]
distrib/uninstallService.cmd [new file with mode: 0644]
distrib/uninstallService64.cmd [new file with mode: 0644]
docs/00_overview.mkd [new file with mode: 0644]
docs/01_configuration.mkd [new file with mode: 0644]
docs/01_eclipse.mkd [new file with mode: 0644]
docs/01_faq.mkd [new file with mode: 0644]
docs/01_releases.mkd [new file with mode: 0644]
docs/01_screenshots.mkd [new file with mode: 0644]
docs/architecture.odg [new file with mode: 0644]
docs/architecture.png [new file with mode: 0644]
docs/page_footer.html [new file with mode: 0644]
docs/page_header.html [new file with mode: 0644]
src/com/gitblit/BuildSite.java [new file with mode: 0644]
src/com/gitblit/Constants.java
src/com/gitblit/wicket/resources/markdown.css

index 2aa1fab6bcd00c40d2227a0daf00ec4efe59762d..6ba7073382ea8f893eb841de8dbbca358a084023 100644 (file)
@@ -6,3 +6,4 @@
 /*.zip
 /gitblit.properties
 /users.properties
+/site
\ No newline at end of file
index 22f233602c5e5127d692a324a2db94d5896c5b19..a25ba329ad38227602a139fee1f7622e6a9cc6ee 100644 (file)
--- a/build.xml
+++ b/build.xml
@@ -3,27 +3,27 @@
 \r
        <!-- Project Properties -->\r
        <property name="project.jar" value="gitblit.jar" />\r
-       <property name="project.mainclass" value="com.gitblit.Launcher" />      \r
+       <property name="project.mainclass" value="com.gitblit.Launcher" />\r
        <property name="project.build.dir" value="${basedir}/build" />\r
 \r
        <target name="main">\r
-                       \r
+\r
                <!-- extract version number from source code -->\r
                <loadfile property="gb.version" srcfile="${basedir}/src/com/gitblit/Constants.java">\r
                        <filterchain>\r
                                <linecontains>\r
-                               <contains value="public final static String VERSION = "/>\r
-                       </linecontains>\r
-                               <striplinebreaks/>\r
-                               <tokenfilter>                               \r
-                                       <replacestring from="public final static String VERSION = &quot;" to=""/>\r
-                                       <replacestring from="&quot;;" to=""/>\r
+                                       <contains value="public final static String VERSION = " />\r
+                               </linecontains>\r
+                               <striplinebreaks />\r
+                               <tokenfilter>\r
+                                       <replacestring from="public final static String VERSION = &quot;" to="" />\r
+                                       <replacestring from="&quot;;" to="" />\r
                                        <trim />\r
                                </tokenfilter>\r
                        </filterchain>\r
                </loadfile>\r
                <echo>Building Git:Blit ${gb.version}</echo>\r
-               \r
+\r
                <!-- copy required distribution files to project folder -->\r
                <copy todir="${basedir}" overwrite="false">\r
                        <fileset dir="${basedir}/distrib">\r
@@ -31,7 +31,7 @@
                                <include name="users.properties" />\r
                        </fileset>\r
                </copy>\r
-               \r
+\r
                <!-- Compile the build tool and execute it.\r
                         This downloads missing compile-time dependencies from Maven. -->\r
 \r
                                <include name="${project.jar}" />\r
                        </fileset>\r
                </delete>\r
+\r
+               <!-- Build Site -->\r
+               <delete dir="${basedir}/site" />\r
+               <mkdir dir="${basedir}/site" />\r
+               <copy todir="${basedir}/site">\r
+                       <fileset dir="${basedir}/src/com/gitblit/wicket/resources">\r
+                               <include name="background.png" />\r
+                               <include name="gitblit.css" />\r
+                               <include name="markdown.css" />\r
+                               <include name="gitblt_25.png" />\r
+                               <include name="gitblt-favicon.png" />\r
+                       </fileset>\r
+                       <fileset dir="${basedir}/docs">\r
+                               <include name="*.png" />\r
+                       </fileset>\r
+               </copy>\r
+               <java classpath="${project.build.dir}" classname="com.gitblit.BuildSite">\r
+                       <classpath refid="master-classpath" />\r
+                       <arg value="--sourceFolder" />\r
+                       <arg value="${basedir}/docs" />\r
+                       \r
+                       <arg value="--outputFolder" />\r
+                       <arg value="${basedir}/site" />\r
+\r
+                       <arg value="--pageHeader" />\r
+                       <arg value="${basedir}/docs/page_header.html" />\r
+\r
+                       <arg value="--pageFooter" />\r
+                       <arg value="${basedir}/docs/page_footer.html" />\r
+               </java>\r
+\r
        </target>\r
 </project>\r
diff --git a/distrib/UninstallService.bat b/distrib/UninstallService.bat
deleted file mode 100644 (file)
index a483c55..0000000
+++ /dev/null
@@ -1 +0,0 @@
-javaservice -uninstall gitblit
\ No newline at end of file
diff --git a/distrib/UninstallService64.bat b/distrib/UninstallService64.bat
deleted file mode 100644 (file)
index 91f0c84..0000000
+++ /dev/null
@@ -1 +0,0 @@
-javaservice64 -uninstall gitblit
\ No newline at end of file
index bcbd3db422446cf32a9f0372557184172b5570c2..e13b60cfa453a222d79d2977e37408349d137e1e 100644 (file)
@@ -146,11 +146,15 @@ server.httpPort = 0
 server.httpsPort = 443\r
 \r
 # Specify the interface for Jetty to bind the standard connector.\r
-# You may specify an ip or an empty value to bind to all interfaces. \r
+# You may specify an ip or an empty value to bind to all interfaces.\r
+# Specifying localhost will result in Git:Blit ONLY listening to requests to\r
+# localhost.\r
 server.httpBindInterface = localhost\r
 \r
 # Specify the interface for Jetty to bind the secure connector.\r
 # You may specify an ip or an empty value to bind to all interfaces.\r
+# Specifying localhost will result in Git:Blit ONLY listening to requests to\r
+# localhost.\r
 server.httpsBindInterface = localhost\r
 \r
 # Password for SSL keystore.\r
diff --git a/distrib/installService.bat b/distrib/installService.bat
deleted file mode 100644 (file)
index 5b0df2c..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-set JDK=C:\Program Files\Java\jdk1.6.0_21\r
-JavaService.exe -install gitblit "%JDK%\jre\bin\server\jvm.dll" -Xmx1024M -Djava.class.path=%CD%\gitblit.jar;"%JDK%\lib\tools.jar" -start com.gitblit.Launcher -params --storePassword dosomegit -stop com.gitblit.Launcher -params --stop -out %CD%\logs\stdout.log -err %CD%\logs\stderr.log -current %CD%
\ No newline at end of file
diff --git a/distrib/installService.cmd b/distrib/installService.cmd
new file mode 100644 (file)
index 0000000..5b0df2c
--- /dev/null
@@ -0,0 +1,2 @@
+set JDK=C:\Program Files\Java\jdk1.6.0_21\r
+JavaService.exe -install gitblit "%JDK%\jre\bin\server\jvm.dll" -Xmx1024M -Djava.class.path=%CD%\gitblit.jar;"%JDK%\lib\tools.jar" -start com.gitblit.Launcher -params --storePassword dosomegit -stop com.gitblit.Launcher -params --stop -out %CD%\logs\stdout.log -err %CD%\logs\stderr.log -current %CD%
\ No newline at end of file
diff --git a/distrib/installService64.bat b/distrib/installService64.bat
deleted file mode 100644 (file)
index 08761f8..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-set JDK=C:\Program Files\Java\jdk1.6.0_21\r
-JavaService64.exe -install gitblit "%JDK%\jre\bin\server\jvm.dll" -Djava.class.path=%CD%\gitblit.jar;"%JDK%\lib\tools.jar" -start com.gitblit.Launcher -params --storePassword dosomegit -stop com.gitblit.Launcher -params --stop -out %CD%\logs\stdout.log -err %CD%\logs\stderr.log -current %CD%
\ No newline at end of file
diff --git a/distrib/installService64.cmd b/distrib/installService64.cmd
new file mode 100644 (file)
index 0000000..08761f8
--- /dev/null
@@ -0,0 +1,2 @@
+set JDK=C:\Program Files\Java\jdk1.6.0_21\r
+JavaService64.exe -install gitblit "%JDK%\jre\bin\server\jvm.dll" -Djava.class.path=%CD%\gitblit.jar;"%JDK%\lib\tools.jar" -start com.gitblit.Launcher -params --storePassword dosomegit -stop com.gitblit.Launcher -params --stop -out %CD%\logs\stdout.log -err %CD%\logs\stderr.log -current %CD%
\ No newline at end of file
diff --git a/distrib/makekeystore.cmd b/distrib/makekeystore.cmd
new file mode 100644 (file)
index 0000000..34a11b2
--- /dev/null
@@ -0,0 +1,2 @@
+@del keystore\r
+@keytool -keystore keystore -alias localhost -genkey -keyalg RSA -dname "CN=localhost, OU=Git:Blit, O=Git:Blit, L=Some Town, ST=Some State, C=US"
\ No newline at end of file
diff --git a/distrib/uninstallService.cmd b/distrib/uninstallService.cmd
new file mode 100644 (file)
index 0000000..a483c55
--- /dev/null
@@ -0,0 +1 @@
+javaservice -uninstall gitblit
\ No newline at end of file
diff --git a/distrib/uninstallService64.cmd b/distrib/uninstallService64.cmd
new file mode 100644 (file)
index 0000000..91f0c84
--- /dev/null
@@ -0,0 +1 @@
+javaservice64 -uninstall gitblit
\ No newline at end of file
diff --git a/docs/00_overview.mkd b/docs/00_overview.mkd
new file mode 100644 (file)
index 0000000..63898f6
--- /dev/null
@@ -0,0 +1,87 @@
+## Overview\r
+Git:Blit is an open-source, integrated pure-Java stack for managing, viewing, and serving [Git](http://git-scm.com) repositories.\r
+Its designed primarily as a tool for small workgroups who want to host Git repositories on a Windows machine.\r
+\r
+Of course, since its pure-Java it should run with any JVM on any platform, but there are already [many compelling Git solutions](https://git.wiki.kernel.org/index.php/InterfacesFrontendsAndTools) for non-Windows environments.\r
\r
+### Current Version\r
+\r
+[{0}](http://gitblit.com/{1}) based on [{2}](http://eclipse.org/jgit) &nbsp; (*{3}*)\r
+\r
+### Features\r
+- Out-of-the-box integrated stack requiring minimal configuration\r
+- JGit SmartHTTP Servlet\r
+- Web and Git Servlet authentication\r
+- Four repository access control configurations\r
+    - *Anonymous View, Clone & Push*\r
+    - *Authenticated Push*\r
+    - *Authenticated Clone & Push*\r
+    - *Authenticated View, Clone & Push*    \r
+- Gitweb inspired UI (mostly plain html)\r
+- Repository administration through web UI\r
+- User administration through web UI\r
+- Automatically generates a self-signed certificate for https communications\r
+- Dates can optionally be displayed using browser's reported timezone\r
+- Author and Committer email address display can be controlled\r
+- Syntax highlighting\r
+- Customizable regular expression handling for commit messages\r
+- Simple repository stats\r
+- Simple text file for server configuration\r
+- Simple text file for users configuration\r
+- Optional integrated Ticgit\r
+- Optional integrated Markdown\r
+\r
+### Limitations\r
+- HTTP/HTTPS are the only supported protocols\r
+- Access controls are not path-based, they are repository-based\r
+- Only admin users can create repositories\r
+- Git:Blit is a full-stack solution, its not just a webapp so at this time there is no WAR build\r
+\r
+### Todo List\r
+- Review spots where Git:Blit can cache data instead of abusing the disk\r
+- Ticgit activity/timeline\r
+- Ticgit query feature with paging support\r
+- Ticgit ticket change history\r
+- Implement Markdown editing\r
+- View images on Blob page\r
+- View other binary files Blob page\r
+\r
+### License\r
+TBD\r
+\r
+### Architecture\r
+\r
+![block diagram](architecture.png "Git Blit Architecture")\r
+\r
+### Bundled Dependencies\r
+The following dependencies are bundled with the Git:Blit zip file.\r
+\r
+- [google-code-prettify](http://code.google.com/p/google-code-prettify)\r
+- [JavaService](http://forge.ow2.org/projects/javaservice)\r
+- icons courtesy of [FatCow Hosting](http://www.fatcow.com/free-icons)\r
+\r
+### Downloaded Dependencies\r
+The following dependencies are automatically downloaded from the Apache Maven repository and from the Eclipse Maven repository when Git:Blit is launched for the first time.\r
+\r
+- [JGit](http://eclipse.org/jgit)\r
+- [Wicket](http://wicket.apache.org)\r
+- [WicketStuff GoogleCharts](https://github.com/wicketstuff/core/wiki/GoogleCharts)\r
+- [MarkdownPapers](http://markdown.tautua.org)\r
+- [Jetty](http://eclipse.org/jetty)\r
+- [SLF4J](http://www.slf4j.org)\r
+- [Log4j](http://logging.apache.org/log4j)\r
+- [JCommander](http://jcommander.org)\r
+- [BouncyCastle](http://www.bouncycastle.org)\r
+\r
+### Building\r
+Eclipse is recommended for development as the project settings are preconfigured.\r
+\r
+1. Clone the git repository from here.\r
+2. Import the gitblit project into your Eclipse workspace.<br/>\r
+*There will be lots of build errors.*\r
+3. Using Ant, execute the `build.xml` script in the project root.<br/>\r
+*This will download all necessary build dependencies and will also generate the Keys class for accessing settings.*\r
+4. Select your gitblit project root and **Refresh** the project, this should correct all build problems.\r
+5. Review the settings in `gitblit.properties` in your project root.<br/>\r
+Make sure you set an appropriate value for *git.repositoriesFolder*. \r
+6. Execute the *com.gitblit.Launcher* class to start Git:Blit.
\ No newline at end of file
diff --git a/docs/01_configuration.mkd b/docs/01_configuration.mkd
new file mode 100644 (file)
index 0000000..9e8a9f0
--- /dev/null
@@ -0,0 +1,73 @@
+## Setup and Configuration\r
+\r
+1. Download and unzip Git:Blit.<br/>\r
+*Its best to eliminate spaces in the path name as that can cause troubleshooting headaches.* \r
+2. The server itself is configured through a simple text file.<br/>\r
+Open `gitblit.properties` in your favorite text editor and make sure to review and set:\r
+    - *git.repositoryFolder*\r
+    - *server.tempFolder*\r
+    - *server.httpBindInterface* and *server.httpsBindInterface*\r
+    - *server.storePassword*<br/>\r
+**NOTE:**<br/>\r
+Its recommended to use **https** wherever possible instead of http because passwords are transmitted as clear text!     \r
+3. Execute `gitblit.cmd` or `java -jar gitblit.jar` from a command-line\r
+4. Wait a minute or two while all dependencies are downloaded and your self-signed certificate is generated.\r
+5. Open your browser to <http://localhost> or <https://localhost> depending on your chosen configuration.\r
+6. Click the *Login* link and enter the default administrator credentials: **admin / admin**<br/>\r
+**NOTE:**<br/>\r
+Make sure to change the administrator username and/or password!! \r
+\r
+### Administering Repositories\r
+Repositories can be created, edited, and deleted through the web UI.  They may also be created, edited, and deleted from the command-line using real Git or your favorite file manager and text editor.\r
+\r
+All repository settings are stored within the repository `.git/config` file under the *gitblit* section.\r
+\r
+    [gitblit]\r
+           description = master repository\r
+           owner = Joe Owner\r
+           useTickets = false\r
+           useDocs = true\r
+           showRemoteBranches = false\r
+           accessRestriction = clone\r
+           \r
+#### Repository Names\r
+Repository names must be unique and are case-insensitive.  The name must be composed of letters, digits, or `/ _ - .`<br/>\r
+Whitespace is illegal.\r
+\r
+### Administering Users\r
+In contrast, all users are stored in the `users.properties` file or in the file your specified in `gitblit.properties`.<br/>\r
+The format of `users.properties` follows Jetty's convention for HashRealms:\r
+\r
+    username,password,role1,role2,role3...\r
+\r
+#### Usernames\r
+Usernames must be unique and are case-insensitive.<br/>\r
+Whitespace is illegal.\r
+\r
+#### Passwords\r
+User passwords are CASE-SENSITIVE and may be *plain*, *md5*, or *crypt* formatted (see `gitblit.properties` -> *realm.passwordStorage*).\r
+\r
+#### User Roles\r
+There is only one actual *role* in Git:Blit and that is *#admin* which grants administrative powers to that user.  Administrators automatically have access to all repositories.  All other *roles* are actually repository names.  If a repository is access-restricted, the user must have the repository's name within his/her roles to bypass the access restriction.  This is how users are granted access to a restricted repository.\r
+\r
+### Creating your own Self-Signed Certificate\r
+\r
+Review the contents of the `makekeystore.cmd` or `makekeystore_jdk.cmd`script and execute it.  Voila.\r
+\r
+### Running as a Service\r
+Review the contents of the `installService.cmd` or `installService64.cmd`, as appropriate for your JVM.<br/>\r
+Set the *JDK* variable in the script to the location of your JDK, add any necessary start parameters, and execute the script.\r
+\r
+#### Command-Line Parameters\r
+    --tempFolder           Server temp folder\r
+       --repositoriesFolder   Git Repositories Folder\r
+    --realmFile            Users Realm Hash File\r
+    --useNio               Use NIO Connector else use Socket Connector.\r
+    --httpPort             HTTP port for to serve. (port <= 0 will disable this connector)\r
+    --httpsPort            HTTPS port to serve.  (port <= 0 will disable this connector)\r
+    --storePassword        Password for SSL (https) keystore.\r
+    --shutdownPort         Port for Shutdown Monitor to listen on. (port <= 0 will disable this monitor)\r
+    \r
+**Example**\r
+\r
+    java -jar gitblit.jar --realmFile c:\myrealm.txt --storePassword something
\ No newline at end of file
diff --git a/docs/01_eclipse.mkd b/docs/01_eclipse.mkd
new file mode 100644 (file)
index 0000000..93fd531
--- /dev/null
@@ -0,0 +1,5 @@
+## Eclipse Tips\r
+\r
+verifySsl\r
+\r
+how to push new unshared project to new repository 
\ No newline at end of file
diff --git a/docs/01_faq.mkd b/docs/01_faq.mkd
new file mode 100644 (file)
index 0000000..c92bfab
--- /dev/null
@@ -0,0 +1 @@
+## Frequently Asked Questions\r
diff --git a/docs/01_releases.mkd b/docs/01_releases.mkd
new file mode 100644 (file)
index 0000000..7c0c204
--- /dev/null
@@ -0,0 +1 @@
+## Release History\r
diff --git a/docs/01_screenshots.mkd b/docs/01_screenshots.mkd
new file mode 100644 (file)
index 0000000..666e943
--- /dev/null
@@ -0,0 +1,3 @@
+## Screenshots\r
+\r
+![test](gitblt_25.png "Optional Title")
\ No newline at end of file
diff --git a/docs/architecture.odg b/docs/architecture.odg
new file mode 100644 (file)
index 0000000..fc4ea7b
Binary files /dev/null and b/docs/architecture.odg differ
diff --git a/docs/architecture.png b/docs/architecture.png
new file mode 100644 (file)
index 0000000..d2f3e0c
Binary files /dev/null and b/docs/architecture.png differ
diff --git a/docs/page_footer.html b/docs/page_footer.html
new file mode 100644 (file)
index 0000000..80b14d0
--- /dev/null
@@ -0,0 +1,6 @@
+       </div>\r
+       <div style="margin-top:10px" class="page_footer">\r
+               <div style="float:right;">{0}</div>\r
+       </div>\r
+</body>\r
+</html>
\ No newline at end of file
diff --git a/docs/page_header.html b/docs/page_header.html
new file mode 100644 (file)
index 0000000..d282f54
--- /dev/null
@@ -0,0 +1,17 @@
+<html>\r
+       <head>\r
+               <title>Git:Blit</title>\r
+               <link rel="stylesheet" type="text/css" href="gitblit.css"/>\r
+               <link rel="stylesheet" type="text/css" href="markdown.css"/>\r
+               <link rel="shortcut icon" href="gitblt-favicon.png" type="image/png" />\r
+               <meta name="ROBOTS" content="INDEX, NOFOLLOW">\r
+       </head>\r
+       <body>\r
+               <div class="page_header">\r
+                       <a title="gitblit homepage" href="http://gitblit.com/">\r
+                               <img src="gitblt_25.png" width="79" height="25" alt="gitblit" class="logo"/>\r
+                       </a>\r
+                       <span style="color:black;">{0}</span>\r
+               </div>\r
+               <div class="page_nav">{1}</div>\r
+               <div class="markdown">
\ No newline at end of file
diff --git a/src/com/gitblit/BuildSite.java b/src/com/gitblit/BuildSite.java
new file mode 100644 (file)
index 0000000..ae85c06
--- /dev/null
@@ -0,0 +1,136 @@
+package com.gitblit;\r
+\r
+import java.io.BufferedReader;\r
+import java.io.File;\r
+import java.io.FileInputStream;\r
+import java.io.FileOutputStream;\r
+import java.io.FilenameFilter;\r
+import java.io.InputStreamReader;\r
+import java.io.OutputStreamWriter;\r
+import java.nio.charset.Charset;\r
+import java.text.MessageFormat;\r
+import java.text.SimpleDateFormat;\r
+import java.util.Arrays;\r
+import java.util.Date;\r
+\r
+import com.beust.jcommander.JCommander;\r
+import com.beust.jcommander.Parameter;\r
+import com.beust.jcommander.ParameterException;\r
+import com.beust.jcommander.Parameters;\r
+import com.gitblit.utils.MarkdownUtils;\r
+\r
+public class BuildSite {\r
+\r
+       public static void main(String... args) {\r
+               Params params = new Params();\r
+               JCommander jc = new JCommander(params);\r
+               try {\r
+                       jc.parse(args);\r
+               } catch (ParameterException t) {\r
+                       usage(jc, t);\r
+               }\r
+\r
+               File sourceFolder = new File(params.sourceFolder);\r
+               File destinationFolder = new File(params.outputFolder);\r
+               File[] markdownFiles = sourceFolder.listFiles(new FilenameFilter() {\r
+\r
+                       @Override\r
+                       public boolean accept(File dir, String name) {\r
+                               return name.toLowerCase().endsWith(".mkd");\r
+                       }\r
+               });\r
+               Arrays.sort(markdownFiles);\r
+\r
+               System.out.println(MessageFormat.format("Generating site from {0} Markdown Docs in {1} ", markdownFiles.length, sourceFolder.getAbsolutePath()));\r
+               String linkPattern = "<a href=''{0}''>{1}</a>";\r
+               StringBuilder sb = new StringBuilder();\r
+               for (File file : markdownFiles) {\r
+                       String displayName = getDocumentName(file);\r
+                       String fileName = displayName + ".html";\r
+                       sb.append(MessageFormat.format(linkPattern, fileName, displayName));\r
+                       sb.append(" | ");\r
+               }\r
+               sb.setLength(sb.length() - 3);\r
+               sb.trimToSize();\r
+               String html_header = readContent(new File(params.pageHeader));\r
+               String html_footer = readContent(new File(params.pageFooter));\r
+               final String links = sb.toString();\r
+               final String header = MessageFormat.format(html_header, Constants.FULL_NAME, links);\r
+               final String date = new SimpleDateFormat("yyyy MMM dd").format(new Date());\r
+               final String footer = MessageFormat.format(html_footer, "generated " + date);\r
+               for (File file : markdownFiles) {\r
+                       try {\r
+                               String displayName = getDocumentName(file);\r
+                               String fileName = displayName + ".html";\r
+                               System.out.println(MessageFormat.format("  {0} => {1}", file.getName(), fileName));\r
+                               InputStreamReader reader = new InputStreamReader(new FileInputStream(file), Charset.forName("UTF-8"));\r
+                               String content = MarkdownUtils.transformMarkdown(reader);\r
+                               if (displayName.equalsIgnoreCase("overview")) {\r
+                                       content = MessageFormat.format(content, Constants.VERSION, "gitblit-" + Constants.VERSION + ".zip", Constants.getJGitVersion(), date);\r
+                               }\r
+                               OutputStreamWriter writer = new OutputStreamWriter(new FileOutputStream(new File(destinationFolder, fileName)), Charset.forName("UTF-8"));\r
+                               writer.write(header);\r
+                               writer.write(content);\r
+                               writer.write(footer);\r
+                               reader.close();\r
+                               writer.close();\r
+                       } catch (Throwable t) {\r
+                               System.err.println("Failed to transform " + file.getName());\r
+                               t.printStackTrace();\r
+                       }\r
+               }\r
+       }\r
+\r
+       private static String readContent(File file) {\r
+               StringBuilder sb = new StringBuilder();\r
+               try {\r
+                       InputStreamReader is = new InputStreamReader(new FileInputStream(file), Charset.forName("UTF-8"));\r
+                       BufferedReader reader = new BufferedReader(is);\r
+                       String line = null;\r
+                       while ((line = reader.readLine()) != null) {\r
+                               sb.append(line);\r
+                       }\r
+                       reader.close();\r
+               } catch (Throwable t) {\r
+                       System.err.println("Failed to read content of " + file.getAbsolutePath());\r
+                       t.printStackTrace();\r
+               }\r
+               return sb.toString();\r
+       }\r
+\r
+       private static String getDocumentName(File file) {\r
+               String displayName = file.getName().substring(0, file.getName().lastIndexOf('.')).toLowerCase();\r
+               // trim leading ##_ which is to control display order\r
+               return displayName.substring(3);\r
+       }\r
+       \r
+       private static void usage(JCommander jc, ParameterException t) {\r
+               System.out.println(Constants.getRunningVersion());\r
+               System.out.println();\r
+               if (t != null) {\r
+                       System.out.println(t.getMessage());\r
+                       System.out.println();\r
+               }\r
+               if (jc != null) {\r
+                       jc.usage();\r
+               }\r
+               System.exit(0);\r
+       }\r
+       \r
+       @Parameters(separators = " ")\r
+       private static class Params {\r
+\r
+               @Parameter(names = { "--sourceFolder" }, description = "Markdown Source Folder", required = true)\r
+               public String sourceFolder;\r
+\r
+               @Parameter(names = { "--outputFolder" }, description = "HTML Ouptut Folder", required = true)\r
+               public String outputFolder;\r
+\r
+               @Parameter(names = { "--pageHeader" }, description = "Page Header HTML Snippet", required = true)\r
+               public String pageHeader;\r
+\r
+               @Parameter(names = { "--pageFooter" }, description = "Page Footer HTML Snippet", required = true)\r
+               public String pageFooter;\r
+\r
+       }\r
+}\r
index 1b4a5188e59e6e8159c0786ddc8cf58a63cf48b0..9cf6a54fc30e95149ec3598ee1d1d1c80b6c867b 100644 (file)
@@ -3,6 +3,8 @@ package com.gitblit;
 public class Constants {\r
 \r
        public final static String NAME = "Git:Blit";\r
+       \r
+       public final static String FULL_NAME = "Git:Blit - a Pure Java Git Server";\r
 \r
        // The build script extracts this exact line so be careful editing it\r
        // and only use A-Z a-z 0-9 .-_ in the string. \r
index ce48cefb991158665a093a99851c180b9f5b384e..41bc43929ab9e4678845f94f2eda8050dfccbbf8 100644 (file)
@@ -3,6 +3,7 @@
  */\r
 \r
 div.markdown {\r
+       line-height: 1.4em;\r
 }\r
 \r
 div.markdown h1,\r
@@ -51,4 +52,16 @@ div.markdown code {
 \r
 div.markdown a {\r
        text-decoration: underline;     \r
+}\r
+\r
+div.markdown ul, div.markdown ol {\r
+       padding-left: 30px;\r
+}\r
+\r
+div.markdown li {\r
+       margin: 0.2em 0 0 0em; padding: 0px;\r
+}\r
+\r
+div.markdown em {\r
+       color: #b05000;\r
 }
\ No newline at end of file