Skip to content

Commit ca6a1a7

Browse files
authored
Merge pull request #218 from JuliaAI/folder-org
Reorganize folders of DataScienceTutorials.jl
2 parents 52732d3 + d4de844 commit ca6a1a7

File tree

153 files changed

+226
-202
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

153 files changed

+226
-202
lines changed

Diff for: Project_old.toml

-2
This file was deleted.

Diff for: README.md

+89-66

Diff for: _layout/foot.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<script src="/libs/collapse/collapse.js"></script>
66
<script src="/libs/pure/ui.min.js"></script>
77
<!-- head and footer-nav -->
8-
<script src="/libs/nav/head.js"></script>
8+
<script src="/libs/nav/head.js" type="module"></script>
99
<!-- landing page -->
1010
<script src="/libs/landing/landing.js"></script>
1111
<!-- navigation bar -->

Diff for: _libs/landing/landing.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@ document.addEventListener("DOMContentLoaded", function() {
5151
// Add click event listener to the div element
5252
element.addEventListener('click', function(event) {
5353
// Change the location to "/how-to-run-code"
54-
window.location.href = (hosted) ? origin + "/DataScienceTutorials.jl" + "/how-to-run-code" : "/how-to-run-code";
54+
window.location.href = (hosted) ? origin + "/DataScienceTutorials.jl" + "/info/how-to-run-code" : "/info/how-to-run-code";
5555
});
5656
});

Diff for: _libs/nav/head.js

+3-79
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,4 @@
1-
2-
const navItems = [
3-
{ name: 'Home', href: '/', sections: [], sectionItemWidth: '', id: 'home' },
4-
{
5-
name: 'Data Basics', // Category name to be shown in navigation bar
6-
id: 'data', // id to be manipulated with js
7-
href: '/data', // in case it should link anywhere
8-
sections: [ // list items to be shown in its dropdown and where they link to
9-
{ name: 'Loading Data', href: '/data/loading/' },
10-
{ name: 'Data Frames', href: '/data/dataframe/' },
11-
{ name: 'Categorical Arrays', href: '/data/categorical/' },
12-
{ name: 'Scientific Type', href: '/data/scitype/' },
13-
{ name: 'Data processing', href: '/data/processing/' },
14-
],
15-
sectionItemWidth: 'short-item'
16-
},
17-
{
18-
name: 'Getting Started',
19-
id: 'getting-started',
20-
href: '/getting-started',
21-
sections: [
22-
{ name: 'Choosing a model', href: '/getting-started/choosing-a-model/' },
23-
{ name: 'Fit, predict, transform', href: '/getting-started/fit-and-predict/' },
24-
{ name: 'Model tuning', href: '/getting-started/model-tuning/' },
25-
{ name: 'Ensembles', href: '/getting-started/ensembles/' },
26-
{ name: 'Ensembles (2)', href: '/getting-started/ensembles-2/' },
27-
{ name: 'Composing models', href: '/getting-started/composing-models/' },
28-
{ name: 'Stacking', href: '/getting-started/stacking/' },
29-
],
30-
sectionItemWidth: 'medium-item'
31-
},
32-
{
33-
name: 'Intro to Stats Learning',
34-
id: 'stats-learning',
35-
href: '/isl',
36-
sections: [
37-
{ name: 'Lab 2', href: '/isl/lab-2/' },
38-
{ name: 'Lab 3', href: '/isl/lab-3/' },
39-
{ name: 'Lab 4', href: '/isl/lab-4/' },
40-
{ name: 'Lab 5', href: '/isl/lab-5/' },
41-
{ name: 'Lab 6b', href: '/isl/lab-6b/' },
42-
{ name: 'Lab 8', href: '/isl/lab-8/' },
43-
{ name: 'Lab 9', href: '/isl/lab-9/' },
44-
{ name: 'Lab 10', href: '/isl/lab-10/' },
45-
],
46-
sectionItemWidth: 'long-item'
47-
},
48-
49-
{
50-
name: 'End to End',
51-
id: 'end-to-end',
52-
href: '/end-to-end',
53-
sections: [
54-
{ name: 'Telco Churn', href: '/end-to-end/telco/' },
55-
{ name: 'AMES', href: '/end-to-end/AMES/' },
56-
{ name: 'Wine', href: '/end-to-end/wine/' },
57-
{ name: 'Crabs (XGB)', href: '/end-to-end/crabs-xgb/' },
58-
{ name: 'Horse', href: '/end-to-end/horse/' },
59-
{ name: 'King County Houses', href: '/end-to-end/HouseKingCounty/' },
60-
{ name: 'Airfoil', href: '/end-to-end/airfoil' },
61-
{ name: 'Boston (lgbm)', href: '/end-to-end/boston-lgbm' },
62-
{ name: 'Using GLM.jl', href: '/end-to-end/glm/' },
63-
{ name: 'Power Generation', href: '/end-to-end/powergen/' },
64-
{ name: 'Boston (Flux)', href: '/end-to-end/boston-flux' },
65-
{ name: 'Breast Cancer', href: '/end-to-end/breastcancer' },
66-
{ name: 'Credit Fraud', href: '/end-to-end/creditfraud' },
67-
],
68-
sectionItemWidth: 'long-item'
69-
},
70-
{
71-
name: 'Advanced',
72-
id: 'advanced',
73-
href: '#!',
74-
sections: [{ name: 'Ensembles (3)', href: '/advanced/ensembles-3' }],
75-
sectionItemWidth: 'medium-item'
76-
},
77-
];
1+
import navItems from '../../routes.json' assert {type: 'json'};
782

