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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,4 @@ dist
# jekyll cache and generated files
.jekyll-cache
_site
docs/Gemfile.lock
34 changes: 34 additions & 0 deletions dev.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Jekyll Local Development with Docker

This repository includes Docker setup for running Jekyll locally to preview the GitHub Pages site.

## Quick Start

### Start Jekyll
```bash
cd docker-jekyll-local
docker-compose up
```

### View your site
Open http://localhost:4000/chartifact/ in your browser

### Stop Jekyll
Type ctrl-C in the terminal running `docker-compose up`

## Other useful commands

### Rebuild after changes
```bash
cd docker-jekyll-local
docker-compose build
```

## Files

- `docker-jekyll-local/Dockerfile` - Jekyll container setup for local development
- `docker-jekyll-local/docker-compose.yml` - Container orchestration for local development
- `docs/Gemfile` - Jekyll dependencies (same as GitHub Pages)
- `docs/_config.yml` - Jekyll configuration

The setup uses the same `github-pages` gem as GitHub Pages to ensure compatibility.
13 changes: 13 additions & 0 deletions docker-jekyll-local/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM jekyll/jekyll:4.2.2

WORKDIR /srv/jekyll

# Copy the docs directory
COPY docs/ ./

# Install dependencies
RUN bundle install

EXPOSE 4000

CMD ["bundle", "exec", "jekyll", "serve", "--host", "0.0.0.0", "--port", "4000"]
10 changes: 10 additions & 0 deletions docker-jekyll-local/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
services:
jekyll:
build:
context: ..
dockerfile: docker-jekyll-local/Dockerfile
ports:
- "4000:4000"
volumes:
- ../docs:/srv/jekyll
command: bundle exec jekyll serve --host 0.0.0.0 --port 4000 --force_polling
4 changes: 4 additions & 0 deletions docs/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
source "https://rubygems.org"

gem "github-pages", group: :jekyll_plugins
gem "webrick", "~> 1.7"
6 changes: 6 additions & 0 deletions docs/_config.yml
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
baseurl: /chartifact
repository: microsoft/chartifact

