From 3a35409dc1850ed03d4917a2974225b913b6a396 Mon Sep 17 00:00:00 2001 From: Alejandro Villar Date: Mon, 16 Sep 2024 10:52:15 +0200 Subject: [PATCH] Remove slate templates --- ogc/bblocks/templates/slate/index.html.md | 227 ---------------------- ogc/bblocks/templates/slate/metadata.yaml | 1 - 2 files changed, 228 deletions(-) delete mode 100644 ogc/bblocks/templates/slate/index.html.md delete mode 100644 ogc/bblocks/templates/slate/metadata.yaml diff --git a/ogc/bblocks/templates/slate/index.html.md b/ogc/bblocks/templates/slate/index.html.md deleted file mode 100644 index ae9b960..0000000 --- a/ogc/bblocks/templates/slate/index.html.md +++ /dev/null @@ -1,227 +0,0 @@ ---- -title: ${bblock.name} (${bblock.itemClass.capitalize()}) -% if bblock.examples: -<% - lang_aliases = { - 'txt': 'plaintext', - 'json-ld': 'jsonld', - 'ttl': 'turtle', - } - known_langs = { - 'json': 'JSON', - 'turtle': 'RDF/Turtle', - 'plaintext': 'Plain text', - 'yaml': 'YAML', - 'java': 'Java', - 'python': 'Python', - 'javascript': 'Javascript', - 'jsonld': 'JSON-LD', - } - langs = {lang_aliases.get(snippet['language'].lower(), snippet['language']): True - for example in bblock.examples for snippet in example.get('snippets', []) if snippet.get('code', '').strip()} -%> - % if len(langs) > 1: -language_tabs: - % for lang in langs: - - ${lang}${(': ' + known_langs[lang]) if lang in known_langs else ''} - % endfor - % endif -% endif - -toc_footers: - - Version ${bblock.version} - - ${bblock.name} - - Building Blocks register - -search: true - -code_clipboard: true - -meta: - - name: ${bblock.name} (${bblock.itemClass.capitalize()}) ---- -<% -import re, os, urllib.parse, json -treedocviewer_options = '&option={}'.format(urllib.parse.quote_plus('{"showTable": false}')) -%> - -${'#'} ${bblock.name} `${bblock.identifier}` - -${bblock.abstract} - -

- Status: - ${bblock.status.replace('-', ' ').capitalize()} -

- -% if bblock.validationPassed: - -% else: - -% endif - -% if bblock.description: -${'#'} Description - -${bblock.description.replace('@@assets@@', assets_rel or '')} -% endif -% if bblock.examples: -${'#'} Examples - % for example in bblock.examples: - -${'##'} ${example.get('title', f"Example {loop.index + 1}")} - - % for snippet in example.get('snippets', []): -% if snippet.get('code', '').strip(): - -<% - snippet_lang = lang_aliases.get(snippet['language'].lower(), snippet['language']) - snippet_url = snippet.get('url') - snippet_expand = snippet.get('expand-level', 2) -%> -```${snippet_lang} -${snippet['code']} -``` - % if snippet_url: - -
- - % elif snippet_lang in ('json-ld', 'jsonld'): - View on JSON-LD Playground - % elif snippet_lang == 'yaml': - View on YAML Viewer - % endif -
- - % endif -% endif - - % endfor - % if example.get('content'): -${example['content'].replace('@@assets@@', assets_rel or '')} - - %endif - % endfor -% endif -% if bblock.schema.is_file(): - -${'#'} JSON Schema - -```yaml--schema -${bblock.annotated_schema_contents} -``` - -> View on YAML Viewer - -Links to the schema: - -* YAML version: ${bblock.metadata['schema']['application/yaml']} -* JSON version: ${bblock.metadata['schema']['application/json']} - -% endif -% if bblock.ldContext: - -${'#'} JSON-LD Context - -```json--ldContext -${bblock.jsonld_context_contents} -``` - -> View on JSON-LD Playground - -You can find the full JSON-LD context here: -${bblock.ldContext} - -% endif -% if bblock.shaclRules: -${'#'} Validation - -${'##'} SHACL Shapes - -The following sets of SHACL shapes are used for validating this building block: - - % for shacl_bblock_id, shacl_rules in bblock.shaclRules.items(): - % if bblocks_register.get(shacl_bblock_id): -* ${bblocks_register.get(shacl_bblock_id).get('name')} ${shacl_bblock_id} - % else: -* `${shacl_bblock_id}` - % endif - % for rule in shacl_rules: - % if rule.startswith('http://') or rule.startswith('https://'): - * [${rule}](${rule}) - % else: - * `${rule}` - % endif - % endfor - % endfor - -% endif -% if bblock.transforms: -${'#'} Transforms - - % for transform in bblock.transforms: -${'## ' + transform['title']} ${transform['type']} - -``` -${transform['code']} -``` - % if len(transform['mime-types']['source']) > 1: -* Source MIME types: - % for mt in transform['mime-types']['source']: - * `${mt}` - % endfor - % else: -* Source MIME type: `${transform['mime-types']['source'][0]}` - % endif -* Target MIME type: `${transform['mime-types']['target']}` -* Types of outputs generated: - % for t in transform['output-types']: - * ${t['label']} (`${t['identifier']}`) - % endfor -* Link: [${transform['ref']}](${transform['ref']}) - - % endfor -% endif -% if bblock.sources: -${'#'} References - - % for source in bblock.sources: - % if source.get('link'): -* [${source['title']}](${source['link']}) - % else: -* ${source['title']} - % endif - % endfor - -% endif -% if git_repo: -${'#'} For developers - -The source code for this Building Block can be found in the following repository: - -* URL: ${git_repo} -* Path: -% if git_repo.startswith('https://github.com/'): -${git_path} -% else: -`${git_path}` -% endif - -% endif \ No newline at end of file diff --git a/ogc/bblocks/templates/slate/metadata.yaml b/ogc/bblocks/templates/slate/metadata.yaml deleted file mode 100644 index e947975..0000000 --- a/ogc/bblocks/templates/slate/metadata.yaml +++ /dev/null @@ -1 +0,0 @@ -template-file: index.html.md