You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@chemistry.apache.org by wa...@apache.org on 2021/06/14 21:32:15 UTC

[chemistry-site] 01/08: framework

This is an automated email from the ASF dual-hosted git repository.

wave pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/chemistry-site.git

commit 626ec37287c95f1f845a997ab69d150378733f0b
Author: Dave Fisher <da...@davefisher.tech>
AuthorDate: Mon Jun 14 12:58:36 2021 -0700

    framework
---
 LICENSE                          | 202 +++++++++++++++++++
 README.md                        |   5 +
 migration/README.md              |  34 ++++
 pelicanconf.py                   | 172 ++++++++++++++++
 requirements.txt                 |   2 +
 theme/apache/templates/base.html | 239 +++++++++++++++++++++++
 theme/apache/templates/page.html |   4 +
 theme/plugins/asfgenid.py        | 410 +++++++++++++++++++++++++++++++++++++++
 8 files changed, 1068 insertions(+)

diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..d645695
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,202 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..4e93e58
--- /dev/null
+++ b/README.md
@@ -0,0 +1,5 @@
+# Pelican ASF Website
+
+See [ASF-Pelican](https://infra.apache.org/asf-pelican.html)
+
+See [migration notes](migration/README.md)
diff --git a/migration/README.md b/migration/README.md
new file mode 100644
index 0000000..6b1de3d
--- /dev/null
+++ b/migration/README.md
@@ -0,0 +1,34 @@
+# CMS Migration
+
+1. Markdown conversions
+
+   - Rename from mdtext to md
+   - All files must have a title
+   - Metadata is a single line
+   - Tables must not have spaces in `|---|---|`
+   - Fenced code blocks differ
+   - Four spaces signal a code block adjust when it is a list
+
+   See [changes.txt](changes.txt)
+
+2. Theme Template
+
+   CMS templates were converted into `base.html`
+
+3. Configuration
+
+   See [pelicanconf.py](../pelicanconf.py)
+
+4. Pelican ASF plugin configuration
+
+   [asfgenid.py](../theme/plugins/asfgenid.py)
+
+   - 'unsafe_tags': True  # allow style, script, and iframe tags
+   - 'metadata': False    # no metadata replacement in markdown files
+   - 'elements': False    # CMS didn't use mdx_elementid featuresz
+   - 'headings': True     # Fix up headings w/ permalinks
+   - 'headings_re': r'^h[1-4]'
+   - 'permalinks': True,
+   - 'toc': False         # does not use [TOC]
+   - 'toc_headers': r"h[1-4]",
+   - 'tables': True       # Fix up for markdown table class
diff --git a/pelicanconf.py b/pelicanconf.py
new file mode 100644
index 0000000..95eb136
--- /dev/null
+++ b/pelicanconf.py
@@ -0,0 +1,172 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*- #
+# vim: encoding=utf-8
+#
+# 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
+#
+#   https://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.
+
+from __future__ import unicode_literals
+from datetime import date
+
+# import os
+# import sys
+
+PATH = 'content'
+
+TIMEZONE = 'UTC'
+
+DEFAULT_LANG = 'en'
+
+# Website specific settings
+SITEURL = 'https://chemistry.apache.org'
+SITEREPOSITORY = 'https://github.com/apache/chemistry-site/blob/main/content/'
+CURRENTYEAR = date.today().year
+
+# ASF Data specification
+ASF_DATA_YAML = "asfdata.yaml"
+
+# Save pages using full directory preservation
+PAGE_PATHS = ['.']
+
+# Template uses {{base}}
+BASE = '/'
+
+# Path with no extension
+PATH_METADATA = '(?P<path_no_ext>.*)\..*'
+
+# We are not slugifying any pages
+ARTICLE_URL = ARTICLE_SAVE_AS = PAGE_URL = PAGE_SAVE_AS = '{path_no_ext}.html'
+
+# If we wanted to have articles.
+# SLUGIFY_SOURCE = 'basename'
+# ARTICLE_SAVE_AS = '{slug}.html'
+
+# Disable these pages
+ARCHIVES_SAVE_AS = ''
+AUTHORS_SAVE_AS = ''
+CATEGORIES_SAVE_AS = ''
+INDEX_SAVE_AS = ''
+TAGS_SAVE_AS = ''
+
+# We want to serve our static files mixed with content.
+STATIC_PATHS = ['.']
+
+# we want any html to be served as is
+READERS = {'html': None}
+
+# We don't use articles, but we don't want pelican to think
+# that content/ contains articles.
+ARTICLE_PATHS = ['articles']
+
+# ignore README.md files in the content tree and the interviews and include folders.
+IGNORE_FILES = ['README.md']
+
+# No translations
+PAGE_TRANSLATION_ID = None
+
+# Enable ATOM feed and Disable other feeds
+FEED_DOMAIN = SITEURL
+FEED_ALL_ATOM = None
+CATEGORY_FEED_ATOM = None
+TRANSLATION_FEED_ATOM = None
+AUTHOR_FEED_ATOM = None
+AUTHOR_FEED_RSS = None
+
+# Theme
+THEME = './theme/apache'
+
+# Uncomment this to put the build date on every page.
+# DEFAULT_DATE = 'fs'
+
+# Pelican Plugins
+# pelican-gfm is installed in the buildbot as part of build_pelican.py. It is an ASF Infra custom plugin.
+# other plugins are discoverable and can be installed via pip by mentioning them in requirements.txt
+# You can find plugins here: https://github.com/pelican-plugins
+# Plugins that are custom for this site are found in PLUGIN_PATHS.
+PLUGIN_PATHS = ['./theme/plugins']
+# PLUGINS = ['asfgenid', 'asfdata', 'pelican-gfm', 'asfreader']
+# We are using the default plugin - 'pelican-gfm' which is installed by the build
+PLUGINS = ['asfgenid', 'pelican-gfm']
+
+# Lifecycle and plugins:
+# (1) Initialization:
+#     asfdata - populate a sitewide dictionary of ASF_DATA
+# (2) Readers process content into metadata and html
+#     pelican-gfm (GFMReader) - reads GFM Markdown with metadata and generates html
+#     asfreader (ASFReader) - reads GFM Markdown with embedded ezt templates uses metadata enhanced
+#          by the sitewide dictionary to generate markdown with ezt and then generate html
+# (3) HTML Content enhancement
+#     asfgenid - performs a series of enhancements to the HTML - see ASF_GENID
+# (4) Site generation
+#     sitemap - produces a sitemap.xml
+
+# Configure the asfdata plugin
+# ASF_DATA = {
+#    'data': ASF_DATA_YAML,
+#    'metadata': {
+#        'site_url': SITEURL
+#    },
+#    'debug': False
+# }
+
+# Configure the asfgenid plugin
+ASF_GENID = {
+    'unsafe_tags': True,
+    'metadata': False,
+    'elements': False,
+    'headings': True,
+    'headings_re': r'^h[1-4]',
+    'permalinks': True,
+    'toc': True,
+    'toc_headers': r"h[1-4]",
+    'tables': True,
+    'debug': False
+}
+
+# Sitemap Generator
+# SITEMAP = {
+#    "exclude": ["tag/", "category/"],
+#    "format": "xml",
+#    "priorities": {
+#        "articles": 0.1,
+#        "indexes": 0.1,
+#        "pages": 0.8
+#    },
+#    "changefreqs": {
+#        "articles": "never",
+#        "indexes": "never",
+#        "pages": "monthly"
+#    }
+# }
+
+# Markdown Configuration
+# When using GFMReader or ASFReader then MARKDOWN configuration is meaningless to GFM
+# MARKDOWN = {
+# }
+
+# TOC Generator
+# When using ASF_GENID TOC generation then this is unused.
+# TOC_HEADERS = r"h[1-6]"
+
+# Unused links
+LINKS = ( )
+SOCIAL = ( )
+
+DEFAULT_PAGINATION = False
+
+# Uncomment following line if you want document-relative URLs when developing
+# RELATIVE_URLS = True
diff --git a/requirements.txt b/requirements.txt
new file mode 100644
index 0000000..4b34fdf
--- /dev/null
+++ b/requirements.txt
@@ -0,0 +1,2 @@
+pelican
+BeautifulSoup4
diff --git a/theme/apache/templates/base.html b/theme/apache/templates/base.html
new file mode 100644
index 0000000..3e28d9e
--- /dev/null
+++ b/theme/apache/templates/base.html
@@ -0,0 +1,239 @@
+<!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">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <link type="text/css" rel="stylesheet" href="/resources/site.css" />
+    <script src="/resources/space.js" type="text/javascript"></script>
+    <meta name="keywords" content="CMIS, Content Management Interoperability Service, ECM, Enterprise Content Management, OASIS, integration standards, Chemistry, OpenCMIS, cmislib, DotCMIS, PortCMIS, ObjectiveCMIS" />
+    <meta name="description" content="Apache Chemistry, CMIS Implementation" />
+    <link rel="shortcut icon" href="/favicon.ico">
+    <title>Apache Chemistry - {{ page.title }}</title>
+    <style>
+.headerlink {
+    visibility: hidden;
+}
+dt:hover > .headerlink, p:hover > .headerlink, td:hover > .headerlink, h1:hover > .headerlink, h2:hover > .headerlink, h3:hover > .headerlink, h4:hover > .headerlink, h5:hover > .headerlink, h6:hover > .headerlink {
+    visibility: visible;
+}
+    </style>
+  </head>
+<body onload="init()">
+  <table width="100%" cellpadding="0" cellspacing="0">
+    <tr width="100%">
+      <td id="cell-0-0">&nbsp;</td>
+      <td id="cell-0-1">&nbsp;</td>
+      <td id="cell-0-2">&nbsp;</td>
+    </tr>
+    <tr width="100%">
+      <td id="cell-1-0">&nbsp;</td>
+      <td id="cell-1-1">
+        <div id="banner" style="padding: 0px;">
+          <!-- Banner -->
+          <A href="https://chemistry.apache.org/" title="Apache Chemistry">
+            <IMG src="/images/chemistry_tm_logo.png" style="float:left; border:0px;"/>
+          </A>
+          <A href="https://www.apache.org/" title="The Apache Software Foundation">
+            <IMG src="/images/asf-logo.png"  style="float:right; border:0px;"/>
+           </A>
+          <!-- Banner -->
+        </div>
+        <div id="top-menu">
+          <table border="0" cellpadding="1" cellspacing="0" width="100%">
+            <tr>
+              <td>
+                <div align="left">
+                <!-- Breadcrumbs -->
+{{ page.metadata.breadcrumbs }}
+                <!-- Breadcrumbs -->
+                </div>
+              </td>
+              <td>
+                <div align="right">
+                <!-- Quicklinks -->
+<P>
+<A href="https://www.apache.org/" class="external-link" rel="nofollow">Apache</A>
+|
+<A href="https://www.apache.org/licenses/LICENSE-2.0.html" class="external-link" rel="nofollow">License</A>
+</P>
+                <!-- Quicklinks -->
+                </div>
+              </td>
+            </tr>
+          </table>
+        </div>
+      </td>
+      <td id="cell-1-2">&nbsp;</td>
+    </tr>
+    <tr width="100%">
+      <td id="cell-2-0">&nbsp;</td>
+      <td id="cell-2-1">
+        <table>
+          <tr height="100%" valign="top">
+            <td height="100%">
+              <div id="wrapper-menu-page-right">
+                <div id="wrapper-menu-page-top">
+                  <div id="wrapper-menu-page-bottom">
+                    <div id="menu-page">
+                      <!-- NavigationBar -->
+
+<H3><A name="Navigation-Overview"></A>Overview</H3>
+
+<UL class="alternate" type="square">
+   <LI><A href="/project/cmis.html" title="What's CMIS">What is CMIS?</A></LI>
+   <LI><A href="https://www.apache.org/licenses/" class="external-link" rel="nofollow">License</A></LI>
+   <LI><A href="/project/community.html" title="Community">Community</A></LI>
+   <LI><A href="https://lists.apache.org/list.html?dev@chemistry.apache.org" class="external-link" rel="nofollow">Mailing List</A></LI>
+   <LI><A href="https://issues.apache.org/jira/browse/CMIS" class="external-link" rel="nofollow">Issue Tracking</A></LI>
+   <LI><A href="https://www.apache.org/security/" class="external-link" rel="nofollow">Security</A></LI>
+</UL>
+
+
+<H3><A name="Navigation-Search"></A>Search</H3>
+
+<DIV style="padding: 0px 0px 0px 20px;">
+<FORM action="https://www.google.com/search" method="get" style="font-size: 10px;">
+<INPUT name="ie" type="hidden" value="UTF-8"></INPUT>
+<INPUT name="oe" type="hidden" value="UTF-8"></INPUT>
+  <INPUT maxlength="255" name="q" size="12" type="text" value=""></INPUT>
+  <INPUT name="btnG" type="submit" value="Search"></INPUT>
+  <INPUT name="domains" type="hidden" value="chemistry.apache.org"></INPUT>
+  <INPUT name="sitesearch" type="hidden" value="chemistry.apache.org"></INPUT>
+</FORM>
+</DIV>
+
+
+<H3><A name="Navigation-CMISforJava"></A>CMIS for Java</H3>
+
+<UL class="alternate" type="square">
+  <LI><A href="/java/opencmis.html" title="OpenCMIS Overview and Index">Overview</A></LI>
+  <LI><A href="/java/download.html" title="Downloads">Downloads</A></LI>
+  <LI><A href="/docs/cmis-samples/" title="Downloads">Code Samples</A></LI>
+  <LI><A href="/java/javadoc">JavaDoc</A></LI>
+  <LI><A href="https://svn.apache.org/repos/asf/chemistry/opencmis/trunk/" class="external-link" rel="nofollow">Source Code</A></LI>
+</UL>
+
+
+<H3><A name="Navigation-CMISforPython"></A>CMIS for Python</H3>
+
+<UL class="alternate" type="square">
+  <LI><A href="/python/cmislib.html" title="cmislib">cmislib</A></LI>
+  <LI><A href="/python/docs/" rel="nofollow">cmislib Documentation</A></LI>
+  <LI><A href="https://svn.apache.org/repos/asf/chemistry/cmislib/trunk/" class="external-link" rel="nofollow">Source Code</A></LI>
+</UL>
+
+
+<H3><A name="Navigation-CMISforPHP"></A>CMIS for PHP</H3>
+
+<UL class="alternate" type="square">
+  <LI><A href="/php/phpclient.html" title="phpclient">CMIS PHP Client</A></LI>
+  <LI><A href="https://svn.apache.org/repos/asf/chemistry/phpclient/trunk/" class="external-link" rel="nofollow">Source Code</A></LI>
+</UL>
+
+
+<H3><A name="Navigation-CMISfor.NET"></A>CMIS for .NET</H3>
+
+<UL class="alternate" type="square">
+  <LI><A href="/dotnet/dotcmis.html" title="DotCMIS">DotCMIS</A></LI>
+  <LI><A href="https://svn.apache.org/repos/asf/chemistry/dotcmis/trunk/" class="external-link" rel="nofollow">DotCMIS Source Code</A></LI>
+  <LI><A href="/dotnet/portcmis.html" title="PortCMIS">PortCMIS</A></LI>
+  <LI><A href="https://svn.apache.org/repos/asf/chemistry/portcmis/trunk/" class="external-link" rel="nofollow">PortCMIS Source Code</A></LI>
+  <LI><A href="/docs/cmis-samples/" title="Downloads">Code Samples</A></LI>
+</UL>
+
+
+<H3><A name="Navigation-CMISforObjective-C"></A>CMIS for Objective-C</H3>
+
+<UL class="alternate" type="square">
+  <LI><A href="/objective-c/objectivecmis.html" title="ObjectiveCMIS">ObjectiveCMIS</A></LI>
+  <LI><A href="https://svn.apache.org/repos/asf/chemistry/objectivecmis/trunk/" class="external-link" rel="nofollow">Source Code</A></LI>
+</UL>
+
+<H3><A name="Navigation-CMISforJavaScript"></A>CMIS for JavaScript</H3>
+
+<UL class="alternate" type="square">
+  <LI><A href="/javascript/parts.html" title="Chemistry Parts">Chemistry Parts</A></LI>
+  <LI><A href="https://svn.apache.org/repos/asf/chemistry/parts/trunk/" class="external-link" rel="nofollow">Source Code</A></LI>
+</UL>
+
+
+<H3><A name="Navigation-Sponsorship"></A>Sponsorship</H3>
+
+<UL class="alternate" type="square">
+   <LI><A href="https://www.apache.org/foundation/thanks.html" class="external-link" rel="nofollow">Thanks</A></LI>
+   <LI><A href="https://www.apache.org/foundation/sponsorship.html" class="external-link" rel="nofollow">Sponsoring Apache</A></LI>
+</UL>
+
+
+<H3><A name="Navigation-Internal"></A>Internal Docs</H3>
+
+<UL class="alternate" type="square">
+   <LI><A href="/internal/internal-index.html" rel="nofollow"> Internal Documentation</A></LI>
+</UL>
+                    <!-- NavigationBar -->
+                    </div>
+                </div>
+              </div>
+            </div>
+           </td>
+           <td height="100%">
+             <!-- Content -->
+             <div class="wiki-content">{% block content %}{% endblock %}</div>
+             <!-- Content -->
+           </td>
+          </tr>
+        </table>
+     </td>
+     <td id="cell-2-2">&nbsp;</td>
+    </tr>
+    <tr width="100%">
+      <td id="cell-3-0">&nbsp;</td>
+      <td id="cell-3-1">&nbsp;</td>
+      <td id="cell-3-2">&nbsp;</td>
+    </tr>
+    <tr width="100%">
+     <td id="cell-3-0">&nbsp;</td>
+     <td id="cell-3-1">
+       <div id="footer">
+       <!-- Footer -->
+       <div id="site-footer">
+          Apache Chemistry, Apache, the Apache feather logo, and the Apache 
+          Chemistry project logo are trademarks of The Apache Software 
+          Foundation.
+          <br>
+          Content Management Interoperability Services (CMIS) is an
+          <a href="https://www.oasis-open.org/committees/cmis/">OASIS</a>
+          specification.
+       </div>
+       <!-- Footer -->
+       </div>
+     </td>
+     <td id="cell-3-2">&nbsp;</td>
+    </tr>
+    <tr width="100%">
+      <td id="cell-4-0">&nbsp;</td>
+      <td id="cell-4-1">&nbsp;</td>
+      <td id="cell-4-2">&nbsp;</td>
+    </tr>
+  </table>
+  <script type="text/javascript" src="/resources/retina.min.js"></script>
+</body>
+</html>
diff --git a/theme/apache/templates/page.html b/theme/apache/templates/page.html
new file mode 100644
index 0000000..426bff1
--- /dev/null
+++ b/theme/apache/templates/page.html
@@ -0,0 +1,4 @@
+{% extends "base.html" %}
+{% block content %}
+    {{ page.content }}
+{% endblock %}
diff --git a/theme/plugins/asfgenid.py b/theme/plugins/asfgenid.py
new file mode 100644
index 0000000..1a663f8
--- /dev/null
+++ b/theme/plugins/asfgenid.py
@@ -0,0 +1,410 @@
+'''
+asfgenid
+===================================
+Generates HeadingIDs, ElementID, and PermaLinks
+First find all specified IDs and classes. Assure unique ID and permalink
+Next find all headings missing IDs. Assure unique ID and permalink
+Generates a Table of Content
+'''
+
+# from __future__ import unicode_literals
+
+import sys
+import traceback
+import re
+import unicodedata
+
+from bs4 import BeautifulSoup, Comment
+
+import pelican.contents
+import pelican.plugins.signals
+
+'''
+Based on
+https://github.com/waylan/Python-Markdown/blob/master/markdown/extensions/headerid.py
+Which is BSD licensed, but is very much rewritten.
+'''
+
+ASF_GENID = {
+    'unsafe_tags': True,        # fix script, style, and iframe html that gfm filters as unsafe
+    'metadata': True,           # {{ metadata }} inclusion of data in the html.
+    'elements': True,	        # {#id} and {.class} annotations.
+    'headings': True,	        # add slugified id to headings missing id. Can be overridden by page metadata.
+    'headings_re': r'^h[1-6]',  # regex for which headings to check.
+    'permalinks': True,	        # add permalinks to elements and headings when id is added.
+    'toc': True,  	        # check for [TOC] and add Table of Content if present.
+    'toc_headers': r'h[1-6]',   # regex for which headings to include in the [TOC]
+    'tables': True,	        # add class="table" for tables missing class.
+    'debug': False
+}
+
+# Fixup tuples for HTML that GFM makes into text.
+FIXUP_UNSAFE = [
+    (re.compile(r'&lt;script'), '<script'),
+    (re.compile(r'&lt;/script'), '</script'),
+    (re.compile(r'&lt;style'), '<style'),
+    (re.compile(r'&lt;/style'), '</style'),
+    (re.compile(r'&lt;iframe'), '<iframe'),
+    (re.compile(r'&lt;/iframe'), '</iframe')
+]
+
+# Find {{ metadata }} inclusions
+METADATA_RE = re.compile(r'{{\s*(?P<meta>[-_:a-zA-Z0-9]+)\s*}}')
+
+# Find {#id} or {.class} elementid annotations
+ELEMENTID_RE = re.compile(r'(?:[ \t]*[{\[][ \t]*(?P<type>[#.])(?P<id>[-._:a-zA-Z0-9 ]+)[}\]])(\n|$)')
+
+# ID duplicates match
+IDCOUNT_RE = re.compile(r'^(.*)_([0-9]+)$')
+
+# For permalinks
+LINK_CHAR = 'ΒΆ'
+
+# strip permalink chars from headings for ToC
+PARA_MAP = {
+    ord(LINK_CHAR): None
+}
+
+# Find table tags - to check for ones without class attribute.
+TABLE_RE = re.compile(r'^table')
+
+
+# An item in a Table of Contents - from toc.py
+class HtmlTreeNode(object):
+    def __init__(self, parent, header, level, id):
+        self.children = []
+        self.parent = parent
+        self.header = header
+        self.level = level
+        self.id = id
+
+    def add(self, new_header):
+        new_level = new_header.name
+        new_string = new_header.string
+        new_id = new_header.attrs.get('id')
+
+        if not new_string:
+            new_string = new_header.find_all(
+                text=lambda t: not isinstance(t, Comment),
+                recursive=True)
+            new_string = ''.join(new_string)
+        new_string = new_string.translate(PARA_MAP)
+
+        if self.level < new_level:
+            new_node = HtmlTreeNode(self, new_string, new_level, new_id)
+            self.children += [new_node]
+            return new_node, new_header
+        elif self.level == new_level:
+            new_node = HtmlTreeNode(self.parent, new_string, new_level, new_id)
+            self.parent.children += [new_node]
+            return new_node, new_header
+        elif self.level > new_level:
+            return self.parent.add(new_header)
+
+    def __str__(self):
+        ret = ''
+        if self.parent:
+            ret = "<a class='toc-href' href='#{0}' title='{1}'>{1}</a>".format(
+                self.id, self.header)
+
+        if self.children:
+            ret += "<ul>{}</ul>".format('{}' * len(self.children)).format(
+                *self.children)
+
+        if self.parent:
+            ret = "<li>{}</li>".format(ret)
+
+        if not self.parent:
+            ret = "<div id='toc'>{}</div>".format(ret)
+
+        return ret
+
+
+# assure configuration
+def init_default_config(pelican):
+    from pelican.settings import DEFAULT_CONFIG
+
+    DEFAULT_CONFIG.setdefault('ASF_GENID', ASF_GENID)
+    if(pelican):
+        pelican.settings.setdefault('ASF_GENID', ASF_GENID)
+
+
+# from Apache CMS markdown/extensions/headerid.py - slugify in the same way as the Apache CMS
+def slugify(value, separator):
+    """ Slugify a string, to make it URL friendly. """
+    value = unicodedata.normalize('NFKD', value).encode('ascii', 'ignore')
+    value = re.sub('[^\\w\\s-]', '', value.decode('ascii')).strip().lower()
+    return re.sub('[%s\\s]+' % separator, separator, value)
+
+
+# Ensure an id is unique in a set of ids. Append '_1', '_2'... if not
+def unique(id, ids):
+    while id in ids or not id:
+        m = IDCOUNT_RE.match(id)
+        print(f'id="{id}" is a duplicate')
+        if m:
+            id = '%s_%d' % (m.group(1), int(m.group(2)) + 1)
+        else:
+            id = '%s_%d' % (id, 1)
+    ids.add(id)
+    return id
+
+
+# append a permalink
+def permalink(soup, mod_element):
+    new_tag = soup.new_tag('a', href='#' + mod_element['id'])
+    new_tag['class'] = 'headerlink'
+    new_tag['title'] = 'Permalink'
+    new_tag.string = LINK_CHAR
+    mod_element.append(new_tag)
+
+
+# fixup cmark content - note that this may be too hungry. It may need to occur later and skipped in codeblock and pre tags.
+def fixup_content(content):
+    text = content._content
+    modified = False
+    # Find messed up html
+    for regex, replace in FIXUP_UNSAFE:
+        m = regex.search(text)
+        if m:
+            modified = True
+            text = re.sub(regex, replace, text)
+    if modified:
+        content._content = text
+
+
+# expand metadata found in {{ key }}
+def expand_metadata(tag, metadata):
+    this_string = str(tag.string)
+    m = 1
+    modified = False
+    while m:
+        m = METADATA_RE.search(this_string)
+        if m:
+            this_data = m.group(1).strip()
+            format_string = '{{{0}}}'.format(this_data)
+            try:
+                new_string = format_string.format(**metadata)
+                print(f'{{{{{m.group(1)}}}}} -> {new_string}')
+            except Exception:
+                # the data expression was not found
+                print(f'{{{{{m.group(1)}}}}} is not found')
+                new_string = format_string
+            # replace the first pattern with the new_string
+            this_string = re.sub(METADATA_RE, new_string, this_string, count=1)
+            modified = True
+    if modified:
+        tag.string.replace_with(this_string)
+
+
+# do elementid transformation for {#id} and {.class} attribute annotations.
+def elementid_transform(ids, soup, tag, permalinks, perma_set, debug):
+    tagnav = tag.parent
+    this_string = str(tag.string)
+    if debug:
+        print(f'name = {tagnav.name}, string = {this_string}')
+    if tagnav.name not in ['[document]', 'code', 'pre']:
+        m = ELEMENTID_RE.search(tag.string)
+        if m:
+            # this replacement could be better it truncates and likely drops additional annotations
+            tag.string.replace_with(this_string[:m.start()])
+            if m.group('type') == '#':
+                # id attribute annotation
+                tagnav['id'] = unique(m.group('id'), ids)
+                if permalinks:
+                    permalink(soup, tagnav)
+                    unique(tagnav['id'], perma_set)
+                if debug:
+                    print(f'# insertion {tagnav}')
+            else:
+                # class attribute annotation (regex only recognizes the two types)
+                tagnav['class'] = m.group('id')
+                if debug:
+                    print(f'Class {tag.name} : {tagnav["class"]}')
+
+
+# generate id for a heading
+def headingid_transform(ids, soup, tag, permalinks, perma_set):
+    new_string = tag.string
+    if not new_string:
+        # roll up strings if no immediate string
+        new_string = tag.find_all(
+            text=lambda t: not isinstance(t, Comment),
+            recursive=True)
+        new_string = ''.join(new_string)
+
+    # don't have an id create it from text
+    new_id = slugify(new_string, '-')
+    tag['id'] = unique(new_id, ids)
+    if permalinks:
+        permalink(soup, tag)
+        # inform if there is a duplicate permalink
+        unique(tag['id'], perma_set)
+
+
+# generate table of contents from headings after [TOC] content
+def generate_toc(content, tags, title, toc_headers):
+    settoc = False
+    tree = node = HtmlTreeNode(None, title, 'h0', '')
+    # find the last [TOC]
+    taglast = tags[0]
+    for tag in tags:
+        taglast = tag
+    # find all headings after the final [TOC]
+    heading_re = re.compile(toc_headers)
+    for header in taglast.findAllNext(heading_re):
+        # we have heading content for the ToC
+        settoc = True
+        # add the heading.
+        node, _new_header = node.add(header)
+    # convert the ToC to Beautiful Soup
+    tree_soup = ''
+    if settoc:
+        print('  ToC')
+        # convert the HtmlTreeNode into Beautiful Soup
+        tree_string = '{}'.format(tree)
+        tree_soup = BeautifulSoup(tree_string, 'html.parser')
+        # Make the ToC available to the theme's template
+        content.toc = tree_soup.decode(formatter='html')
+    # replace the first [TOC] with the generated table of contents
+    for tag in tags:
+        tag.replaceWith(tree_soup)
+        # replace additional [TOC] with nothing
+        tree_soup = ''
+
+
+# create breadcrumb html
+def make_breadcrumbs(rel_source_path, title):
+    parts = rel_source_path.split('/')
+    url = '/'
+    crumbs = []
+    crumbs.append(f'<a href="/">Home</a>&nbsp;&raquo&nbsp;')
+    # don't process the filename part
+    last = len(parts)-1
+    for i in range(last):
+        url = f"{url}{parts[i]}/"
+        p = parts[i].capitalize()
+        crumbs.append(f'<a href="{url}">{p}</a>&nbsp;&raquo&nbsp;')
+    crumbs.append(f'<a href="#">{title}</a>')
+    return ''.join(crumbs)
+    
+
+# add the asfdata metadata into GFM content.
+def add_data(content):
+    """ Mix in ASF data as metadata """
+
+    # if the reader is 'asf' then the asf metadata is already in place during asfreader plugin.
+    if content.metadata.get('reader') != 'asf':
+        asf_metadata = content.settings.get('ASF_DATA', { }).get('metadata')
+        if asf_metadata:
+            content.metadata.update(asf_metadata)
+
+
+# main worker transforming the html
+def generate_id(content):
+    if isinstance(content, pelican.contents.Static):
+        return
+
+    # get plugin settings
+    asf_genid = content.settings['ASF_GENID']
+    # asf_headings setting may be overridden
+    asf_headings = content.metadata.get('asf_headings', str(asf_genid['headings']))
+
+    # show active plugins
+    if asf_genid['debug']:
+        print('asfgenid:\nshow plugins in case one is processing before this one')
+        for name in content.settings['PLUGINS']:
+            print(f'plugin: {name}')
+
+    # track the id tags
+    ids = set()
+    # track permalinks
+    permalinks = set()
+
+    # step 1 - fixup html that cmark marks unsafe - move to later?
+    if asf_genid['unsafe_tags']:
+        fixup_content(content)
+
+    # step 2 - prepare for genid processes
+    # parse html content into BeautifulSoup4
+    soup = BeautifulSoup(content._content, 'html.parser')
+    # page title
+    title = content.metadata.get('title', 'Title')
+    # assure relative source path is in the metadata
+    content.metadata['relative_source_path'] = rel_source_path = content.relative_source_path
+    # create breadcrumb html
+    content.metadata['breadcrumbs'] = breadcrumbs = make_breadcrumbs(rel_source_path, title)
+    # display output path and title
+    print(f'{content.relative_source_path} - {title}')
+    # if debug display breadcrumb html
+    if asf_genid['debug']:
+        print(f'    {breadcrumbs}')
+    # enhance metadata if done by asfreader
+    add_data(content)
+
+    # step 3 - metadata expansion
+    if asf_genid['metadata']:
+        if asf_genid['debug']:
+            print(f'metadata expansion: {content.relative_source_path}')
+        for tag in soup.findAll(string=METADATA_RE):
+            expand_metadata(tag, content.metadata)
+
+    # step 4 - find all id attributes already present
+    for tag in soup.findAll(id=True):
+        unique(tag['id'], ids)
+        # don't change existing ids
+
+    # step 5 - find all {#id} and {.class} text and assign attributes
+    if asf_genid['elements']:
+        if asf_genid['debug']:
+            print(f'elementid: {content.relative_source_path}')
+        for tag in soup.findAll(string=ELEMENTID_RE):
+            elementid_transform(ids, soup, tag, asf_genid['permalinks'], permalinks, asf_genid['debug'])
+
+    # step 6 - find all headings w/o ids already present or assigned with {#id} text
+    if asf_headings == 'True':
+        if asf_genid['debug']:
+            print(f'headings: {content.relative_source_path}')
+        # Find heading tags
+        HEADING_RE = re.compile(asf_genid['headings_re'])
+        for tag in soup.findAll(HEADING_RE, id=False):
+            headingid_transform(ids, soup, tag, asf_genid['permalinks'], permalinks)
+
+    # step 7 - find all tables without class
+    if asf_genid['tables']:
+        if asf_genid['debug']:
+            print(f'tables: {content.relative_source_path}')
+        for tag in soup.findAll(TABLE_RE, _class=False):
+            tag['class'] = 'table'
+
+    # step 8 - find TOC tag and generate Table of Contents
+    if asf_genid['toc']:
+        tags = soup('p', text='[TOC]')
+        if tags:
+            generate_toc(content, tags, title, asf_genid['toc_headers'])
+
+    # step 9 - reset the html content
+    content._content = soup.decode(formatter='html')
+
+    # step 10 - output all of the permalinks created
+    for tag in permalinks:
+        print(f'    #{tag}')
+
+
+def tb_connect(pel_ob):
+    """Print any exception, before Pelican chews it into nothingness."""
+    try:
+        generate_id(pel_ob)
+    except Exception:
+        print('-----', file=sys.stderr)
+        print('FATAL: %s' % (pel_ob.relative_source_path), file=sys.stderr)
+        traceback.print_exc()
+        # if we have errors in this module then we want to quit to avoid erasing the site
+        sys.exit(4)
+
+
+def register():
+    pelican.plugins.signals.initialized.connect(init_default_config)
+
+
+pelican.plugins.signals.content_object_init.connect(tb_connect)