|
1 | | -# doraemon_site |
2 | | -Website for DORAEMON data challenge |
| 1 | +# DORAEMON Site |
| 2 | + |
| 3 | +This repo contains the website for the DORAEMON open dataset challenge. |
| 4 | + |
| 5 | +Most contributors should only need to edit Markdown-like text files. You do not need to know React, Next.js, or Fumadocs to add information. |
| 6 | + |
| 7 | +## Where To Edit |
| 8 | + |
| 9 | +| I want to edit | Go here | |
| 10 | +| --- | --- | |
| 11 | +| General documentation | `sites/docs/content/docs/` | |
| 12 | +| Physics notes | `sites/docs/content/docs/physics/` | |
| 13 | +| Challenge rules or metrics | `sites/docs/content/docs/challenge-reference/` | |
| 14 | +| Challenge pages | `sites/docs/content/challenges/` | |
| 15 | +| Dataset pages | `sites/docs/app/data-hub/` | |
| 16 | +| Challenge metadata | `challenges/<challenge-id>/challenge.yml` | |
| 17 | +| Dataset metadata | `datasets/<dataset-id>/dataset.yml` | |
| 18 | + |
| 19 | +## Adding A Documentation Page |
| 20 | + |
| 21 | +Add a `.mdx` file under `sites/docs/content/docs/`. |
| 22 | + |
| 23 | +For example: |
| 24 | + |
| 25 | +```text |
| 26 | +sites/docs/content/docs/getting-started/my-page.mdx |
| 27 | +``` |
| 28 | + |
| 29 | +Start the file with: |
| 30 | + |
| 31 | +```mdx |
| 32 | +--- |
| 33 | +title: My Page |
| 34 | +description: A short sentence about the page. |
| 35 | +--- |
| 36 | + |
| 37 | +Write the page here. |
| 38 | +``` |
| 39 | + |
| 40 | +To add a nested documentation section, make a folder with: |
| 41 | + |
| 42 | +```text |
| 43 | +index.mdx |
| 44 | +meta.json |
| 45 | +``` |
| 46 | + |
| 47 | +The `meta.json` file controls the order of pages in the left sidebar. |
| 48 | + |
| 49 | +## Adding A Challenge Page |
| 50 | + |
| 51 | +Add a file under `sites/docs/content/challenges/`. |
| 52 | + |
| 53 | +Copy an existing challenge file and change the text and metadata. The optional `order` field controls the order of cards on `/challenges`. |
| 54 | + |
| 55 | +Challenge pages should link to shared explanations in Documentation instead of copying the same background text into every challenge. |
| 56 | + |
| 57 | +## Adding Dataset Or Challenge Metadata |
| 58 | + |
| 59 | +For durable records, add or edit: |
| 60 | + |
| 61 | +```text |
| 62 | +challenges/<challenge-id>/challenge.yml |
| 63 | +datasets/<dataset-id>/dataset.yml |
| 64 | +registry/challenges.yml |
| 65 | +registry/datasets.yml |
| 66 | +``` |
| 67 | + |
| 68 | +The registry files are simple lists. Add the new ID there so validation tools can find it. |
| 69 | + |
| 70 | +## Local Checks |
| 71 | + |
| 72 | +First, make sure the required command-line tools are installed: |
| 73 | + |
| 74 | +```sh |
| 75 | +node --version |
| 76 | +yarn --version |
| 77 | +uv --version |
| 78 | +``` |
| 79 | + |
| 80 | +If `node` is missing, install Node.js LTS from: |
| 81 | + |
| 82 | +```text |
| 83 | +https://nodejs.org/ |
| 84 | +``` |
| 85 | + |
| 86 | +After Node.js is installed, install Yarn with: |
| 87 | + |
| 88 | +```sh |
| 89 | +npm install --global yarn |
| 90 | +``` |
| 91 | + |
| 92 | +If `uv` is missing, install it with one of these: |
| 93 | + |
| 94 | +macOS or Linux: |
| 95 | + |
| 96 | +```sh |
| 97 | +curl -LsSf https://astral.sh/uv/install.sh | sh |
| 98 | +``` |
| 99 | + |
| 100 | +Windows PowerShell: |
| 101 | + |
| 102 | +```powershell |
| 103 | +powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex" |
| 104 | +``` |
| 105 | + |
| 106 | +If you already use a package manager, these are also fine: |
| 107 | + |
| 108 | +```sh |
| 109 | +# macOS |
| 110 | +brew install node |
| 111 | +brew install yarn |
| 112 | +brew install uv |
| 113 | + |
| 114 | +# Windows |
| 115 | +winget install OpenJS.NodeJS.LTS |
| 116 | +winget install Yarn.Yarn |
| 117 | +winget install astral-sh.uv |
| 118 | +``` |
| 119 | + |
| 120 | +Then install the website packages: |
| 121 | + |
| 122 | +```sh |
| 123 | +yarn --cwd sites/docs install |
| 124 | +``` |
| 125 | + |
| 126 | +Run this before opening a pull request: |
| 127 | + |
| 128 | +```sh |
| 129 | +make validate |
| 130 | +make docs |
| 131 | +``` |
| 132 | + |
| 133 | +Run this to preview the site locally: |
| 134 | + |
| 135 | +```sh |
| 136 | +make docs-serve |
| 137 | +``` |
| 138 | + |
| 139 | +Then open the local URL printed by the command. |
| 140 | + |
| 141 | +## Notes |
| 142 | + |
| 143 | +- Documentation pages support normal Markdown. |
| 144 | +- Math works with `$...$` and `$$...$$`. |
| 145 | +- Images used by docs should usually live in `sites/docs/public/docs/`. |
| 146 | +- The built website is static for now. |
0 commit comments