Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/ibexa_engage/install_ibexa_engage.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
description: Install and configure Ibexa Engage.
description: Install and configure [[= product_name_engage =]].

Check failure on line 2 in docs/ibexa_engage/install_ibexa_engage.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/ibexa_engage/install_ibexa_engage.md#L2

[Ibexa.Spellcheck] Did you really mean 'product_name_engage'?
Raw output
{"message": "[Ibexa.Spellcheck] Did you really mean 'product_name_engage'?", "location": {"path": "docs/ibexa_engage/install_ibexa_engage.md", "range": {"start": {"line": 2, "column": 40}}}, "severity": "ERROR"}
edition: experience
---

# Ibexa Engage
# [[= product_name_engage =]]

[[= product_name_engage =]] is a data collection tool. It enables you to engage your audiences by using the [Qualifio](https://qualifio.com/) tools.
You can use interactive content to gather valuable data, for example, customer data or recent orders list, and create connections.
Expand Down Expand Up @@ -52,4 +52,4 @@
[[= product_name_base =]] configures the `channel` and `client_id` values so that the selections can be filled up automatically on [[= product_name =]] side.

The `feed_url` and `variable_map` values don't need to be set at the installation process.
They're preconfigured and can be overwritten.
They're preconfigured and can be overwritten.
2 changes: 1 addition & 1 deletion docs/resources/release_process_and_roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
description: "Ibexa DXP releases new versions periodically in different flavors: Ibexa Headless, Ibexa Experience and Ibexa Commerce, plus open-source Ibexa OSS."
---

# Ibexa DXP release process and roadmap
# [[= product_name =]] release process and roadmap

## Release process

Expand Down
28 changes: 28 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"""


def define_env(env):

Check failure on line 23 in main.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Refactor this function to reduce its Cognitive Complexity from 86 to the 15 allowed.

See more on https://sonarcloud.io/project/issues?id=ezsystems_developer-documentation&issues=AZ1EEYrP7mz1CkBvKfqe&open=AZ1EEYrP7mz1CkBvKfqe&pullRequest=3116
"""
This is the hook for defining variables, macros and filters

Expand Down Expand Up @@ -64,6 +64,9 @@

if isinstance(pages, str):
pages = [pages]
variables = env.conf.get('extra', {})
var_start = env.config['j2_variable_start_string']
var_end = env.config['j2_variable_end_string']
cards = []
for page_data in pages:
if isinstance(page_data, tuple):
Expand Down Expand Up @@ -144,6 +147,8 @@
href = page
title = custom_title if custom_title else current_meta['short'] or current_meta['title']
description = custom_description if custom_description else current_meta['description'] or " "
title = resolve_variables(title, var_start, var_end, variables)
description = resolve_variables(description, var_start, var_end, variables)

cards.append(
CARDS_TEMPLATE % (
Expand Down Expand Up @@ -231,6 +236,16 @@
def release_note_entry_end() -> str:
return "</div>"

def resolve_variables(text, var_start, var_end, variables):
"""Replace variable references (e.g. [[= var =]]) with variables."""
pattern = re.escape(var_start) + r'\s*([\w.]+)\s*' + re.escape(var_end)
def replacer(match):
key = match.group(1).strip()
if key not in variables:
raise KeyError("Undefined variable '%s' used in cards macro" % key)
return str(variables[key])
return re.sub(pattern, replacer, text)

def slugify(text: str) -> str:
return text.lower().replace(' ', '-')

Expand All @@ -242,3 +257,16 @@
raise ValueError(
"Unknown category: {category}. Available categories are: {available_categories}".format(category=category, available_categories=" ".join(available_categories))
)


def on_pre_page_macros(env):
"""
Resolve variable references in the page's description front matter field
so that they are substituted before MkDocs renders the <meta> tag.
"""
page = env._page
if page.meta and 'description' in page.meta:
page.meta['description'] = env.render(
markdown=page.meta['description'],
force_rendering=True
)
Loading