Skip to content

Commit

Permalink
Merge branch 'main' into bcif
Browse files Browse the repository at this point in the history
  • Loading branch information
BradyAJohnston committed Sep 16, 2024
2 parents 8a063d8 + 7fe5e54 commit fb49c99
Show file tree
Hide file tree
Showing 35 changed files with 5,359 additions and 3,617 deletions.
32 changes: 23 additions & 9 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:
build-docs:
runs-on: ubuntu-latest
permissions: write-all
env:
BLENDER_VERSION: blender-4.2.0-linux-x64
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
Expand All @@ -21,17 +23,29 @@ jobs:
cache: pip

- uses: quarto-dev/quarto-actions/setup@v2
with:
version: "1.4.549"
- name: Set derived environment variables
run: |
echo "BLENDER_FILENAME=${{ env.BLENDER_VERSION }}.tar.xz" >> $GITHUB_ENV
echo "BLENDER_URL=https://mirrors.iu13.net/blender/release/Blender4.2/${{ env.BLENDER_VERSION }}.tar.xz" >> $GITHUB_ENV
- name: Install Blender Dependencies
run: |
sudo apt-get install libxxf86vm-dev -y
sudo apt-get install libxfixes3 -y
sudo apt-get install libxi-dev -y
sudo apt-get install libxkbcommon-x11-0 -y
sudo apt-get install libgl1-mesa-glx -y
- name: Download & Extract Blender
run: |
wget -q $BLENDER_URL
tar -xf $BLENDER_FILENAME
rm -rf $BLENDER_FILENAME
- name: Add Blender executable to path
run: |
echo "${{ github.workspace }}/${{ env.BLENDER_VERSION }}/" >> $GITHUB_PATH
- name: Build docs using blender
run: |
wget -nv https://download.blender.org/release/Blender4.2/blender-4.2.0-linux-x64.tar.xz -O ./blender.tar.xz
mkdir -p ./blender
tar -xf ./blender.tar.xz -C ./blender --strip-components=1
blender/blender --version
blender/blender -b --python docs/install.py
blender/blender -b --python docs/build_node_docs.py
blender -b --python tests/python.py -- -m pip install .
blender -b --python docs/generate.py
- name: Build Docs
run: quarto render docs
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,13 +247,13 @@ To build the documentation, [`Quarto`](https://quarto.org) is used. The docs can

```bash
conda activate mn
python docs/build_node_docs.py
python docs/generate.py
quarto preview
```

The long-form written documentation is all inside of `docs/`. Documentation is written in markdown (`.md`) or quarto-flavored markdown (`.qmd`) which allows to execute code when building the docs.

The documentation for individual nodes which are shown [here](https://bradyajohnston.github.io/MolecularNodes/nodes/) are built by running the `docs/build_node_docs.py`, which extracts information from the relevent `.blend` data files inside of `molecularnodes/assets/`. Combining the information for the input / output types & tooltips with the summaries described in `molecularnodes/ui/node_info.py` we can then generate nice HTML documentation for each of the nodes.
The documentation for individual nodes which are shown [here](https://bradyajohnston.github.io/MolecularNodes/nodes/) are built by running the `docs/generate.py`, which extracts information from the relevent `.blend` data files inside of `molecularnodes/assets/`. Combining the information for the input / output types & tooltips with the summaries described in `molecularnodes/ui/node_info.py` we can then generate nice HTML documentation for each of the nodes.

This isn't currently the best implementation for this. I would prefer to just pull from those nodes which are defined in the `.blend` file, but we aren't able to include descriptions for the node groups currently inside of the `.blend`. `node_info.py` is also used for building the add menus as well as the documentation. To update the descriptions of inputs, outputs and data types the nodes themselves need to be updated inside of the `.blend` files. Relevant example videos should be updated when nodes are changed.

Expand Down
695 changes: 674 additions & 21 deletions LICENSE

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions LICENSE.OLD
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
This text is included pursuant to the obligations of an upstream licence and must be
retained in any derivatives, but it is not the licence applicable to this code

MIT License

Copyright (c) 2022 Brady Johnston

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
65 changes: 28 additions & 37 deletions docs/_quarto.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,46 @@
project:
type: website
output-dir: _build
# render:
# - "*.qmd"
# pre-render: build_node_docs.py

filters:
- preview-colour

website:
title: "Molecular Nodes"
sidebar:
style: docked
search: true
collapse-level: 1
contents:
- href: index.md
text: About

- installation.md
- example_listings.qmd
- section: Tutorials
contents: tutorials/*
- section: Nodes
contents: nodes/*
# - section: API Reference
# contents: reference/*
page-navigation: true
navbar:
left:
- file: installation.qmd
text: Installation
- file: tutorials/
text: Tutorials
- file: nodes/
text: Node Documentation
- file: examples/
text: Examples
tools:
- icon: github
href: https://github.com/BradyAJohnston/MolecularNodes
- icon: twitter
href: https://twitter.com/bradyajohnston
- icon: youtube
href: https://youtube.com/c/bradyjohnston

sidebar:
- id: nodes
title: Nodes
style: floating
align: left
contents: nodes/

- id: tutorials
Title: Tutorials
align: left
style: floating
contents: tutorials/



page-footer:
left: "This site is built with ❤️ and [Quarto](https://quarto.org/)."
background: "#F8F9FA"
Expand All @@ -42,27 +50,10 @@ format:
page-layout: full
theme:
light: yeti
dark: superhero
dark: darkly
css: styles.css
toc: true
toc-depth: 2
preview-colour:
code: true
text: true

# # generate python API docs
# quartodoc:
# package: molecularnodes
# # source_dir: ../molecularnodes
# dir: reference
# sections:
# - title: Importing Files
# desc: "Importing different data formats."
# contents:
# - name: io.pdb.load
# - name: io.local.load
# - name: io.cellpack.load
# - name: io.star.load



137 changes: 0 additions & 137 deletions docs/build_node_docs.py

This file was deleted.

File renamed without changes.
2 changes: 1 addition & 1 deletion docs/examples/biologi-molecular/index.qmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Biologia Molecular
date: "20240202"
date: "20230202"
image: https://imgur.com/nMBlLgk.png
---

Expand Down
11 changes: 11 additions & 0 deletions docs/examples/clockwork/index.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: Clockwork
image: https://img.youtube.com/vi/lv89fSt5jBY/0.jpg
date: "20240804"
---

Clockwork is a YouTube channel about some of the really nitty-gritty biochemistry with great visuals and writing. They recently started posting videos again, having made the jump from 2D animations in After Effects to 3D animations inside of Blender using Molecular Nodes.

You can see their work and sign up for their newsletter at [their website](https://watchclockwork.com).

<iframe width="560" height="315" src="https://www.youtube.com/embed/lv89fSt5jBY?si=x4CXSBUAYLB_6Qfp" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
4 changes: 2 additions & 2 deletions docs/example_listings.qmd → docs/examples/index.qmd
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
title: Examples
listing:
contents: examples
contents: .
type: grid
sort: date
sort: date desc
sort-ui: true

---
Expand Down
Loading

0 comments on commit fb49c99

Please sign in to comment.