Skip to content
Permalink
Browse files
https://issues.apache.org/jira/browse/OPENWIRE-2
Add initial website module
  • Loading branch information
tabish121 committed Aug 12, 2014
1 parent 4db2817 commit 429b1b4a44b6201bc1fcdbd78c6c8d3628bd807b
Showing 39 changed files with 11,228 additions and 0 deletions.
@@ -0,0 +1 @@
/target
@@ -0,0 +1,14 @@
## OpenWire Protocol Library website

This maven project builds the OpenWire protocol library website content. Its mostly consists of markdown files you can view/edit directly or via github.

If you want to build the HTML yourself try:

```
mvn jetty:run
```

To generate the static html try:
```
mvn scalate:sitegen
```
@@ -0,0 +1,29 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import org.fusesource.scalate.support.TemplatePackage
import org.fusesource.scalate.{Binding, TemplateSource}

/**
* Defines the template package of reusable imports, attributes and methods across templates
*/
class ScalatePackage extends TemplatePackage {
def header(source: TemplateSource, bindings: List[Binding]) =
"""
// common imports go here
import _root_.Website._;
"""
}
@@ -0,0 +1,63 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import org.fusesource.scalate.RenderContext

package

/**
* <p>
* </p>
*/
object Website {

val project_name= "ActiveMQ OpenWire"
val project_slogan= "ActiveMQ's OpenWire Protocol library"
val project_id= "OpenWire"
val project_jira_key= "OPENWIRE"
val project_issue_url= "https://issues.apache.org/jira/browse/OPENWIRE"
val project_forums_url= "http://activemq.2283324.n4.nabble.com/ActiveMQ-Dev-f2368404.html"
val project_wiki_url= "https://cwiki.apache.org/confluence/display/ACTIVEMQ/Index"
val project_logo= "/images/project-logo.png"
val project_version= "1.0"
val project_snapshot_version= "1.0-SNAPSHOT"
val project_versions = List(
project_version,
"1.0"
)

val project_keywords= "messaging,openwire,jms,activemq,apollo,protocol"

// -------------------------------------------------------------------
val github_page= "https://github.com/apache/activemq-openwire"
val git_user_url= "git://github.com/apache/activemq-openwire"
val git_commiter_url= "https://git-wip-us.apache.org/repos/asf/activemq-openwire.git"
val git_branch= "master"
val git_edit_page_base = github_page+"/edit/"+git_branch+"/website/src"
val disqus_shortname = project_id

// REMOVE ME -------------------------------------------------------------------
val project_git_url= "https://git-wip-us.apache.org/repos/asf/activemq-openwire.git"
val project_git_trunk_url= project_git_url +"/master"
val project_git_branches_url= project_git_url + "/branches"
val project_git_tags_url= project_git_url + "/tags"
val project_git_commiter_url= project_git_trunk_url.replaceFirst("http","https")

val project_maven_groupId= "org.apache.activemq"
val project_maven_artifactId= "openwire-protocol"

val website_base_url= "http://activemq.apache.org/openwire"
}
@@ -0,0 +1,66 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package scalate

import org.fusesource.scalate.util.Logging
import java.util.concurrent.atomic.AtomicBoolean
import _root_.Website._
import org.fusesource.scalate._
import org.fusesource.scalamd.{MacroDefinition, Markdown}
import java.util.regex.Matcher
import org.fusesource.scalate.wikitext.Pygmentize

class Boot(engine: TemplateEngine) extends Logging {

private var _initialised = new AtomicBoolean(false)

def run: Unit = {
if (_initialised.compareAndSet(false, true)) {
def filter(m:Matcher):String = {
val filter_name = m.group(1)
val body = m.group(2)
engine.filter(filter_name) match {
case Some(filter)=>
filter.filter(RenderContext(), body)
case None=>
error("filter not found: "+filter_name)
body
}
}

def pygmentize(m:Matcher):String = Pygmentize.pygmentize(m.group(2), m.group(1))

// add some macros to markdown.
Markdown.macros :::= List(
MacroDefinition("""\{filter::(.*?)\}(.*?)\{filter\}""", "s", filter, true),
MacroDefinition("""\{pygmentize::(.*?)\}(.*?)\{pygmentize\}""", "s", pygmentize, true),
MacroDefinition("""\{pygmentize\_and\_compare::(.*?)\}(.*?)\{pygmentize\_and\_compare\}""", "s", pygmentize, true),
MacroDefinition("""\$\{project_version\}""", "", _ => project_version.toString, true),
MacroDefinition("""\$\{project_name\}""", "", _ => project_name.toString, true),
MacroDefinition("""\$\{project_id\}""", "", _ => project_id.toString, true),
MacroDefinition("""\$\{project_issue_url\}""", "", _ => project_issue_url.toString, true),
MacroDefinition("""\$\{website_base_url\}""", "", _ => website_base_url.toString, true)
)

for( ssp <- engine.filter("ssp"); md <- engine.filter("markdown") ) {
engine.pipelines += "ssp.md"-> List(ssp, md)
engine.pipelines += "ssp.markdown"-> List(ssp, md)
}
info("Bootstrapped website gen for: %s".format(project_name))
}
}
}

0 comments on commit 429b1b4

Please sign in to comment.