UniDi

UniDi Website and documentation

Contents

Getting started

Prerequisites

  1. Git.
  2. Node (version 12 or greater).
  3. Yarn (version 1.5 or greater).
  4. A fork of the repo (for any contributions).
  5. A clone of the unidi.github.io repo.

Installation

  1. cd unidi.github.io to go into the project root.
  2. yarn to install the website’s workspace dependencies.
  3. cd website to go into the website portion of the project.

Running locally

  1. yarn start to start the development server (powered by Docusaurus).
  2. open http://localhost:3000/ to open the site in your favorite browser.

Overview

All the content is generated from markdown files you can find in the docs directory.

To edit the internals of how the site is built, you may want to get familiarized with how the site is built. The UniDi website is a static site generated using Docusaurus. The website configuration can be found in the website directory. Visit the Docusaurus website to learn more about all the available configuration options.

Directory Structure

The following is a high-level overview of relevant files and folders.

unidi.github.io
|-- docs
|   |-- 02-Get\ Started
|   |-- 03-Basic\ Principles
|   |-- 04-Advanced
|   |-- 05-Extensions
|   |-- 200-CheatSheet.md
|   `-- index.md

Documentation sources

As mentioned above, the docs folder contains the source files for all of the docs in the website. In most cases, you will want to edit the files within this directory. If you’re adding a new doc or you need to alter the order the docs appear in the sidebar, take a look at the sidebars.json file in the website directory. The sidebars file contains a list of document ids that should match those defined in the header metadata (aka frontmatter) of the docs markdown files.

Website configuration

The main config file for the website can be found at website/docusaurus.config.js. This file tells Docusaurus how to build the website. Edits to this file are rarely necessary.

The core subdirectory contains JavaScript and React components that are the core part of the website.

The src/pages subdirectory contains the React components that make up the non-documentation pages of the site, such as the homepage.

The src/theme subdirectory contains the swizzled React components from the Docusaurus theme.

Contributing

Create a branch

  1. git checkout master from any folder in your local unidi.github.io repository.
  2. git pull origin master to ensure you have the latest main code.
  3. git checkout -b the-name-of-my-branch to create a branch.

    replace the-name-of-my-branch with a suitable name, such as update-extensions-signals-doc

Make the change

  1. Follow the “Running locally” instructions.
  2. Save the files and check in the browser.
  3. Some changes may require a server restart to generate new files. (Pages in docs always do!)
  4. Edits to pages in docs will only be visible in the latest version of the documentation, called “Next”, located under the docs/next path.

Visit http://localhost:3000/docs/next/YOUR-DOCS-PAGE to see your work.

Visit http://localhost:3000/versions to see the list of all versions of the docs.

Test the change

If possible, test any visual changes in all latest versions of the following browsers:

Push it

  1. Run yarn prettier to ensure your changes are consistent with other files in the repo.
  2. git add -A && git commit -m "My message" to stage and commit your changes.

    replace My message with a commit message, such as Add screenshots to UniDi-Signals docs

  3. git push my-fork-name the-name-of-my-branch
  4. Go to the UniDi’s website repo and you should see recently pushed branches.
  5. Follow GitHub’s instructions.
  6. Describe briefly your changes (in case of visual changes, please include screenshots).

License

UniDi is Apache 2.0 licensed.

React Native documentation is Creative Commons licensed.