You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@freemarker.apache.org by dd...@apache.org on 2017/01/06 19:39:56 UTC

incubator-freemarker-docgen git commit: Changed footer layout to accept arbitrary long copyright text. Added copyrightSuffix setting, where you can add the trademark notes and such.

Repository: incubator-freemarker-docgen
Updated Branches:
  refs/heads/master 05ddf9339 -> f968b192e


Changed footer layout to accept arbitrary long copyright text. Added copyrightSuffix setting, where you can add the trademark notes and such.


Project: http://git-wip-us.apache.org/repos/asf/incubator-freemarker-docgen/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-freemarker-docgen/commit/f968b192
Tree: http://git-wip-us.apache.org/repos/asf/incubator-freemarker-docgen/tree/f968b192
Diff: http://git-wip-us.apache.org/repos/asf/incubator-freemarker-docgen/diff/f968b192

Branch: refs/heads/master
Commit: f968b192e16eb497dbab74318486cd8f4b8874d7
Parents: 05ddf93
Author: ddekany <dd...@apache.org>
Authored: Fri Jan 6 20:39:55 2017 +0100
Committer: ddekany <dd...@apache.org>
Committed: Fri Jan 6 20:39:55 2017 +0100

----------------------------------------------------------------------
 src/main/org/freemarker/docgen/Transform.java   | 12 +++++++--
 .../docgen/less/lib/layout/footer.less          | 24 +++--------------
 .../org/freemarker/docgen/templates/footer.ftlh | 28 ++++++++++----------
 3 files changed, 28 insertions(+), 36 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-freemarker-docgen/blob/f968b192/src/main/org/freemarker/docgen/Transform.java
----------------------------------------------------------------------
diff --git a/src/main/org/freemarker/docgen/Transform.java b/src/main/org/freemarker/docgen/Transform.java
index a9482f1..c379bf3 100644
--- a/src/main/org/freemarker/docgen/Transform.java
+++ b/src/main/org/freemarker/docgen/Transform.java
@@ -376,8 +376,9 @@ import freemarker.template.utility.StringUtil;
  *           "Edited with XXE" logo should be shown on the generated pages.
  *           Defaults to <tt>false</tt>.
  *           
- *         <li><p><tt>copyrightStartYear</tt> (String): Used in the page footer copyright notice. 
- *         <li><p><tt>copyrightHolder</tt> (String): Used in the page footer copyright notice.
+ *         <li><p><tt>copyrightHolder</tt> (String): Required. Used in the page footer copyright notice.
+ *         <li><p><tt>copyrightStartYear</tt> (String): Required. Used in the page footer copyright notice. 
+ *         <li><p><tt>copyrightSuffix</tt> (String): Optional. Appended after the generated copyright text.
  *         <li><p><tt>copyrightCommentFile</tt> (String): The path of a HTML file to the text used inside
  *         the output files as copyright header comment. If this path is relative, it's relative to the source
  *         directory. Currently, the copyright comment is only inserted if the {@code offline} mode is {@code true}.
