Skip to content

Commit

Permalink
[FLINK-1301] Added Apache license headers to Markdown, HTML, SVG, Pyt…
Browse files Browse the repository at this point in the history
…hon files.

Made exceptions for license check plugin more fine-granular.

This closes apache#250
  • Loading branch information
fhueske committed Dec 5, 2014
1 parent 979837a commit 770ce23
Show file tree
Hide file tree
Showing 80 changed files with 1,557 additions and 112 deletions.
19 changes: 18 additions & 1 deletion docs/_config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# 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.

#------------------------------------------------------------------------------
# VARIABLES
#------------------------------------------------------------------------------
Expand Down Expand Up @@ -35,8 +52,8 @@ defaults:
values:
layout: default

markdown: kramdown
highlighter: pygments
markdown: KramdownPygments

kramdown:
toc_levels: 1..3
20 changes: 19 additions & 1 deletion docs/_includes/footer.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
<!--
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.
-->
<hr class="divider">

<small>Apache Flink is an effort undergoing incubation at The Apache Software
Expand All @@ -11,4 +29,4 @@ endorsed by the ASF.</small>

<a href="http://incubator.apache.org/">![Incubator Logo]({{ site.baseurl }}/img/apache-incubator-logo.png)</a>

<p class="text-center"><a href="privacy-policy.html">Privacy Policy<a></p>
<p class="text-center"><a href="privacy-policy.html">Privacy Policy<a></p>
18 changes: 18 additions & 0 deletions docs/_includes/navbar.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
<!--
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.
-->
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="row">
Expand Down
18 changes: 18 additions & 0 deletions docs/_includes/sidenav.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
<!--
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.
-->
<ul>
<li><a href="faq.html">FAQ</a></li>
<li>Quickstart
Expand Down
18 changes: 18 additions & 0 deletions docs/_layouts/default.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@
<!DOCTYPE html>
<!--
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.
-->
<html lang="en">
<head>
<meta charset="utf-8">
Expand Down
17 changes: 17 additions & 0 deletions docs/_plugins/gh_link.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# 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.

module Jekyll
class GitHubLinkTag < Liquid::Tag

Expand Down
88 changes: 88 additions & 0 deletions docs/_plugins/highlightCode.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# 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.

# This file was derived from https://github.com/navarroj/krampygs
# written by Juan Navarro and released under the Unlicense (http://unlicense.org).

require 'kramdown'
require 'pygments'

module Kramdown
module Converter
class Pygs < Html
def convert_codeblock(el, indent)
attr = el.attr.dup
lang = extract_code_language!(attr) || @options[:kramdown_default_lang]
code = pygmentize(el.value, lang)
code_attr = {}
code_attr['class'] = "language-#{lang}" if lang
"#{' '*indent}<div class=\"highlight\"><pre#{html_attributes(attr)}><code#{html_attributes(code_attr)}>#{code}</code></pre></div>\n"
end

def convert_codespan(el, indent)
attr = el.attr.dup
lang = extract_code_language!(attr) || @options[:kramdown_default_lang]
code = pygmentize(el.value, lang)
if lang
attr['class'] = "highlight"
if attr.has_key?('class')
attr['class'] += " language-#{lang}"
else
attr['class'] = "language-#{lang}"
end
end
"<code#{html_attributes(attr)}>#{code}</code>"
end

def pygmentize(code, lang)
if lang
Pygments.highlight(code,
:lexer => lang,
:options => { :encoding => 'utf-8', :nowrap => true })
else
escape_html(code)
end
end
end
end
end

module Jekyll
class KramdownPygments < Jekyll::Converter

def matches(ext)
ext =~ /^\.md$/i
end

def output_ext(ext)
".html"
end

def convert(content)
html = Kramdown::Document.new(content, {
:auto_ids => @config['kramdown']['auto_ids'],
:footnote_nr => @config['kramdown']['footnote_nr'],
:entity_output => @config['kramdown']['entity_output'],
:toc_levels => @config['kramdown']['toc_levels'],
:smart_quotes => @config['kramdown']['smart_quotes'],
:coderay_default_lang => @config['kramdown']['default_lang'],
:input => @config['kramdown']['input']
}).to_pygs
return html
end
end
end
92 changes: 0 additions & 92 deletions docs/_plugins/kramdown_pygments.rb

This file was deleted.

Loading

0 comments on commit 770ce23

Please sign in to comment.