Giter VIP home page Giter VIP logo

myst-theme's Introduction

myst-theme

MIT License CI

Packages for creating MyST websites themes using React and Remix

Development

All dependencies for myst-theme are included in this repository (a monorepo!). The core themes are also included in this repository to aid in development.

What's inside?

Components:

  • myst-to-react: expose MyST content as an article, built with React
  • @myst-theme/frontmatter: Show title, authors and affiliations
  • @myst-theme/providers: React providers for references and site configuration
  • @myst-theme/demo: myst-demo component for showing syntax
  • @myst-theme/diagrams: mermaid diagrams for MyST
  • @myst-theme/icons: MyST icons for React
  • @myst-theme/site: components and utilities for building Remix sites

Styles:

  • @myst-theme/styles: Reusable style components using tailwind

Themes:

These are included as submodules, use git clone --recursive when first cloning.

  • @myst-theme/book: Designed to mimic the look-and-feel of an interactive book.
  • @myst-theme/article: A single-page view of an article with associated notebooks or supporting sub-articles.

Versioning & Publishing

myst-theme uses changesets to document changes to this monorepo, call npm run changeset and follow the prompts. Later, npm run version will be called and then npm run publish.

Utilities

myst-theme is built and developed using:

Development

This repository depends on themes which are brought in as a sub-module. When first cloning the repository use git clone --recursive, then install the various dependencies:

git clone --recursive https://github.com/executablebooks/myst-theme.git
cd myst-theme
npm install

Build

To build all themes and packages, run the following command:

npm run build

Develop

These packages are best shown using storybook a UI library that powers the docs.

npm run storybook
# and in another terminal
npm run dev

Working with themes

To interact with the themes in development mode (e.g. with live-reload of components and styles as you are making changes), you need three things running:

  1. a content server
  2. the renderer/application (theme)
  3. a process watching all components
# In a directory with content
myst start --headless
# In myst-theme
npm run theme:book
# In another terminal, watch for changes and rebuild
npm run dev

Note: in the future, this repository will likely have it's own content to test out with the themes. You can currently look to the mystjs/docs folder, or an article or a thesis.

Deployment

To update the theme components on NPM:

npm run version
npm run publish

To update the themes for use with the MyST CLI:

make deploy-book
make deploy-article

This updates the git repository, and sometimes is a large diff and can cause git to hang, if that happens this command can help change the buffer size when sending the diff to GitHub:

git config --global http.postBuffer 157286400

myst-theme's People

Contributors

rowanc1 avatar stevejpurves avatar fwkoch avatar yxwww avatar dylangrandmont avatar dependabot[bot] avatar gyhhaha avatar tavin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.