Files
yoga/website
Nick Gerleman 1b40f05b8c Fixes for publish workflows (#1319)
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1319

This fixes a few issues encountered during publishing Yoga `2.0.0-beta.1`.

1. The tag trigger was missing quotes needed to be valid syntax
2. `pod trunk publish` must be run with `--synchronous` if we are publishing a package that relies on another just published package. There does not seem to be a way to just publish evertything at once.
3. `yarn publish` was not reading the NPM auth token from the environment, so we write it to a `.npmrc` before publishing.
4. The root `.gitignore` was not updated when moving to yarn workspaces to ignore `node_modules`, so the OSS Yoga repo (not internal) will, try to add its contents after `yarn install`.

Reviewed By: cortinico

Differential Revision: D47135994

fbshipit-source-id: d8c9b05176a98443be1ebc7cf74996f22520d20d
2023-06-30 11:44:15 -07:00
..
2023-01-16 04:16:07 -08:00
2021-01-04 21:06:15 -08:00
2023-06-30 11:44:15 -07:00
2018-02-13 06:16:12 -08:00

Yoga documentation and playground

This site uses gatsby.js as static site generator. Which transforms all markdown and react code to static HTML and JS files.

Development

yarn install
yarn develop

Structure

Documentation pages are generated from the Markdown files in contents/. The files are organized in 4 sections/folders (getting-started, properties, examples, contributing) which are dynamically listed on the docs overview page. The Markdown files can have some header files containing metadata.

---
path: "docs/flexDirection"
title: "Flex Direction"
hasPlayground: true
editableProperties: ['flexDirection']
---

The path can be any URL this page should be available at. The title is used as the page's HTML-title and when referencing the file from the documentation overview. There are two kinds of templates for a page: with and without playground. hasPlayground selects the corresponding template (src/templates/{with|without}Playground.js). When using hasPlayground: true, editableProperties can list all Yoga properties which are editable in the playground.

Design

We are using antd for various UI elements. See their documentation for the components available. gatsby-config.js can be used to overwrite LESS-variables from antd.

For styling react components we create a CSS-file with the same name next to each component and import it in the component. E.g. there is index.js and index.css. In the react-component we import the stylesheet: import './index.css'.

Build

To generate the static files run:

yarn build

The output will be in public/ and can be published on GitHub pages.