Repository: incubator-groovy Updated Branches: refs/heads/GROOVY_2_4_X 75fcf88cb -> b9e1ba938
add Apache license header to template files Project: http://git-wip-us.apache.org/repos/asf/incubator-groovy/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-groovy/commit/b9e1ba93 Tree: http://git-wip-us.apache.org/repos/asf/incubator-groovy/tree/b9e1ba93 Diff: http://git-wip-us.apache.org/repos/asf/incubator-groovy/diff/b9e1ba93 Branch: refs/heads/GROOVY_2_4_X Commit: b9e1ba9380e0559ab0bccfeeb8e16290335b12d4 Parents: 75fcf88 Author: pascalschumacher <pascalschumac...@gmx.net> Authored: Mon Jun 8 22:11:14 2015 +0200 Committer: pascalschumacher <pascalschumac...@gmx.net> Committed: Mon Jun 8 22:12:22 2015 +0200 ---------------------------------------------------------------------- .../src/spec/doc/markup-template-engine.adoc | 2 +- .../src/spec/test-resources/layout-main.tpl | 23 +++++++++++++++++++- .../src/spec/test-resources/locale_include.tpl | 19 ++++++++++++++++ .../test-resources/locale_include_fr_FR.tpl | 19 ++++++++++++++++ .../src/spec/test-resources/main.tpl | 19 ++++++++++++++++ .../src/spec/test-resources/other_template.tpl | 19 ++++++++++++++++ .../src/test/resources/includes/body.tpl | 19 ++++++++++++++++ .../src/test/resources/includes/hello.tpl | 19 ++++++++++++++++ .../src/test/resources/includes/hello_fr_FR.tpl | 19 ++++++++++++++++ .../resources/includes/typecheckedinclude.tpl | 19 ++++++++++++++++ 10 files changed, 175 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-groovy/blob/b9e1ba93/subprojects/groovy-templates/src/spec/doc/markup-template-engine.adoc ---------------------------------------------------------------------- diff --git a/subprojects/groovy-templates/src/spec/doc/markup-template-engine.adoc b/subprojects/groovy-templates/src/spec/doc/markup-template-engine.adoc index cdc0ab7..9323933 100644 --- a/subprojects/groovy-templates/src/spec/doc/markup-template-engine.adoc +++ b/subprojects/groovy-templates/src/spec/doc/markup-template-engine.adoc @@ -258,7 +258,7 @@ with a _layout_. First of all, you need to create a layout template: [source,groovy] .layout-main.tpl ---- -include::{rootProjectDir}/subprojects/groovy-templates/src/spec/test-resources/layout-main.tpl[indent=0] +include::{rootProjectDir}/subprojects/groovy-templates/src/spec/test-resources/layout-main.tpl[tags=layout_main,indent=0] ---- <1> the `title` variable (inside the title tag) is a layout variable <2> the `bodyContents` call will render the body http://git-wip-us.apache.org/repos/asf/incubator-groovy/blob/b9e1ba93/subprojects/groovy-templates/src/spec/test-resources/layout-main.tpl ---------------------------------------------------------------------- diff --git a/subprojects/groovy-templates/src/spec/test-resources/layout-main.tpl b/subprojects/groovy-templates/src/spec/test-resources/layout-main.tpl index 5c00422..189cdc6 100644 --- a/subprojects/groovy-templates/src/spec/test-resources/layout-main.tpl +++ b/subprojects/groovy-templates/src/spec/test-resources/layout-main.tpl @@ -1,3 +1,23 @@ +/* + * 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. + */ + +// tag::layout_main[] html { head { title(title) // <1> @@ -5,4 +25,5 @@ html { body { bodyContents() // <2> } -} \ No newline at end of file +} +// end::layout_main[] \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-groovy/blob/b9e1ba93/subprojects/groovy-templates/src/spec/test-resources/locale_include.tpl ---------------------------------------------------------------------- diff --git a/subprojects/groovy-templates/src/spec/test-resources/locale_include.tpl b/subprojects/groovy-templates/src/spec/test-resources/locale_include.tpl index 5e4cee2..a4a9426 100644 --- a/subprojects/groovy-templates/src/spec/test-resources/locale_include.tpl +++ b/subprojects/groovy-templates/src/spec/test-resources/locale_include.tpl @@ -1 +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. + */ + yield 'Default text' \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-groovy/blob/b9e1ba93/subprojects/groovy-templates/src/spec/test-resources/locale_include_fr_FR.tpl ---------------------------------------------------------------------- diff --git a/subprojects/groovy-templates/src/spec/test-resources/locale_include_fr_FR.tpl b/subprojects/groovy-templates/src/spec/test-resources/locale_include_fr_FR.tpl index 1ad69d0..8553b1e 100644 --- a/subprojects/groovy-templates/src/spec/test-resources/locale_include_fr_FR.tpl +++ b/subprojects/groovy-templates/src/spec/test-resources/locale_include_fr_FR.tpl @@ -1 +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. + */ + yield 'Texte en français' \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-groovy/blob/b9e1ba93/subprojects/groovy-templates/src/spec/test-resources/main.tpl ---------------------------------------------------------------------- diff --git a/subprojects/groovy-templates/src/spec/test-resources/main.tpl b/subprojects/groovy-templates/src/spec/test-resources/main.tpl index e71ed2c..26f6a30 100644 --- a/subprojects/groovy-templates/src/spec/test-resources/main.tpl +++ b/subprojects/groovy-templates/src/spec/test-resources/main.tpl @@ -1 +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. + */ + p 'test template' \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-groovy/blob/b9e1ba93/subprojects/groovy-templates/src/spec/test-resources/other_template.tpl ---------------------------------------------------------------------- diff --git a/subprojects/groovy-templates/src/spec/test-resources/other_template.tpl b/subprojects/groovy-templates/src/spec/test-resources/other_template.tpl index 1a0199c..6941677 100644 --- a/subprojects/groovy-templates/src/spec/test-resources/other_template.tpl +++ b/subprojects/groovy-templates/src/spec/test-resources/other_template.tpl @@ -1 +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. + */ + yield 'included as a template' \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-groovy/blob/b9e1ba93/subprojects/groovy-templates/src/test/resources/includes/body.tpl ---------------------------------------------------------------------- diff --git a/subprojects/groovy-templates/src/test/resources/includes/body.tpl b/subprojects/groovy-templates/src/test/resources/includes/body.tpl index 7248240..dfe8d99 100644 --- a/subprojects/groovy-templates/src/test/resources/includes/body.tpl +++ b/subprojects/groovy-templates/src/test/resources/includes/body.tpl @@ -1,3 +1,22 @@ +/* + * 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 { head { title(title) http://git-wip-us.apache.org/repos/asf/incubator-groovy/blob/b9e1ba93/subprojects/groovy-templates/src/test/resources/includes/hello.tpl ---------------------------------------------------------------------- diff --git a/subprojects/groovy-templates/src/test/resources/includes/hello.tpl b/subprojects/groovy-templates/src/test/resources/includes/hello.tpl index d572fca..10be479 100644 --- a/subprojects/groovy-templates/src/test/resources/includes/hello.tpl +++ b/subprojects/groovy-templates/src/test/resources/includes/hello.tpl @@ -1 +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. + */ + yield 'Hello from include!' \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-groovy/blob/b9e1ba93/subprojects/groovy-templates/src/test/resources/includes/hello_fr_FR.tpl ---------------------------------------------------------------------- diff --git a/subprojects/groovy-templates/src/test/resources/includes/hello_fr_FR.tpl b/subprojects/groovy-templates/src/test/resources/includes/hello_fr_FR.tpl index 08ddd1d..b47e843 100644 --- a/subprojects/groovy-templates/src/test/resources/includes/hello_fr_FR.tpl +++ b/subprojects/groovy-templates/src/test/resources/includes/hello_fr_FR.tpl @@ -1 +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. + */ + yield 'Bonjour!' \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-groovy/blob/b9e1ba93/subprojects/groovy-templates/src/test/resources/includes/typecheckedinclude.tpl ---------------------------------------------------------------------- diff --git a/subprojects/groovy-templates/src/test/resources/includes/typecheckedinclude.tpl b/subprojects/groovy-templates/src/test/resources/includes/typecheckedinclude.tpl index 20db0f5..9ab3807 100644 --- a/subprojects/groovy-templates/src/test/resources/includes/typecheckedinclude.tpl +++ b/subprojects/groovy-templates/src/test/resources/includes/typecheckedinclude.tpl @@ -1 +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. + */ + yield text.toUpperCase() \ No newline at end of file