Skip to content
Merged
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
72 changes: 71 additions & 1 deletion docs/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ body {
}

.md-typeset h1 {
margin: 0 0 1rem;
margin: 0 0 0.5rem;
font-size: 24px;
line-height: 34px;
}
Expand Down Expand Up @@ -649,3 +649,73 @@ div.path {
[hidden] {
display: none !important;
}

.page-actions {
display: none;
gap: 0;
margin: 12px 0 2rem 0;
padding-bottom: 6px;
border-bottom: 1px solid var(--ibexa-snow);
}

.md-typeset .page-action-btn {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 4px 12px;
background: transparent;
border: none;
text-decoration: none;
color: var(--ibexa-dusk-black);
font-size: 13px;
font-weight: 500;
cursor: pointer;
transition: color 0.15s ease;
white-space: nowrap;
position: relative;
}

.page-action-btn+.page-action-btn::before {
content: '';
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
height: 16px;
width: 1px;
background: var(--ibexa-snow);
}

.page-action-btn svg {
width: 14px;
height: 14px;
fill: currentColor;
flex-shrink: 0;
}

.page-action-btn.external::after,
.page-action-btn[rel="nofollow"]::after {
display: none;
}

@media (max-width: 768px) {
.page-actions {
gap: 0;
}
}

.page-actions--visible {
display: flex;
}

.page-action-btn.page-action-btn--success {
background: #d4edda;
border-color: #c3e6cb;
color: #155724;
}

.page-action-btn.page-action-btn--info {
background: color-mix(in srgb, var(--turquoise-pearl) 25%, white);
border-color: color-mix(in srgb, var(--turquoise-pearl) 40%, white);
color: var(--sherpa-blue);
}
2 changes: 1 addition & 1 deletion docs/css/navigation.css
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@
.md-typeset ul.breadcrumbs {
margin-left: 0;
margin-top: 0;
padding-bottom: 2rem;
padding-bottom: 0.5rem;
}

ul.breadcrumbs li.breadcrumb-item {
Expand Down
1 change: 1 addition & 0 deletions docs/personalization/configure_models.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
description: Configure models by setting up a timeframe, segments and other settings that define which content items are recommended.
exclude_from_llmstxt: true
---

# Configure models
Expand Down
1 change: 1 addition & 0 deletions docs/personalization/configure_personalization.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
description: Configure your Personalization service by setting up models and scenarios which define which content items are recommended.
exclude_from_llmstxt: true
---

# Configure personalization
Expand Down
1 change: 1 addition & 0 deletions docs/personalization/configure_scenarios.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
description: Configure models by setting up a timeframe, segments and other settings that define which content items are recommended.
exclude_from_llmstxt: true
---

# Configure scenarios
Expand Down
1 change: 1 addition & 0 deletions docs/personalization/content_import.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
description: Importing existing data enables the Personalization service to provide better results for recommendations.
exclude_from_llmstxt: true
---

# Import source data
Expand Down
1 change: 1 addition & 0 deletions docs/personalization/content_types.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
description: Types of content in the Personalization service allow building different recommendations for different parts of our content model.
exclude_from_llmstxt: true
---

# Types of content
Expand Down
1 change: 1 addition & 0 deletions docs/personalization/enable_personalization.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
description: Enabling the Personalization service requires an installation key provided by Ibexa.
exclude_from_llmstxt: true
---

# Enable personalization
Expand Down
1 change: 1 addition & 0 deletions docs/personalization/event_types.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
description: Recommendations rely on tracking different events that describe users' behavior on the website.
exclude_from_llmstxt: true
---

# Events
Expand Down
1 change: 1 addition & 0 deletions docs/personalization/filters.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
description: Filters enable you to fine-tune recommendation results by eliminating, demoting, or promoting specific results.
exclude_from_llmstxt: true
---

# Filters
Expand Down
1 change: 1 addition & 0 deletions docs/personalization/integrate_scenario_results.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
description: Use the Personalized block to display recommendation results in your pages.
edition: experience
exclude_from_llmstxt: true
---

# Integrate scenario results
Expand Down
1 change: 1 addition & 0 deletions docs/personalization/personalization.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
description: Use the Personalization service to get recommendation for users based on their behavior and on the scenarios you configure.
exclude_from_llmstxt: true
---

# Personalization
Expand Down
1 change: 1 addition & 0 deletions docs/personalization/preview_scenario_results.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
description: In the back office you can preview what results are recommended by the Personalization service.
exclude_from_llmstxt: true
---

# Preview scenario results
Expand Down
1 change: 1 addition & 0 deletions docs/personalization/recommendation_models.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
description: Models are building blocks to recommendation scenarios. They let you define which criteria to take into account when calculating recommendations.
month_change: false
exclude_from_llmstxt: true
---

# Recommendation models
Expand Down
1 change: 1 addition & 0 deletions docs/personalization/review_perso_performance.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
description: You can view the performance and statistical information about the Personalization service in the Personalization dashboard.
exclude_from_llmstxt: true
---

# Review performance
Expand Down
1 change: 1 addition & 0 deletions docs/personalization/scenarios.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
description: Scenarios define which recommendation results should be given in different situations.
exclude_from_llmstxt: true
---

# Scenarios
Expand Down
3 changes: 2 additions & 1 deletion docs/personalization/segment_management.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
description: Manage segments and combine segment groups to get personalized content targeted at your clients.
exclude_from_llmstxt: true
---

# Segment management
Expand Down Expand Up @@ -199,4 +200,4 @@ or
}
]
}
```
```
1 change: 1 addition & 0 deletions docs/personalization/triggers.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
description: Triggers enable sending recommendations as push messages to customers.
exclude_from_llmstxt: true
---

