Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Quickstart with MyST

To publish a MyST document on The Stacks, we need to do the following steps:

  1. Write the document, with its contributors and license in the frontmatter

  2. Log in with the raven command line tool

  3. Create a draft and pick a community

  4. Edit and push changes

  5. Release the publication

This quickstart will walk you through these steps. If you write in Google Docs instead, see Quickstart with Google Docs.

Before you start

You need an account on The Stacks that is allowed to publish; see Who can publish.

You also need the raven command line tool. It will soon be available on the GitHub page for the project. In the meantime reach out to us to get access.

Once you have the CLI, put raven on your PATH.

Step 1: Write the document

We first need some content to publish. In this quickstart, you write the content in MyST. If you are unfamiliar with it, the MyST quickstart gives you a brief introduction. You do not need to build the project with myst: The Stacks renders the document itself. If you wish, you can build it with myst to see how it renders, but you should make sure to preview on The Stacks, since there can be differences in how the result will render.

For the quickstart, we will use a simple example. Save the following as paper.md. Replace the author’s name and ORCID iD with your own:

---
title: How ravens plan ahead
subtitle: Evidence from caching and tool use
abstract: |
  This work reviews evidence that ravens plan for future needs.
license: CC-BY-4.0
keywords: [Perspective, corvids, planning]
authors:
  - name: Alice Example
    orcid: 0000-0002-1825-0097
    roles: [Conceptualization, Writing]
---

## Background

Scrub jays cache food with the future in mind {cite}`10.1038/35106560`.

```{figure} https://upload.wikimedia.org/wikipedia/commons/b/b8/Corvus_corax_%28NPS%29.jpg
:label: fig-raven
:alt: A common raven perched on a rock

A common raven (_Corvus corax_). Public domain, U.S. National Park Service.
```

{numref}`fig-raven` shows a raven.

The frontmatter fills in the publication’s fields (see the MyST frontmatter reference for all the options):

The document cites by DOI and shows an image from the web, so it needs no other files. Local images and BibTeX files work too, at paths relative to the file: raven uploads them with the document (see Cite in a MyST publication for citing by bibliography key). For what MyST features The Stacks supports, see MyST feature support.

Step 2: Log in

Log in to The Stacks:

raven auth login https://api.thestacks.org

This opens The Stacks in your browser to approve the login. Run raven auth status to check who you are logged in as.

Step 3: Create a draft and pick a community

The community is where the publication lives on The Stacks, and its members are notified when you release it. You can set the community when creating the draft, or you can leave it empty and set it in the UI before releasing. Run raven orgs list to find the slug of your community if you want to include it as an argument when creating a draft.

The pubs create command creates a new draft. Use --dry-run first to see what would happen without creating anything:

raven pubs create paper.md --dry-run

Then create the draft:

raven pubs create paper.md

To set the community now, add --org example-lab (with your community’s slug) to either command.

raven creates the draft, reports any warnings (such as an author it could not match or a citation it could not resolve), and prints a link to the draft on The Stacks. It also records the link between paper.md and the publication in .raven/publications.json, so later commands know which publication to update.

The new publication gets a slug, the part of its URL that identifies it, as in thestacks.org/publications/<slug>. The Stacks generates it from the title; to choose your own, add --slug how-ravens-plan-ahead when creating the draft. You can change the slug on the draft page until you release the publication.

Open the link to see how the publication will look. You can change the community, contributors, and other publication fields on the draft page at any time.

Step 4: Edit and push changes

Edit paper.md and replace the draft with it, as often as you like:

raven pubs push paper.md

push replaces the title, subtitle, abstract, and body with the contents of the file, replaces all tags with keywords, and adds any new authors to the contributors. Before the first release, it also applies license when supplied. Keep your intended tags and license in paper.md, including any changes made on the draft page.

Step 5: Release the publication

You release the publication on The Stacks, where you can review the draft first. Open the link that raven pubs create or raven pubs push printed.

When everything the publication needs is filled in, the Release publication… button at the bottom of the draft becomes available. If something is still missing, a list above the button tells you what to fix.

The Ready to release? bar, with Save draft and Release publication buttons.

Figure 1:Click Release publication… when you are ready.

Click Release publication….

Then click Release publication in the dialog box.

The release dialog, with the consent checkbox ticked, an empty Release note field, and a Release publication button.

Figure 2:Check the slug to make sure it is what you want, confirm that the byline authors consent, then release the publication.

Your publication is now live on The Stacks. To change it later, edit paper.md, run raven pubs push paper.md --new-version to open a draft for the next version, and release the new version from the draft page; see Versions and DOIs.