This directory contains the documentation for ec-MLP, built using mdBook.
To build the documentation locally:
-
Install mdBook:
# Download and install mdBook (Linux x86_64) curl -L https://github.com/rust-lang/mdBook/releases/download/v0.4.40/mdbook-v0.4.40-x86_64-unknown-linux-gnu.tar.gz | tar xz sudo mv mdbook /usr/local/bin/
-
Build the documentation:
cd doc mdbook build -
Serve locally for development:
cd doc mdbook serveThe documentation will be available at
http://localhost:3000
The documentation is automatically deployed to GitHub Pages using GitHub Actions workflows:
-
.github/workflows/deploy-docs-ghpages.yml- Main deployment workflow- Triggers on pushes to
mainanddevelbranches - Builds documentation using mdBook
- Deploys to the
gh-pagesbranch
- Triggers on pushes to
-
.github/workflows/deploy-docs.yml- Alternative deployment workflow- Uses GitHub Pages deployment action
- More advanced configuration with permissions
-
Enable GitHub Pages in your repository:
- Go to repository Settings → Pages
- Source: Deploy from a branch
- Branch:
gh-pagesand/ (root)
-
Configure GitHub Actions permissions:
- Go to repository Settings → Actions → General
- Workflow permissions: Read and write permissions
- Allow GitHub Actions to create and approve pull requests
-
The workflows will automatically:
- Build the documentation when changes are pushed to
doc/directory - Deploy to GitHub Pages
- Update the live site
- Build the documentation when changes are pushed to
To manually trigger a deployment:
- Go to the Actions tab in your GitHub repository
- Select "Deploy Documentation to GitHub Pages" workflow
- Click "Run workflow"
doc/
├── src/ # Source markdown files
│ ├── SUMMARY.md # Table of contents
│ ├── data_modifier.md # Data modifier documentation
│ ├── lmp/ # LAMMPS interface docs
│ └── tf/ # TensorFlow modifier docs
├── book.toml # mdBook configuration
├── ec-mlp-doc/ # Generated HTML files (auto-generated)
└── README.md # This file
To customize the documentation:
- Edit
book.tomlfor book configuration - Add new markdown files to
src/ - Update
SUMMARY.mdto include new pages in the navigation - The documentation will be automatically rebuilt and deployed
If the documentation doesn't deploy:
- Check the Actions tab for workflow errors
- Ensure GitHub Pages is enabled in repository settings
- Verify the workflow has proper permissions
- Check that the documentation builds locally with
mdbook build
For more information about mdBook, see the official documentation.