The workflow update-from-latest.yml is used to update the documentation. This workflow:
- Downloads the latest rips package from the ResInsight main repository
- Downloads Protocol Buffer (.proto) files from the ResInsight repository
- Generates Protocol Buffer documentation using
docs/source/generate_protobuf_docs.py - Generates Python examples using
docs/source/create_python_examples.py - Creates a pull request in this repository if needed
We use an internal system to communicate large binary structures between Python and ResInsight. Functions related to this system are postfixed with _internal and are removed from the generated documentation using the script clean_internal_methods.py.
- Install Python 3.x
- Create a virtual environment
- Install dependencies for rips:
pip install grpcio grpcio-tools protobuf
- Install Sphinx:
pip install sphinx
- Install Sphinx dependencies:
pip install m2r2 sphinx_rtd_theme sphinx-automodapi
- (Optional) If you have proto files in
docs/proto/, generate Protocol Buffer documentation:cd docs/source python generate_protobuf_docs.py cd ..
- Open a command line in the docs folder
- Run:
sphinx-build -b html source build - Open the generated documentation in your browser from
build/html/index.html
The Protocol Buffer documentation is automatically generated from .proto files:
The workflow automatically:
- Downloads the latest
.protofiles from ResInsight repository - Generates
ProtobufStructures.rstdocumentation - Includes it in pull requests
To manually update Protocol Buffer documentation:
- Ensure proto files exist in
docs/proto/directory - Run the generator script:
cd docs/source python generate_protobuf_docs.py - The script will update
docs/source/ProtobufStructures.rstwith current proto definitions
The generator script supports filtering and configuration:
Include specific proto files only:
python generate_protobuf_docs.py --include SimulatorTables.proto Definitions.protoExclude specific proto files:
python generate_protobuf_docs.py --exclude Internal.proto Debug.protoUse a configuration file:
python generate_protobuf_docs.py --config proto_docs_config.jsonConfiguration file format (JSON or YAML):
{
"include": ["SimulatorTables.proto", "Definitions.proto"],
"exclude": ["Internal.proto"],
"important_messages": ["SimulatorTableData", "Vec3d"]
}Custom output location:
python generate_protobuf_docs.py --output custom.rst --proto-dir /path/to/protosCommand-line help:
python generate_protobuf_docs.py --helpThe generator script parses .proto files and creates RST documentation including:
- Message definitions with field types and descriptions
- Enum definitions
- Service definitions (gRPC methods)
- Cross-references to Python API methods
- Highlighting of important/commonly-used structures
Create a pull request from next-major-release to the master branch.