Distill articles depend on distillpub/template for styling and some functionality such as footnotes, citations, and math rendering. We built template as a standalone library of styles and webcomponents to allow you to use any web development workflow you'd like. But what if you don't have strong opinions about that and just want a starter kit that works out of the box? This is such a starter kit.
This is using
webpack for bundling,
svelte-loader to build interactive components/diagrams, and
ejs to inline SVGs—the same technology choices we used when building ambitious articles such as Building Blocks of Interpretability.
Fork and rename, or simply copy this repository.
First time setup
- Clone your fork or copy of this repository:
git clone …
npm(Node Packet Manager). If you're on a Mac and have
brew install nodewill do the job.
cd post--exampleinto the root directory of this project.
npm installto install dependencies.
npm run devto run a development server that autoreloads when you make changes to the article ("hot-reloading"). The console output will link you to a hot-reloading preview of the article.
- Your article text is in
- Your article metadata is in a tag called
distill-frontmatterin the same (
src/index.ejs) file. It contains a password field, which you should customize or remove while you're working oon the article.
Components and diagrams are stored in
.html files are svelte components, the
.js files are compilation endpoints that are also defined in
webpack.config.js. These compiled endpoints are then consumed by hand authored
.ejs files in
src, such as
index.ejs which contains your content. For most articles you can simply use the provided
index.ejs for your text,
index.js to instantiate diagrams, and
.html svelte files to create them.
Submitting to Distill
You can find detailed information on submitting to Distill on the journal website. As part of the review process you may be asked to share a version of your submission with reviewers. To give Distill read access to build and host your submission, please add the Github user
distillpub-reviewers to your repository. Within around a day a member of the editorial staff will accept the invite, which will allow us to host your article (unlisted) on
drafts.distill.pub and share it with reviewers on your behalf.
If your repository is hosted by an organization account, you can give
distillpub-reviewers admin access and it will automatically install webhooks that trigger a redeploy when you push changes.
If repository is hosted by a personal account for your repository, drafts will attempt to rebuild your submission once a day. Alternatively you can contact Distill to ask for a repository under the
distillpub Github organization.
Additional information and first troubleshooting steps are listed in the
drafts repository's README. You can also get in touch with the editorial team for help via email, or on the Distill Community Slack workspace.
This is a new template, and we don't yet have a lot of documentation on it. Please bear with us while we work to improve it!