Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: add script for generating offline docsets #3280

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 24 additions & 0 deletions docs/_config-docset.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# A "docset" is an offline-friendly version of the documentation page
# It can be served from the filesystem without a live server.

title: Vega
description: SEO not needed for docset
baseurl: "DOCSET_BASE_TO_REPLACE" # the subpath of your site, e.g. /blog
url: "https://vega.github.io" # the base hostname & protocol for your site
is_docset_build: true # if true, will make choices that assume the site is served from the filesystem instead of a webserver

# Build settings
markdown: kramdown
highlighter: rouge

twitter:
username: vega_vis

kramdown:
input: GFM
syntax_highlighter: rouge
auto_id_stripping: true

exclude:
- Gemfile
- Gemfile.lock
5 changes: 5 additions & 0 deletions docs/_includes/embed
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,13 @@ function image(view, type) {
};
}


var view = new vega.View(vega.parse(spec), {
{% if site.is_docset_build == true %}
loader: vega.loader({baseURL: 'https://vega.github.io/vega/'}),
{% else %}
loader: vega.loader({baseURL: '{{ site.baseurl }}/'}),
{% endif %}
logLevel: vega.Warn,
renderer: '{{ include.renderer | default: "svg" }}'
}).initialize('#{{id}}').hover().run();
Expand Down
2 changes: 2 additions & 0 deletions docs/_layouts/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
<link rel="stylesheet" href="{{ site.baseurl }}/assets/syntax.css">
<link rel="stylesheet" href="{{ site.baseurl }}/assets/main.css">
<script src="{{ site.baseurl }}/vega.min.js"></script>
{% if site.is_docset_build != true %}
{% seo %}
{% endif %}
</head>
<body>
<div class="fill">
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"clean": "lerna clean --yes && lerna exec -- rimraf build && lerna exec -- rimraf LICENSE && rimraf node_modules yarn.lock",
"data": "rsync -r node_modules/vega-datasets/data/* docs/data",
"docs": "cd docs && bundle exec jekyll serve -I -l",
"docs:static": "pushd docs && bundle exec jekyll build -c _config-docset.yml && popd",
"docsbuild": "cd packages/vega/build && cp vega.js vega.min.js* vega-core.js vega-core.min.js* vega-schema.json ../../../docs/",
"license": "lerna exec -- cp ../../LICENSE .",
"release": "yarn license && lerna publish from-package",
Expand Down