Skip to content

Commit

Permalink
Add flake.nix for doc/docusaurus (#6233)
Browse files Browse the repository at this point in the history
* New shell for Docusaurus
* Fix broken links
  • Loading branch information
zeme-wana authored Jun 21, 2024
1 parent af578b5 commit 8845e12
Show file tree
Hide file tree
Showing 6 changed files with 9,280 additions and 12,866 deletions.
27 changes: 9 additions & 18 deletions doc/docusaurus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,21 @@

This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.

### Installation
### Development

```
$ yarn
```
Follow the [nix setup guide](https://github.com/input-output-hk/iogx/blob/main/doc/nix-setup-guide.md) (this is reccomended) or alternatively use your local `yarn` installation.

### Local development
If using nix and while inside this directory, run `nix develop` to enter the shell.

Now you can use `yarn` for development:
```bash
yarn # to install dependencies
yarn build # to build the website
yarn start # for live development on localhost
```
$ yarn start
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

### Build

```
$ yarn build
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.

### Deployment

Go to the [docusaurus-site.yml](https://github.com/IntersectMBO/plutus/actions/workflows/docusaurus-site.yml) workflow and click `Run workflow` on the right.

This will build and publish the website to the `gh-pages` branch at https://intersectmbo.github.io/plutus/docs.
This will build and publish the website to [GitHub pages](https://intersectmbo.github.io/plutus/docs).
8 changes: 4 additions & 4 deletions doc/docusaurus/docs/reference/haddock-documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The documentation generated by Haddock provides a comprehehsive reference for th
### Highlighted modules

Highlighted modules in the documentation include the following:
- [PlutusTx](https://intersectmbo.github.io/plutus/haddock/latest/plutus-tx/html/PlutusTx.html): compiling Haskell to PLC (Plutus Core; on-chain code)
- [PlutusTx.Prelude](https://intersectmbo.github.io/plutus/haddock/latest/plutus-tx/html/PlutusTx-Prelude.html): Haskell prelude replacement compatible with PLC
- [PlutusCore](https://intersectmbo.github.io/plutus/haddock/latest/plutus-core/html/PlutusCore.html): programming language in which scripts on the Cardano blockchain are written
- [UntypedPlutusCore](https://intersectmbo.github.io/plutus/haddock/latest/plutus-core/html/UntypedPlutusCore.html): on-chain Plutus code.
- [PlutusTx](https://intersectmbo.github.io/plutus/haddock/latest/plutus-tx/PlutusTx.html): compiling Haskell to PLC (Plutus Core; on-chain code)
- [PlutusTx.Prelude](https://intersectmbo.github.io/plutus/haddock/latest/plutus-tx/PlutusTx-Prelude.html): Haskell prelude replacement compatible with PLC
- [PlutusCore](https://intersectmbo.github.io/plutus/haddock/latest/plutus-core/PlutusCore.html): programming language in which scripts on the Cardano blockchain are written
- [UntypedPlutusCore](https://intersectmbo.github.io/plutus/haddock/latest/plutus-core/UntypedPlutusCore.html): on-chain Plutus code.
58 changes: 58 additions & 0 deletions doc/docusaurus/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions doc/docusaurus/flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
description = "A flake for developing the docusaurus site";

inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
};

outputs = inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" "aarch64-linux" ];
perSystem = { pkgs, ... }: {
devShells.default = pkgs.mkShell {
packages = [ pkgs.yarn pkgs.linkchecker ];
shellHook = ''
PS1="\[\033[32m\]\u@\h\[\033[0m\]:\[\033[33m\]\w\[\033[0m\]\$ "
'';
};
};
};
}
Loading

0 comments on commit 8845e12

Please sign in to comment.