# Development settings (local only - not used by GitHub Pages)
webrick:
headers:
Access-Control-Allow-Origin: "*" # CORS for sandbox/iframe development
2 changes: 1 addition & 1 deletion docs/_layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{% if page.title %}{{ page.title }} - {{ site.title }}{% else %}{{ site.title }}{% endif %}</title>
<meta name="description" content="{{ page.description | default: site.description }}">
<link rel="stylesheet" href="{{ '/assets/css/style.css' | relative_url }}" />
<link rel="stylesheet" href="{{ '/assets/css/page.css' | relative_url }}" />
<link rel="stylesheet" href="{{ '/assets/css/footer.css' | relative_url }}" />
<link href="https://unpkg.com/tabulator-tables@6.3.0/dist/css/tabulator.min.css" rel="stylesheet" />
<script src="https://cdn.jsdelivr.net/npm/markdown-it/dist/markdown-it.min.js"></script>
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions docs/dist/v1/chartifact.editor.umd.js
Original file line number Diff line number Diff line change
Expand Up @@ -2142,17 +2142,17 @@ document.addEventListener('DOMContentLoaded', () => {
}
getDependencies() {
const { hostname, origin } = window.location;
const url = hostname === "localhost" ? origin : "https://microsoft.github.io/chartifact";
const url = hostname === "localhost" ? origin : "https://microsoft.github.io";
return `
<link href="https://unpkg.com/tabulator-tables@6.3.0/dist/css/tabulator.min.css" rel="stylesheet" />
<link href="${url}/dist/v1/chartifact-reset.css" rel="stylesheet" />
<link href="${url}/chartifact/dist/v1/chartifact-reset.css" rel="stylesheet" />
<script src="https://cdn.jsdelivr.net/npm/markdown-it/dist/markdown-it.min.js"><\/script>
<script src="https://unpkg.com/css-tree/dist/csstree.js"><\/script>
<script src="https://unpkg.com/js-yaml/dist/js-yaml.min.js"><\/script>
<script src="https://cdn.jsdelivr.net/npm/vega@5.29.0"><\/script>
<script src="https://cdn.jsdelivr.net/npm/vega-lite@5.20.1"><\/script>
<script src="https://unpkg.com/tabulator-tables@6.3.0/dist/js/tabulator.min.js"><\/script>
<script src="${url}/dist/v1/chartifact.markdown.umd.js"><\/script>
<script src="${url}/chartifact/dist/v1/chartifact.markdown.umd.js"><\/script>
`;
}
}
Expand Down
10 changes: 5 additions & 5 deletions docs/dist/v1/chartifact.host.umd.js
Original file line number Diff line number Diff line change
Expand Up @@ -2142,17 +2142,17 @@ document.addEventListener('DOMContentLoaded', () => {
}
getDependencies() {
const { hostname, origin } = window.location;
const url = hostname === "localhost" ? origin : "https://microsoft.github.io/chartifact";
const url = hostname === "localhost" ? origin : "https://microsoft.github.io";
return `
<link href="https://unpkg.com/tabulator-tables@6.3.0/dist/css/tabulator.min.css" rel="stylesheet" />
<link href="${url}/dist/v1/chartifact-reset.css" rel="stylesheet" />
<link href="${url}/chartifact/dist/v1/chartifact-reset.css" rel="stylesheet" />
<script src="https://cdn.jsdelivr.net/npm/markdown-it/dist/markdown-it.min.js"><\/script>
<script src="https://unpkg.com/css-tree/dist/csstree.js"><\/script>
<script src="https://unpkg.com/js-yaml/dist/js-yaml.min.js"><\/script>
<script src="https://cdn.jsdelivr.net/npm/vega@5.29.0"><\/script>
<script src="https://cdn.jsdelivr.net/npm/vega-lite@5.20.1"><\/script>
<script src="https://unpkg.com/tabulator-tables@6.3.0/dist/js/tabulator.min.js"><\/script>
<script src="${url}/dist/v1/chartifact.markdown.umd.js"><\/script>
<script src="${url}/chartifact/dist/v1/chartifact.markdown.umd.js"><\/script>
`;
}
}
Expand Down Expand Up @@ -3119,10 +3119,10 @@ ${htmlJsonJs}
if (!this.toolbarElement) {
throw new Error("Toolbar element not found");
}
const { home, target } = window.location.hostname === "localhost" ? { home: "/", target: "_self" } : { home: "https://microsoft.github.io/chartifact", target: "_blank" };
const { home, target } = window.location.hostname === "localhost" ? { home: "/", target: "_self" } : { home: "https://microsoft.github.io/", target: "_blank" };
const html = `
<div>
<a href="${home}" target="${target}">Chartifact</a> viewer
<a href="${home}chartifact/" target="${target}">Chartifact</a> viewer
</div>
<div id="folderSpan" style="display: none;"></div>
<div>
Expand Down
6 changes: 3 additions & 3 deletions docs/dist/v1/chartifact.sandbox.umd.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,17 +303,17 @@ document.addEventListener('DOMContentLoaded', () => {
}
getDependencies() {
const { hostname, origin } = window.location;
const url = hostname === "localhost" ? origin : "https://microsoft.github.io/chartifact";
const url = hostname === "localhost" ? origin : "https://microsoft.github.io";
return `
<link href="https://unpkg.com/tabulator-tables@6.3.0/dist/css/tabulator.min.css" rel="stylesheet" />
<link href="${url}/dist/v1/chartifact-reset.css" rel="stylesheet" />
<link href="${url}/chartifact/dist/v1/chartifact-reset.css" rel="stylesheet" />
<script src="https://cdn.jsdelivr.net/npm/markdown-it/dist/markdown-it.min.js"><\/script>
<script src="https://unpkg.com/css-tree/dist/csstree.js"><\/script>
<script src="https://unpkg.com/js-yaml/dist/js-yaml.min.js"><\/script>
<script src="https://cdn.jsdelivr.net/npm/vega@5.29.0"><\/script>
<script src="https://cdn.jsdelivr.net/npm/vega-lite@5.20.1"><\/script>
<script src="https://unpkg.com/tabulator-tables@6.3.0/dist/js/tabulator.min.js"><\/script>
<script src="${url}/dist/v1/chartifact.markdown.umd.js"><\/script>
<script src="${url}/chartifact/dist/v1/chartifact.markdown.umd.js"><\/script>
`;
}
}
Expand Down
4 changes: 2 additions & 2 deletions docs/dist/v1/chartifact.toolbar.umd.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,10 @@ ${htmlJsonJs}
if (!this.toolbarElement) {
throw new Error("Toolbar element not found");
}
const { home, target } = window.location.hostname === "localhost" ? { home: "/", target: "_self" } : { home: "https://microsoft.github.io/chartifact", target: "_blank" };
const { home, target } = window.location.hostname === "localhost" ? { home: "/", target: "_self" } : { home: "https://microsoft.github.io/", target: "_blank" };
const html = `
<div>
<a href="${home}" target="${target}">Chartifact</a> viewer
<a href="${home}chartifact/" target="${target}">Chartifact</a> viewer
</div>
<div id="folderSpan" style="display: none;"></div>
<div>
Expand Down
6 changes: 3 additions & 3 deletions packages/sandbox/src/sandbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,17 @@ export class Sandbox {
const { hostname, origin } = window.location;
const url = (hostname === 'localhost')
? origin
: 'https://microsoft.github.io/chartifact';
: 'https://microsoft.github.io';
return `
<link href="https://unpkg.com/tabulator-tables@6.3.0/dist/css/tabulator.min.css" rel="stylesheet" />
<link href="${url}/dist/v1/chartifact-reset.css" rel="stylesheet" />
<link href="${url}/chartifact/dist/v1/chartifact-reset.css" rel="stylesheet" />
<script src="https://cdn.jsdelivr.net/npm/markdown-it/dist/markdown-it.min.js"></script>
<script src="https://unpkg.com/css-tree/dist/csstree.js"></script>
<script src="https://unpkg.com/js-yaml/dist/js-yaml.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vega@5.29.0"></script>
<script src="https://cdn.jsdelivr.net/npm/vega-lite@5.20.1"></script>
<script src="https://unpkg.com/tabulator-tables@6.3.0/dist/js/tabulator.min.js"></script>
<script src="${url}/dist/v1/chartifact.markdown.umd.js"></script>
<script src="${url}/chartifact/dist/v1/chartifact.markdown.umd.js"></script>
`;
}
}
4 changes: 2 additions & 2 deletions packages/toolbar/src/toolbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ export class Toolbar {

const { home, target } = (window.location.hostname === 'localhost')
? { home: '/', target: '_self' }
: { home: 'https://microsoft.github.io/chartifact', target: '_blank' };
: { home: 'https://microsoft.github.io/', target: '_blank' };

const html = `
<div>
<a href="${home}" target="${target}">Chartifact</a> viewer
<a href="${home}chartifact/" target="${target}">Chartifact</a> viewer
</div>
<div id="folderSpan" style="display: none;"></div>
<div>
Expand Down