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/openwebbeans-site.git


The following commit(s) were added to refs/heads/main by this push:
     new 88bff14  OpenWebBeans Ready
88bff14 is described below

commit 88bff1470a9dde5f0412ca9dfb8e3ad6f2097425
Author: Dave Fisher <[email protected]>
AuthorDate: Sun Jun 13 16:27:46 2021 -0700

    OpenWebBeans Ready
---
 README.md                 |   6 ++-
 migration/README.md       |  33 +++++++++++++++
 migration/changes.txt     | 104 ++++++++++++++++++++++++++++++++++++++++++++++
 theme/plugins/asfgenid.py |  60 +++++++++++++++++---------
 4 files changed, 183 insertions(+), 20 deletions(-)

diff --git a/README.md b/README.md
index b520d60..4e93e58 100644
--- a/README.md
+++ b/README.md
@@ -1 +1,5 @@
-# Bootstrap
\ No newline at end of file
+# 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..8549c28
--- /dev/null
+++ b/migration/README.md
@@ -0,0 +1,33 @@
+# CMS Migration
+
+1. Markdown conversions
+
+   - Rename from mdtext to md
+   - Fenced code blocks differ
+   - Hyperlinks to openwebbeans should be internal
+   - Fixed a bad elementid
+   - Updated your relase-checklist.md
+
+   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': True     # CMS used mdx_elementid features
+   - '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/migration/changes.txt b/migration/changes.txt
new file mode 100644
index 0000000..f2d60e3
--- /dev/null
+++ b/migration/changes.txt
@@ -0,0 +1,104 @@
+==== ./content/owbsetup_tomcat.md
+==== ./content/testing_arquillian.md
+==== ./content/misc/contact.md
+==== ./content/misc/legal.md
+==== ./content/examples.md
+18c18
+<   [2]: https://openwebbeans.apache.org/source.html
+---
+>   [2]: /source.html
+==== ./content/owbconfig.md
+==== ./content/testing_test-control.md
+==== ./content/openwebbeans-ee.md
+==== ./content/owbsetup_ee.md
+80c80
+<   [4]: download.html#maven-dep
+---
+>   [4]: /download.html#maven-dep
+87c87
+<   [12]: /download.html#plugins-version
+---
+>   [11]: /download.html#plugins-version
+==== ./content/community.md
+9c9
+< If you have troubles to find the information you are looking for, you can 
also ask in our [IRC-Channel](#IRC).
+---
+> If you have troubles to find the information you are looking for, you can 
also ask in our [IRC-Channel](#irc).
+==== ./content/testing_general.md
+==== ./content/owbsetup_se.md
+61d60
+<     :::java
+89c88
+<   [6]: /openwebbeans/samples.html
+\ No newline at end of file
+---
+>   [6]: /samples.html
+==== ./content/owbtest.md
+==== ./content/news.md
+==== ./content/samples.md
+==== ./content/openwebbeans-junit5.md
+==== ./content/owbinternalunittests.md
+==== ./content/source.md
+==== ./content/openwebbeans-tomcat.md
+18c18
+< [1]: https://openwebbeans.apache.org/owbsetup_ee.html
+\ No newline at end of file
+---
+> [1]: /owbsetup_ee.html
+\ No newline at end of file
+==== ./content/testing_cdictrl.md
+==== ./content/owb-eecontainers.md
+==== ./content/faq.md
+7c7
+<   - [Does OWB differ from the CDI-2.0 specification](#Does OWB differ from 
the CDI-2.0 specification)
+---
+>   - [Does OWB differ from the CDI-2.0 
specification](#does-owb-differ-from-the-cdi-20-specification)
+==== ./content/openwebbeans-web.md
+==== ./content/modules.md
+==== ./content/cdi_explained.md
+==== ./content/openwebbeans-resource.md
+==== ./content/openwebbeans-jms.md
+==== ./content/openwebbeans-el.md
+17c17
+<   [1]: https://openwebbeans.apache.org/owbsetup_ee.html
+\ No newline at end of file
+---
+>   [1]: /owbsetup_ee.html
+\ No newline at end of file
+==== ./content/openwebbeans-osgi.md
+==== ./content/openwebbeans-spi.md
+9,10c9
+< > extension and  replaceable components.
+< - [wikipedia][1]
+---
+> > extension and  replaceable components. - [wikipedia][1]
+==== ./content/comingsoon.md
+==== ./content/release-checklist.md
+98,101c98,101
+<     - Login to 
https://cms.apache.org/redirect?uri=https://openwebbeans.apache.org/
+<     - Edit news.mdtext
+<     - Edit download.mdtext
+<     - Publish via https://cms.apache.org/openwebbeans/publish  
+---
+>     - Browse https://github.com/apache/openwebbeans-site/tree/main/content
+>     - Edit news.md
+>     - Edit download.md
+>     - Committing will cause the site to be published
+==== ./content/documentation.md
+19c19
+<   - [Apache Meecrowave](https://openwebbeans.apache.org/meecrowave/)
+---
+>   - [Apache Meecrowave](/meecrowave/)
+==== ./content/openwebbeans-ee-common.md
+==== ./content/openwebbeans-ejb.md
+==== ./content/openwebbeans-impl.md
+==== ./content/openwebbeans-jsf.md
+29c29
+<   [1]: https://openwebbeans.apache.org/owbsetup_ee.html
+\ No newline at end of file
+---
+>   [1]: /owbsetup_ee.html
+\ No newline at end of file
+==== ./content/download.md
+==== ./content/openwebbeans-20-effort.md
+==== ./README.md
diff --git a/theme/plugins/asfgenid.py b/theme/plugins/asfgenid.py
index eddcb19..1a663f8 100644
--- a/theme/plugins/asfgenid.py
+++ b/theme/plugins/asfgenid.py
@@ -26,26 +26,26 @@ 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.
+    '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')
+    (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
@@ -68,6 +68,7 @@ PARA_MAP = {
 # 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):
@@ -263,7 +264,7 @@ def generate_toc(content, tags, title, toc_headers):
         # convert the HtmlTreeNode into Beautiful Soup
         tree_string = '{}'.format(tree)
         tree_soup = BeautifulSoup(tree_string, 'html.parser')
-        # Make the ToC availble to the theme's template
+        # 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:
@@ -272,6 +273,22 @@ def generate_toc(content, tags, title, toc_headers):
         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 """
@@ -303,7 +320,7 @@ def generate_id(content):
     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)
@@ -314,9 +331,14 @@ def generate_id(content):
     # page title
     title = content.metadata.get('title', 'Title')
     # assure relative source path is in the metadata
-    content.metadata['relative_source_path'] = content.relative_source_path
+    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)
 
@@ -373,7 +395,7 @@ def tb_connect(pel_ob):
     """Print any exception, before Pelican chews it into nothingness."""
     try:
         generate_id(pel_ob)
-    except:
+    except Exception:
         print('-----', file=sys.stderr)
         print('FATAL: %s' % (pel_ob.relative_source_path), file=sys.stderr)
         traceback.print_exc()

Reply via email to