File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ /.quarto /
2+ ** /* .quarto_ipynb
3+ * _files /
4+ _site /
Original file line number Diff line number Diff line change 1+ project :
2+ type : website
3+
4+ website :
5+ title : " Sidebar Auto Test"
6+ sidebar :
7+ contents : auto
8+
9+ format :
10+ html :
11+ theme : default
Original file line number Diff line number Diff line change 1+ ---
2+ title : " Home"
3+ ---
4+
5+ This is the home page.
Original file line number Diff line number Diff line change 1+ {
2+ "cells" : [
3+ {
4+ "cell_type" : " raw" ,
5+ "metadata" : {},
6+ "source" : [
7+ " ---\n " ,
8+ " title: \" Subdir Index\"\n " ,
9+ " ---"
10+ ]
11+ },
12+ {
13+ "cell_type" : " markdown" ,
14+ "metadata" : {},
15+ "source" : [
16+ " This is the index page for the subdir."
17+ ]
18+ }
19+ ],
20+ "metadata" : {
21+ "kernelspec" : {
22+ "display_name" : " Python 3" ,
23+ "language" : " python" ,
24+ "name" : " python3"
25+ },
26+ "language_info" : {
27+ "name" : " python" ,
28+ "version" : " 3.9.0"
29+ }
30+ },
31+ "nbformat" : 4 ,
32+ "nbformat_minor" : 4
33+ }
Original file line number Diff line number Diff line change 1+ /*
2+ * website-sidebar-auto.test.ts
3+ *
4+ * Verifies that sidebar auto-generation properly detects index files with
5+ * non-qmd extensions (like .ipynb) in subdirectories. This tests the
6+ * engineValidExtensions() call in indexFileHrefForDir() which must work
7+ * before resolveEngines() has been called.
8+ *
9+ * Copyright (C) 2020-2025 Posit Software, PBC
10+ */
11+
12+ import { docs } from "../../utils.ts" ;
13+ import { join } from "../../../src/deno_ral/path.ts" ;
14+ import { existsSync } from "../../../src/deno_ral/fs.ts" ;
15+ import { testQuartoCmd } from "../../test.ts" ;
16+ import { fileExists , noErrorsOrWarnings } from "../../verify.ts" ;
17+
18+ const renderDir = docs ( "websites/website-sidebar-auto" ) ;
19+ const outDir = join ( Deno . cwd ( ) , renderDir , "_site" ) ;
20+
21+ // Test that sidebar auto-generation detects index.ipynb in subdirectory
22+ testQuartoCmd (
23+ "render" ,
24+ [ renderDir ] ,
25+ [
26+ noErrorsOrWarnings ,
27+ fileExists ( join ( outDir , "index.html" ) ) , // Main index page
28+ fileExists ( join ( outDir , "subdir" , "index.html" ) ) , // Subdir index from .ipynb should be rendered
29+ ] ,
30+ {
31+ teardown : async ( ) => {
32+ if ( existsSync ( outDir ) ) {
33+ await Deno . remove ( outDir , { recursive : true } ) ;
34+ }
35+ } ,
36+ } ,
37+ ) ;
You can’t perform that action at this time.
0 commit comments