Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add flake.nix for doc/docusaurus #6233

Merged
merged 2 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading