|
1 | 1 | # Introduction |
2 | 2 |
|
3 | | -:::caution |
4 | | - |
5 | | -The below instructions are out of date. The documentation site is now moved over to [Docusaurus](https://docusaurus.io/). |
6 | | - |
7 | | -::: |
8 | | - |
9 | 3 | ## Prerequisites |
10 | 4 |
|
11 | | -You'll need HHVM |
12 | | -(see [installation instructions](/docs/hhvm/installation/introduction)) |
13 | | -installed on your local machine, and the version must have the same major |
14 | | -and minor (e.g. `4.123`) as the version specification in the `composer.json` |
15 | | -file. |
16 | | - |
17 | | -You'll also need a checkout of the source code for this site. |
18 | | - |
19 | | -``` |
20 | | -$ git clone [email protected]:hhvm/user-documentation.git |
21 | | -``` |
22 | | - |
23 | | -## Composer Dependencies |
24 | | - |
25 | | -We use Composer to manage our PHP library dependencies and to autoload classes. |
26 | | -Composer is written in PHP, so you need PHP installed. |
27 | | - |
28 | | -``` |
29 | | -# Ubuntu example, your environment may differ. |
30 | | -$ apt-get install php-cli |
31 | | -``` |
32 | | - |
33 | | -You can now follow the instructions on [the Composer website](https://getcomposer.org/) to install it. |
34 | | - |
35 | | -Once you've installed `composer.phar`, you can install the website dependencies into `vendor/` and create the autoload map. |
36 | | - |
37 | | -``` |
38 | | -$ cd user-documentation |
39 | | -user-documentation$ php /path/to/composer.phar install |
40 | | -``` |
| 5 | +This documentation site is built with [Docusaurus](https://docusaurus.io/). To run the site locally for development and testing, ensure [Node.js](https://nodejs.org/en/) (v20.0 or above) and [Yarn](https://yarnpkg.com/) are installed. |
41 | 6 |
|
42 | | -### Updating Dependencies |
| 7 | +<FbInfo> |
| 8 | +As a Meta employee, to run the site on an **On Demand** or a **Dev Server**, follow the instructions on the [Static Docs prerequisites page](https://www.internalfb.com/intern/staticdocs/staticdocs/docs/setup/2-prequisites/), which also describes how to set up proxying. Any updates to the documentation in the repository will be reflected on the [internal Static Docs](https://www.internalfb.com/intern/staticdocs/hack/) site through [automated periodic deployments](https://www.internalfb.com/intern/staticdocs/staticdocs/docs/setup/4-configerator/#periodic-deployment) |
| 9 | +</FbInfo> |
43 | 10 |
|
44 | | -We require that this whole repository has no type errors. |
| 11 | +## Running locally |
45 | 12 |
|
46 | | -``` |
47 | | -$ hh_client |
48 | | -No errors! |
49 | | -``` |
| 13 | +1. Navigate to the `website/` directory and run `yarn install` to install all the required dependencies. |
50 | 14 |
|
51 | | -If you are seeing errors in `vendor/`, re-run the composer install command to ensure that all dependencies are up to date. |
| 15 | +2. Next, to run the site locally, run `yarn start`. |
52 | 16 |
|
53 | | -**NOTE**: If you add, delete or rename a class in the primary source tree `src/`, you should run `php composer.phar dump-autoload` in order to make the autoload maps refresh correctly; otherwise you will get class not found exceptions. |
| 17 | +3. This will start a local server on port 3000. You can view the site at [http://localhost:3000](http://localhost:3000). |
54 | 18 |
|
55 | | -## Running A Local Instance |
| 19 | +<FbInfo> |
| 20 | +The documentation site allows for creation of internal paragraphs/blocks that are only visible to Meta employees. To view these parts of the documentation, you must be on a Meta network or VPN. For local testing, running `yarn start-fb` will switch the local server into a mode that will allow you to view the internal-only parts of the documentation. |
| 21 | +</FbInfo> |
56 | 22 |
|
57 | | -Generate `public/` by running the build script. This script will only |
58 | | -run the steps related to your changes, so the first run will be slower |
59 | | -than later runs. |
| 23 | +Whilst `yarn start` is running, any changes made to the documentation will be published to the local instance automatically, allowing for a fast feedback loop as you make updates. |
60 | 24 |
|
61 | | -``` |
62 | | -$ hhvm bin/build.php |
63 | | -``` |
| 25 | +## Running an old version |
64 | 26 |
|
65 | | -HHVM has a built-in webserver, so it can serve the entire website. |
66 | | - |
67 | | -``` |
68 | | -$ cd public |
69 | | -$ hhvm -m server -p 8080 -c ../hhvm.dev.ini |
70 | | -``` |
71 | | - |
72 | | -You can now see your local instance by visiting [http://localhost:8080](http://localhost:8080). |
73 | | - |
74 | | -When you make changes, you'll need to run `build.php` again. You can |
75 | | -leave HHVM serving the site, and it will pick up the changes |
76 | | -automatically. |
77 | | - |
78 | | -## Running An Old Instance |
79 | | - |
80 | | -If you want to see old versions of the docs, we provide [regular Docker |
81 | | -images of this site](https://ghcr.io/hhvm/user-documentation) (previously |
| 27 | +If you want to see old versions of the docs (from before our migration to Docusaurus in 2025), we provided [regular Docker images of the old documentation site](https://ghcr.io/hhvm/user-documentation) on GHCR (previously |
82 | 28 | on [Docker Hub](https://hub.docker.com/r/hhvm/user-documentation/tags)). |
83 | | -This is not suitable for development, but is useful if you're working with |
84 | | -an old HHVM/Hack version. |
85 | | - |
86 | 29 |
|
| 30 | +These images are not suitable for development, but are useful if you are working with |
| 31 | +an old HHVM/Hack version. |
87 | 32 |
|
88 | 33 | 1. Install [Docker](https://docs.docker.com/engine/installation/). |
89 | 34 | 2. Start a container with: `docker run -p 8080:80 -d ghcr.io/hhvm/user-documentation`. |
90 | 35 | 3. You can then access a local copy of the documentation at [http://localhost:8080](http://localhost:8080). |
91 | | - |
92 | | -## Running A Production Instance |
93 | | - |
94 | | -Running a production instance is very similar to a development |
95 | | -instance. |
96 | | - |
97 | | -Configure a webserver and HHVM to serve the `public/` |
98 | | -directory. Ensure that all requests that don't match a local file are |
99 | | -served by `index.php`. |
0 commit comments