julien-c HF staff commited on
Commit
e46072f
1 Parent(s): 13369f7

scaffolding

Browse files
Files changed (6) hide show
  1. .gitignore +5 -0
  2. README.md +53 -1
  3. docs/index.md +111 -0
  4. observablehq.config.ts +27 -0
  5. package-lock.json +0 -0
  6. package.json +19 -0
.gitignore ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ .DS_Store
2
+ dist/
3
+ docs/.observablehq/cache/
4
+ node_modules/
5
+ yarn-error.log
README.md CHANGED
@@ -9,4 +9,56 @@ license: apache-2.0
9
  header: mini
10
  ---
11
 
12
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  header: mini
10
  ---
11
 
12
+ # Observable Huggingface
13
+
14
+ This is an [Observable Framework](https://observablehq.com/framework) project. To start the local preview server, run:
15
+
16
+ ```
17
+ npm run dev
18
+ ```
19
+
20
+ Then visit <http://localhost:3000> to preview your project.
21
+
22
+ For more, see <https://observablehq.com/framework/getting-started>.
23
+
24
+ ## Project structure
25
+
26
+ A typical Framework project looks like this:
27
+
28
+ ```ini
29
+ .
30
+ ├─ docs
31
+ │ ├─ components
32
+ │ │ └─ timeline.js # an importable module
33
+ │ ├─ data
34
+ │ │ ├─ launches.csv.js # a data loader
35
+ │ │ └─ events.json # a static data file
36
+ │ ├─ example-dashboard.md # a page
37
+ │ ├─ example-report.md # another page
38
+ │ └─ index.md # the home page
39
+ ├─ .gitignore
40
+ ├─ observablehq.config.ts # the project config file
41
+ ├─ package.json
42
+ └─ README.md
43
+ ```
44
+
45
+ **`docs`** - This is the “source root” — where your source files live. Pages go here. Each page is a Markdown file. Observable Framework uses [file-based routing](https://observablehq.com/framework/routing), which means that the name of the file controls where the page is served. You can create as many pages as you like. Use folders to organize your pages.
46
+
47
+ **`docs/index.md`** - This is the home page for your site. You can have as many additional pages as you’d like, but you should always have a home page, too.
48
+
49
+ **`docs/data`** - You can put [data loaders](https://observablehq.com/framework/loaders) or static data files anywhere in your source root, but we recommend putting them here.
50
+
51
+ **`docs/components`** - You can put shared [JavaScript modules](https://observablehq.com/framework/javascript/imports) anywhere in your source root, but we recommend putting them here. This helps you pull code out of Markdown files and into JavaScript modules, making it easier to reuse code across pages, write tests and run linters, and even share code with vanilla web applications.
52
+
53
+ **`observablehq.config.ts`** - This is the [project configuration](https://observablehq.com/framework/config) file, such as the pages and sections in the sidebar navigation, and the project’s title.
54
+
55
+ ## Command reference
56
+
57
+ | Command | Description |
58
+ | ----------------- | -------------------------------------------------------- |
59
+ | `npm install` | Install or reinstall dependencies |
60
+ | `npm run dev` | Start local preview server |
61
+ | `npm run build` | Build your static site, generating `./dist` |
62
+ | `npm run deploy` | Deploy your project to Observable |
63
+ | `npm run clean` | Clear the local data loader cache |
64
+ | `npm run observable` | Run commands like `observable help` |
docs/index.md ADDED
@@ -0,0 +1,111 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ theme: alt
3
+ toc: false
4
+ ---
5
+
6
+ <style>
7
+
8
+ .hero {
9
+ display: flex;
10
+ flex-direction: column;
11
+ align-items: center;
12
+ font-family: var(--sans-serif);
13
+ margin: 4rem 0 8rem;
14
+ text-wrap: balance;
15
+ text-align: center;
16
+ }
17
+
18
+ .hero h1 {
19
+ margin: 2rem 0;
20
+ max-width: none;
21
+ font-size: 14vw;
22
+ font-weight: 900;
23
+ line-height: 1;
24
+ background: linear-gradient(30deg, var(--theme-foreground-focus), currentColor);
25
+ -webkit-background-clip: text;
26
+ -webkit-text-fill-color: transparent;
27
+ background-clip: text;
28
+ }
29
+
30
+ .hero h2 {
31
+ margin: 0;
32
+ max-width: 34em;
33
+ font-size: 20px;
34
+ font-style: initial;
35
+ font-weight: 500;
36
+ line-height: 1.5;
37
+ color: var(--theme-foreground-muted);
38
+ }
39
+
40
+ @media (min-width: 640px) {
41
+ .hero h1 {
42
+ font-size: 90px;
43
+ }
44
+ }
45
+
46
+ </style>
47
+
48
+ <div class="hero">
49
+ <h1>Hello, Observable Framework</h1>
50
+ <h2>Welcome to your new project! Edit&nbsp;<code style="font-size: 90%;">docs/index.md</code> to change this page.</h2>
51
+ <a href="https://observablehq.com/framework/getting-started" target="_blank">Get started<span style="display: inline-block; margin-left: 0.25rem;">↗︎</span></a>
52
+ </div>
53
+
54
+ <div class="grid grid-cols-2" style="grid-auto-rows: 504px;">
55
+ <div class="card">${
56
+ resize((width) => Plot.plot({
57
+ title: "Your awesomeness over time 🚀",
58
+ subtitle: "Up and to the right!",
59
+ width,
60
+ y: {grid: true, label: "Awesomeness"},
61
+ marks: [
62
+ Plot.ruleY([0]),
63
+ Plot.lineY(aapl, {x: "Date", y: "Close", tip: true})
64
+ ]
65
+ }))
66
+ }</div>
67
+ <div class="card">${
68
+ resize((width) => Plot.plot({
69
+ title: "How big are penguins, anyway? 🐧",
70
+ width,
71
+ grid: true,
72
+ x: {label: "Body mass (g)"},
73
+ y: {label: "Flipper length (mm)"},
74
+ color: {legend: true},
75
+ marks: [
76
+ Plot.linearRegressionY(penguins, {x: "body_mass_g", y: "flipper_length_mm", stroke: "species"}),
77
+ Plot.dot(penguins, {x: "body_mass_g", y: "flipper_length_mm", stroke: "species", tip: true})
78
+ ]
79
+ }))
80
+ }</div>
81
+ </div>
82
+
83
+ ---
84
+
85
+ ## Next steps
86
+
87
+ Here are some ideas of things you could try…
88
+
89
+ <div class="grid grid-cols-4">
90
+ <div class="card">
91
+ Chart your own data using <a href="https://observablehq.com/framework/lib/plot"><code>Plot</code></a> and <a href="https://observablehq.com/framework/javascript/files"><code>FileAttachment</code></a>. Make it responsive using <a href="https://observablehq.com/framework/javascript/display#responsive-display"><code>resize</code></a>.
92
+ </div>
93
+ <div class="card">
94
+ Create a <a href="https://observablehq.com/framework/routing">new page</a> by adding a Markdown file (<code>whatever.md</code>) to the <code>docs</code> folder.
95
+ </div>
96
+ <div class="card">
97
+ Add a drop-down menu using <a href="https://observablehq.com/framework/javascript/inputs"><code>Inputs.select</code></a> and use it to filter the data shown in a chart.
98
+ </div>
99
+ <div class="card">
100
+ Write a <a href="https://observablehq.com/framework/loaders">data loader</a> that queries a local database or API, generating a data snapshot on build.
101
+ </div>
102
+ <div class="card">
103
+ Import a <a href="https://observablehq.com/framework/javascript/imports">recommended library</a> from npm, such as <a href="https://observablehq.com/framework/lib/leaflet">Leaflet</a>, <a href="https://observablehq.com/framework/lib/dot">GraphViz</a>, <a href="https://observablehq.com/framework/lib/tex">TeX</a>, or <a href="https://observablehq.com/framework/lib/duckdb">DuckDB</a>.
104
+ </div>
105
+ <div class="card">
106
+ Ask for help, or share your work or ideas, on the <a href="https://talk.observablehq.com/">Observable forum</a>.
107
+ </div>
108
+ <div class="card">
109
+ Visit <a href="https://github.com/observablehq/framework">Framework on GitHub</a> and give us a star. Or file an issue if you’ve found a bug!
110
+ </div>
111
+ </div>
observablehq.config.ts ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // See https://observablehq.com/framework/config for documentation.
2
+ export default {
3
+ // The project’s title; used in the sidebar and webpage titles.
4
+ title: "Observable Huggingface2",
5
+
6
+ // The pages and sections in the sidebar. If you don’t specify this option,
7
+ // all pages will be listed in alphabetical order. Listing pages explicitly
8
+ // lets you organize them into sections and have unlisted pages.
9
+ // pages: [
10
+ // {
11
+ // name: "Examples",
12
+ // pages: [
13
+ // {name: "Dashboard", path: "/example-dashboard"},
14
+ // {name: "Report", path: "/example-report"}
15
+ // ]
16
+ // }
17
+ // ],
18
+
19
+ // Some additional configuration options and their defaults:
20
+ // theme: "default", // try "light", "dark", "slate", etc.
21
+ // header: "", // what to show in the header (HTML)
22
+ // footer: "Built with Observable.", // what to show in the footer (HTML)
23
+ // toc: true, // whether to show the table of contents
24
+ // pager: true, // whether to show previous & next links in the footer
25
+ // root: "docs", // path to the source root for preview
26
+ // output: "dist", // path to the output root for build
27
+ };
package-lock.json ADDED
The diff for this file is too large to render. See raw diff
 
package.json ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "type": "module",
3
+ "private": true,
4
+ "scripts": {
5
+ "clean": "rm -rf docs/.observablehq/cache",
6
+ "build": "rm -rf dist && observable build",
7
+ "dev": "observable preview",
8
+ "deploy": "observable deploy",
9
+ "observable": "observable"
10
+ },
11
+ "dependencies": {
12
+ "@observablehq/framework": "latest",
13
+ "d3-dsv": "^3.0.1",
14
+ "d3-time-format": "^4.1.0"
15
+ },
16
+ "engines": {
17
+ "node": ">=20.6"
18
+ }
19
+ }