@@ -487,6 +488,7 @@ public final class Transform {
     static final String SETTING_EXTERNAL_BOOKMARKS = "externalBookmarks";
     static final String SETTING_COPYRIGHT_HOLDER = "copyrightHolder";
     static final String SETTING_COPYRIGHT_START_YEAR = "copyrightStartYear";
+    static final String SETTING_COPYRIGHT_SUFFIX = "copyrightSuffix";
     static final String SETTING_COPYRIGHT_COMMENT_FILE = "copyrightCommentFile";
     static final String SETTING_SEO_META = "seoMeta";
     static final String SETTING_LOGO = "logo";
@@ -574,6 +576,7 @@ public final class Transform {
     private static final String VAR_LOGO = SETTING_LOGO;
     private static final String VAR_COPYRIGHT_HOLDER = SETTING_COPYRIGHT_HOLDER;
     private static final String VAR_COPYRIGHT_START_YEAR = SETTING_COPYRIGHT_START_YEAR;
+    private static final String VAR_COPYRIGHT_SUFFIX = SETTING_COPYRIGHT_SUFFIX;
     private static final String VAR_SEO_META_TITLE_OVERRIDE = "seoMetaTitleOverride";
     private static final String VAR_SEO_META_FULL_TITLE_OVERRIDE = "seoMetaFullTitleOverride";
     private static final String VAR_SEO_META_DESCRIPTION = "seoMetaDescription";
@@ -779,6 +782,7 @@ public final class Transform {
     private HashMap<String, String> logo;
 
     private String copyrightHolder;
+    private String copyrightSuffix;
     private Integer copyrightStartYear;
     private String copyrightComment;
     private String copyrightJavaComment;
@@ -944,6 +948,8 @@ public final class Transform {
                     copyrightHolder = castSettingToString(cfgFile, settingName, settingValue);
                 } else if (settingName.equals(SETTING_COPYRIGHT_START_YEAR)) {
                     copyrightStartYear = castSettingToInt(cfgFile, settingName, settingValue);
+                } else if (settingName.equals(SETTING_COPYRIGHT_SUFFIX)) {
+                    copyrightSuffix = castSettingToString(cfgFile, settingName, settingValue);
                 } else if (settingName.equals(SETTING_COPYRIGHT_COMMENT_FILE)) {
                     copyrightComment = StringUtil.chomp(getFileContentForSetting(cfgFile, settingName, settingValue));
                     String eol = TextUtil.detectEOL(copyrightComment, "\n");
@@ -1361,6 +1367,8 @@ public final class Transform {
             fmConfig.setSharedVariable(
                     VAR_COPYRIGHT_HOLDER, copyrightHolder);
             fmConfig.setSharedVariable(
+                    VAR_COPYRIGHT_SUFFIX, copyrightSuffix);
+            fmConfig.setSharedVariable(
                     VAR_COPYRIGHT_START_YEAR, copyrightStartYear);
             fmConfig.setSharedVariable(
                     VAR_COPYRIGHT_COMMENT, copyrightComment);

http://git-wip-us.apache.org/repos/asf/incubator-freemarker-docgen/blob/f968b192/src/main/org/freemarker/docgen/less/lib/layout/footer.less
----------------------------------------------------------------------
diff --git a/src/main/org/freemarker/docgen/less/lib/layout/footer.less b/src/main/org/freemarker/docgen/less/lib/layout/footer.less
index df5a9ee..f7cb92a 100644
--- a/src/main/org/freemarker/docgen/less/lib/layout/footer.less
+++ b/src/main/org/freemarker/docgen/less/lib/layout/footer.less
@@ -134,27 +134,11 @@
 
 .footer-bottom {
 
-  padding: 45px 0 30px;
-
-  @media (min-width: @screen-sm-min) {
-    display: flex;
-    justify-content: space-between;
-    flex-wrap: wrap;
-  }
-
+  padding: 45px 0 25px;
+  font-size: 12px;
+  
   p {
     margin: 0 0 6px;
-    flex: 0 1 auto;
-    -webkit-box-flex: 1;
-  }
-
-  .generated-for-product {
-    font-size: 12px;
-    display: block;
-  }
-
-  .last-updated {
-    font-size: 12px;
-    display: block;
   }
+  
 }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker-docgen/blob/f968b192/src/main/org/freemarker/docgen/templates/footer.ftlh
----------------------------------------------------------------------
diff --git a/src/main/org/freemarker/docgen/templates/footer.ftlh b/src/main/org/freemarker/docgen/templates/footer.ftlh
index ac43e17..29d9a27 100644
--- a/src/main/org/freemarker/docgen/templates/footer.ftlh
+++ b/src/main/org/freemarker/docgen/templates/footer.ftlh
@@ -22,8 +22,6 @@
 
 <#macro footer>
   <#compress>
-    <#local book = .node?root.*>
-
     <div class="site-footer"><#t>
       <#-- keep site-width inside so background extends -->
       <div class="site-width"><#t>
@@ -47,13 +45,8 @@
           </div><#t>
         </#if>
         <div class="footer-bottom"><#t>
-            <p><#t>
-              <#if book.info.productname?hasContent>
-                <span class="generated-for-product">Generated for: ${book.info.productname}</span><#t>
-              </#if>
-              <span class="last-updated"><@lastGenerated /></span><#t>
-            </p><#t>
-            <@copyright /><#t>
+          <@lastGenerated />
+          <@copyright />
         </div><#t>
       </div><#t>
     </div><#t>
@@ -62,10 +55,16 @@
 
 
 <#macro lastGenerated>
-  Last generated:
-  <time itemprop="dateModified" datetime="${transformStartTime?datetime?isoUtc}" title="${transformStartTime?datetime?string.full}"><#t>
-    ${transformStartTime?string('yyyy-MM-dd HH:mm:ss z')}<#t>
-  </time><#t>
+  <p class="last-generated">
+    Last generated:
+    <time itemprop="dateModified" datetime="${transformStartTime?datetime?isoUtc}" title="${transformStartTime?datetime?string.full}"><#t>
+      ${transformStartTime?string('yyyy-MM-dd HH:mm:ss z')}<#t>
+    </time><#t>
+    <#local book = .node?root.*>
+    <#if book.info.productname?hasContent>
+      , for ${book.info.productname}<#t>
+    </#if>
+  </p>
 </#macro>
 
 
@@ -73,7 +72,8 @@
   <p class="copyright">
     � <span itemprop="copyrightYear">${copyrightStartYear?string('0')}</span><#rt>
     <#lt><#if transformStartTime?string('yyyy')?number != copyrightStartYear>\u2013${transformStartTime?string('yyyy')}</#if>
-    <a itemtype="http://schema.org/Organization" itemprop="copyrightHolder" href="http://freemarker.org">${copyrightHolder}</a>. All rights reserved.<#t>
+    <a itemtype="http://schema.org/Organization" itemprop="copyrightHolder" href="http://freemarker.org">${copyrightHolder}</a><#t>
+    <#if copyrightSuffix??>. ${copyrightSuffix}</#if><#t>
   </p>
 </#macro>
 


Re: incubator-freemarker-docgen git commit: Changed footer layout to accept arbitrary long copyright text. Added copyrightSuffix setting, where you can add the trademark notes and such.

Posted by Daniel Dekany <dd...@freemail.hu>.
Thanks, I have fixed this!


Monday, January 23, 2017, 9:00:04 AM, Jacopo Cappellato wrote:

> On Fri, Jan 6, 2017 at 8:39 PM, <dd...@apache.org> wrote:
>
>> Repository: incubator-freemarker-docgen
>> Updated Branches:
>>   refs/heads/master 05ddf9339 -> f968b192e
>>
>>
>> Changed footer layout to accept arbitrary long copyright text. Added
>> copyrightSuffix setting, where you can add the trademark notes and such.
>> [...]
>>
>> http://git-wip-us.apache.org/repos/asf/incubator-freemarker-docgen/blob/
>> f968b192/src/main/org/freemarker/docgen/templates/footer.ftlh
>> ----------------------------------------------------------------------
>> diff --git a/src/main/org/freemarker/docgen/templates/footer.ftlh
>> b/src/main/org/freemarker/docgen/templates/footer.ftlh
>> index ac43e17..29d9a27 100644
>> --- a/src/main/org/freemarker/docgen/templates/footer.ftlh
>> +++ b/src/main/org/freemarker/docgen/templates/footer.ftlh
>>
>> @@ -73,7 +72,8 @@
>>    <p class="copyright">
>>      � <span itemprop="copyrightYear">${copyrightStartYear?string('0')
>> }</span><#rt>
>>      <#lt><#if transformStartTime?string('yyyy')?number !=
>> copyrightStartYear>\u2013${transformStartTime?string('yyyy')}</#if>
>> -    <a itemtype="http://schema.org/Organization"
>> itemprop="copyrightHolder" href="http://freemarker.org">${copyrightHolder}</a>.
>> All rights reserved.<#t>
>> +    <a itemtype="http://schema.org/Organization"
>> itemprop="copyrightHolder" href="http://freemarker.org">$
>> {copyrightHolder}</a><#t>
>> +    <#if copyrightSuffix??>. ${copyrightSuffix}</#if><#t>
>>    </p>
>>  </#macro>
>>
>
> This is minor but I think we should change the url of the "copyright
> holder" from freemarker.org to apache.org.
>
> Jacopo

-- 
Thanks,
 Daniel Dekany


Re: incubator-freemarker-docgen git commit: Changed footer layout to accept arbitrary long copyright text. Added copyrightSuffix setting, where you can add the trademark notes and such.

Posted by Jacopo Cappellato <ja...@gmail.com>.
On Fri, Jan 6, 2017 at 8:39 PM, <dd...@apache.org> wrote:

> Repository: incubator-freemarker-docgen
> Updated Branches:
>   refs/heads/master 05ddf9339 -> f968b192e
>
>
> Changed footer layout to accept arbitrary long copyright text. Added
> copyrightSuffix setting, where you can add the trademark notes and such.
> [...]
>
> http://git-wip-us.apache.org/repos/asf/incubator-freemarker-docgen/blob/
> f968b192/src/main/org/freemarker/docgen/templates/footer.ftlh
> ----------------------------------------------------------------------
> diff --git a/src/main/org/freemarker/docgen/templates/footer.ftlh
> b/src/main/org/freemarker/docgen/templates/footer.ftlh
> index ac43e17..29d9a27 100644
> --- a/src/main/org/freemarker/docgen/templates/footer.ftlh
> +++ b/src/main/org/freemarker/docgen/templates/footer.ftlh
>
> @@ -73,7 +72,8 @@
>    <p class="copyright">
>      © <span itemprop="copyrightYear">${copyrightStartYear?string('0')
> }</span><#rt>
>      <#lt><#if transformStartTime?string('yyyy')?number !=
> copyrightStartYear>–${transformStartTime?string('yyyy')}</#if>
> -    <a itemtype="http://schema.org/Organization"
> itemprop="copyrightHolder" href="http://freemarker.org">${copyrightHolder}</a>.
> All rights reserved.<#t>
> +    <a itemtype="http://schema.org/Organization"
> itemprop="copyrightHolder" href="http://freemarker.org">$
> {copyrightHolder}</a><#t>
> +    <#if copyrightSuffix??>. ${copyrightSuffix}</#if><#t>
>    </p>
>  </#macro>
>

This is minor but I think we should change the url of the "copyright
holder" from freemarker.org to apache.org.

Jacopo