# Triggers
Expand Down
1 change: 1 addition & 0 deletions docs/personalization/use_cases.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
description: The Personalization service can be used for content publishing and for ecommerce, taking into account both shop-related and content-related user behaviors.
exclude_from_llmstxt: true
---

# Use cases
Expand Down
5 changes: 5 additions & 0 deletions hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""MkDocs hooks entry point — delegates to the installable llms_txt package."""

from llms_txt.hooks import on_config, on_page_content

__all__ = ["on_config", "on_page_content"]
5 changes: 5 additions & 0 deletions llmstxt_preprocess.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""mkdocs-llmstxt ``preprocess:`` entry point — delegates to the installable llms_txt package."""

from llms_txt.llmstxt_preprocess import preprocess

__all__ = ["preprocess"]
6 changes: 6 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,9 @@ markdown_extensions:
- pymdownx.highlight:
guess_lang: false
linenums: true
# Emit language-* classes so the Markdown conversion (llmstxt) can
# restore the language on fenced code blocks.
pygments_lang_class: true
extend_pygments_lang:
- name: php
lang: php
Expand All @@ -257,3 +260,6 @@ markdown_extensions:
custom_checkbox: true
- pymdownx.tilde
- pymdownx.details

hooks:
- hooks.py
10 changes: 10 additions & 0 deletions plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,13 @@ plugins:
'pim/work_with_product_categories.md': 'product_catalog/work_with_product_categories.md'
'pim/work_with_product_page_urls.md': 'product_catalog/work_with_product_page_urls.md'
'pim/work_with_product_variants.md': 'product_catalog/work_with_product_variants.md'

- llmstxt:
preprocess: llmstxt_preprocess.py

autoclean: false
full_output: llms-full.txt
sections:
# Built automatically when running MkDocs build based on MkDocs nav configuration, don't change
Ibexa User Documentation:
- index.md
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ mkdocs-macros-plugin==1.3.7
mkdocs-redirects==1.2.2
mkdocs-autolinks-plugin==0.7.1
Jinja2==3.1.6
mkdocs-llmstxt
ibexa-llms-txt @ git+https://github.com/ibexa/documentation-developer.git@5.0
55 changes: 55 additions & 0 deletions theme/assets/page-actions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/**
* Page Actions JavaScript
* Handles functionality for page action buttons (Copy as Markdown, View as Markdown, Edit on GitHub)
*/

async function copyPageForLLM() {
const mdPath = document.querySelector('meta[name="markdown-path"]').content;

try {
const response = await fetch(mdPath);
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
const markdownContent = await response.text();
await navigator.clipboard.writeText(markdownContent);
showButtonFeedback('success', 'Copied!');
} catch (error) {
console.error('Failed to copy content:', error);
window.open(mdPath, '_blank');
showButtonFeedback('info', 'Opened in tab');
}
}

function showButtonFeedback(type, message) {
const button = document.querySelector('button[onclick="copyPageForLLM()"]');
if (!button) return;

const originalHTML = button.innerHTML;
button.innerHTML = `${message}`;

if (type === 'success') {
button.classList.add('page-action-btn--success');
} else if (type === 'info') {
button.classList.add('page-action-btn--info');
}

setTimeout(() => {
button.innerHTML = originalHTML;
button.classList.remove('page-action-btn--success', 'page-action-btn--info');
}, 2000);
}

document.addEventListener('DOMContentLoaded', function() {
const pageActions = document.getElementById('page-actions');
const firstH1 = document.querySelector('.bootstrap-iso h1, h1');

if (pageActions && firstH1) {
// If h1 is inside a special header container (e.g. release-notes-header),
// insert page-actions after that container so it doesn't disrupt the header layout.
const headerContainer = firstH1.closest('.release-notes-header');
const anchor = headerContainer || firstH1;
anchor.insertAdjacentElement('afterend', pageActions);
pageActions.classList.add('page-actions--visible');
}
});
49 changes: 48 additions & 1 deletion theme/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,25 @@
{%- endif -%}
{% endblock %}

{% block extrahead %}
{% if config.repo_url and page.edit_url %}
<meta name="edit-url" content="{{ page.edit_url }}">
<meta name="markdown-path" content="index.md">
{% endif %}

<!-- LLM discovery links -->
<link rel="llms" href="{{ 'llms.txt' | url }}" title="LLM-friendly index">
<link rel="llms" href="{{ 'llms-full.txt' | url }}" title="LLM-friendly full content">

{% if page and not page.meta.exclude_from_llmstxt %}
{% set md_href = page.file.dest_uri | replace('.html', '.md') %}
<link rel="alternate" type="text/markdown" href="{{ md_href | url }}" title="Markdown Version">
{% endif %}

<!-- Page actions script -->
<script src="{{ 'assets/page-actions.js' | url }}"></script>
{% endblock %}

{% block site_nav %}
{% if nav %}
<div class="main_nav">
Expand Down Expand Up @@ -65,7 +84,35 @@
{% endif %}
</div>
{% endif %}
{{ page.content }}
<div class="content-with-actions">
{{ page.content }}

<!-- Page action buttons - show only on subpages, positioned after first h1 -->
{% if config.repo_url and page.edit_url and not page.is_homepage and not page.meta.exclude_from_llmstxt %}
<div class="page-actions" id="page-actions">
<button onclick="copyPageForLLM()" title="Copy page as Markdown for LLM" class="page-action-btn">
<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M2.5 1A1.5 1.5 0 0 0 1 2.5v8A1.5 1.5 0 0 0 2.5 12H4v1.5A1.5 1.5 0 0 0 5.5 15h8a1.5 1.5 0 0 0 1.5-1.5v-8A1.5 1.5 0 0 0 13.5 4H12V2.5A1.5 1.5 0 0 0 10.5 1h-8zM12 5.5h1.5v8h-8V12h5a1.5 1.5 0 0 0 1.5-1.5v-5zm-1.5 5h-8v-8h8v8z"/>
</svg>
Copy as Markdown
</button>
<a href="index.md" title="View source markdown" class="page-action-btn" rel="nofollow" target="_blank">
<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
<path d="M4 9.75A.75.75 0 0 1 4.75 9h2a.75.75 0 0 1 0 1.5h-2A.75.75 0 0 1 4 9.75ZM4.75 5a.75.75 0 0 0 0 1.5h6a.75.75 0 0 0 0-1.5h-6Z"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M1 12.5v-9A2.5 2.5 0 0 1 3.5 1h9A2.5 2.5 0 0 1 15 3.5v6.672a2 2 0 0 1-.586 1.414l-2.828 2.828a2 2 0 0 1-1.414.586H3.5A2.5 2.5 0 0 1 1 12.5Zm1.5 0v-9a1 1 0 0 1 1-1h9a1 1 0 0 1 1 1v5h-3.25a1.75 1.75 0 0 0-1.75 1.75v3.25h-5a1 1 0 0 1-1-1Zm7.5 1h.172a.5.5 0 0 0 .353-.146l2.829-2.829a.5.5 0 0 0 .146-.353V10h-3.25a.25.25 0 0 0-.25.25v3.25Z"/>
</svg>
View as Markdown
</a>
<a href="{{ page.edit_url }}" title="View this page on GitHub" class="page-action-btn" rel="nofollow" target="_blank">
<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.013 2.513a1.75 1.75 0 0 1 2.475 2.474l-6.62 6.62a2.75 2.75 0 0 1-1.06.664l-2.914.97a.75.75 0 0 1-.95-.95l.97-2.915a2.75 2.75 0 0 1 .664-1.06l6.435-6.803zm1.414 1.06a.25.25 0 0 0-.354 0l-.742.783 1.06 1.06.784-.742a.25.25 0 0 0 0-.354l-.748-.747zM8.717 6.07l1.06 1.06-5.156 5.156a1.25 1.25 0 0 1-.302.481l-1.264.421.421-1.264a1.25 1.25 0 0 1 .481-.302L8.717 6.07z"/>
</svg>
View on GitHub
</a>
</div>
{% endif %}
</div>

{% include "partials/tags.html" %}
</div>
{% endblock %}
5 changes: 0 additions & 5 deletions theme/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,5 @@
{% include ".icons/material/magnify.svg" %}
</label>
{% include "partials/search.html" %}
{% if config.repo_url %}
<div class="md-header__source">
{% include "partials/source.html" %}
</div>
{% endif %}
</nav>
</header>
Loading
Loading