console/notebooks/index.sql
SELECT 'dynamic' AS component, sqlpage.run_sql('shell/shell.sql') AS properties;
SELECT 'breadcrumb' as component;
WITH RECURSIVE breadcrumbs AS (
SELECT
COALESCE(abbreviated_caption, caption) AS title,
COALESCE(url, path) AS link,
parent_path, 0 AS level,
namespace
FROM sqlpage_aide_navigation
WHERE namespace = 'prime' AND path='console/notebooks/index.sql'
UNION ALL
SELECT
COALESCE(nav.abbreviated_caption, nav.caption) AS title,
COALESCE(nav.url, nav.path) AS link,
nav.parent_path, b.level + 1, nav.namespace
FROM sqlpage_aide_navigation nav
INNER JOIN breadcrumbs b ON nav.namespace = b.namespace AND nav.path = b.parent_path
)
SELECT title ,
sqlpage.environment_variable('SQLPAGE_SITE_PREFIX') || '/'||link as link
FROM breadcrumbs ORDER BY level DESC;
-- not including page title from sqlpage_aide_navigation
SELECT 'title' AS component, 'Code Notebooks' AS contents;
SELECT 'table' as component, 'Cell' as markdown, 1 as search, 1 as sort;
SELECT c.notebook_name,
'[' || c.cell_name || '](' ||
sqlpage.environment_variable('SQLPAGE_SITE_PREFIX') || '/console/notebooks/notebook-cell.sql?notebook=' ||
replace(c.notebook_name, ' ', '%20') ||
'&cell=' ||
replace(c.cell_name, ' ', '%20') ||
')' AS "Cell",
c.description,
k.kernel_name as kernel
FROM code_notebook_kernel k, code_notebook_cell c
WHERE k.code_notebook_kernel_id = c.notebook_kernel_id;