793
// first get info on whether hosted or not
804
const origin = window.location.origin;
@@ -130,7 +54,7 @@ navItems.forEach((item) => {
13054

13155
// add a final li as searchform
13256
let formAction = (hosted) ? origin + "/DataScienceTutorials.jl" + "/search/index.html" : "/search/index.html";
133-
searchForm = `
57+
let searchForm = `
13458
<li>
13559
<form id="lunrSearchForm" name="lunrSearchForm" style="margin-left: 1.5rem; margin-right: -2rem;">
13660
<input class="search-input" name="q" placeholder="Search..." type="text">
@@ -192,7 +116,7 @@ generateSidebar(navItems);
192116
// Flatten the nav items so we can easily iterate through them
193117
function flattenNavItems(items) {
194118
return items.reduce((acc, item) => {
195-
const mainHrefs = ["/data", "/end-to-end", "/getting-started", "/isl", "#!"];
119+
const mainHrefs = ["/info/data", "/info/end-to-end", "/info/getting-started", "/info/isl", "#!"];
196120
if (!mainHrefs.includes(item.href)) {
197121
acc.push(item);
198122
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Diff for: advanced/ensembles-3.md

+1-1

Diff for: collapse-script.jl

+16-14
Original file line numberDiff line numberDiff line change
@@ -71,22 +71,24 @@ function read_tutorials(tutorials_dir)
7171

7272
# Iterate over all files named "tutorial.js" in subdirectories
7373
for subdir in readdir(tutorials_dir)
74-
file_path = joinpath(tutorials_dir, subdir, "tutorial.jl")
75-
if isfile(file_path)
76-
try
77-
file = open(file_path, "r")
78-
content = read(file, String)
79-
close(file)
80-
file = open(file_path, "w")
81-
modified_content = introduce_dropdowns(content)
82-
write(file, modified_content)
83-
close(file)
84-
# Store content in the dictionary
85-
catch e
86-
throw("Error reading file '$file_path': $(e)")
74+
for tutorial_subdir in readdir(joinpath(tutorials_dir, subdir))
75+
file_path = joinpath(tutorials_dir, subdir, tutorial_subdir, "tutorial.jl")
76+
if isfile(file_path)
77+
try
78+
file = open(file_path, "r")
79+
content = read(file, String)
80+
close(file)
81+
file = open(file_path, "w")
82+
modified_content = introduce_dropdowns(content)
83+
write(file, modified_content)
84+
close(file)
85+
# Store content in the dictionary
86+
catch e
87+
throw("Error reading file '$file_path': $(e)")
88+
end
8789
end
8890
end
89-
end
91+
end
9092
end
9193

9294

Diff for: data/categorical.md

+1-1

0 commit comments

Comments
 (0)