Skip to content

Commit

Permalink
chore: improve docs scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
0xArdy committed Oct 24, 2023
1 parent 004c369 commit 1ce9acc
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 42 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ npm

# Docs build files
docs/book
docs/src/solidity/interfaces
docs/src/interfaces
docs/src/static

# Coverage
Expand Down
15 changes: 10 additions & 5 deletions build-docs.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
#!/bin/bash

root_path="solidity/interfaces"
# generate docs in a temporary directory
temp_folder="technical-docs"
root_path=solidity/interfaces
temp_folder=technical-docs
output_folder=interfaces

cp -R $root_path $output_folder
cp -R node_modules/@defi-wonderland/prophet-core-contracts/solidity/interfaces/* $output_folder


FOUNDRY_PROFILE=docs forge doc --out "$temp_folder"
rm -rf $output_folder

# edit generated summary not to have container pages
# - [jobs](solidity/interfaces/jobs/README.md)
Expand All @@ -28,15 +33,15 @@ fi

# copy the generated SUMMARY, from the tmp directory, without the first 5 lines
# and paste them after the Interfaces section on the original SUMMARY
tail -n +5 $temp_folder/src/SUMMARY.md >> docs/src/SUMMARY.md
tail -n +4 $temp_folder/src/SUMMARY.md >> docs/src/SUMMARY.md

# delete old generated interfaces docs
rm -rf docs/src/$root_path
# there are differences in cp and mv behavior between UNIX and macOS when it comes to non-existing directories
# creating the directory to circumvent them
mkdir -p docs/src/$root_path
# move new generated interfaces docs from tmp to original directory
cp -R $temp_folder/src/$root_path docs/src/solidity/
cp -R $temp_folder/src/$output_folder docs/src/$output_folder

# delete tmp directory
rm -rf $temp_folder
Expand Down
70 changes: 35 additions & 35 deletions docs/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,38 +55,38 @@
# Technical Documentation

- [Interfaces]()
- [❱ extensions](solidity/interfaces/extensions/README.md)
- [IAccountingExtension](solidity/interfaces/extensions/IAccountingExtension.sol/interface.IAccountingExtension.md)
- [IBondEscalationAccounting](solidity/interfaces/extensions/IBondEscalationAccounting.sol/interface.IBondEscalationAccounting.md)
- [❱ external](solidity/interfaces/external/README.md)
- [IWETH9](solidity/interfaces/external/IWETH9.sol/interface.IWETH9.md)
- [❱ modules](solidity/interfaces/modules/README.md)
- [❱ dispute](solidity/interfaces/modules/dispute/README.md)
- [IBondEscalationModule](solidity/interfaces/modules/dispute/IBondEscalationModule.sol/interface.IBondEscalationModule.md)
- [IBondedDisputeModule](solidity/interfaces/modules/dispute/IBondedDisputeModule.sol/interface.IBondedDisputeModule.md)
- [ICircuitResolverModule](solidity/interfaces/modules/dispute/ICircuitResolverModule.sol/interface.ICircuitResolverModule.md)
- [IDisputeModule](solidity/interfaces/modules/dispute/IDisputeModule.sol/interface.IDisputeModule.md)
- [IRootVerificationModule](solidity/interfaces/modules/dispute/IRootVerificationModule.sol/interface.IRootVerificationModule.md)
- [❱ finality](solidity/interfaces/modules/finality/README.md)
- [ICallbackModule](solidity/interfaces/modules/finality/ICallbackModule.sol/interface.ICallbackModule.md)
- [IFinalityModule](solidity/interfaces/modules/finality/IFinalityModule.sol/interface.IFinalityModule.md)
- [IMultipleCallbacksModule](solidity/interfaces/modules/finality/IMultipleCallbacksModule.sol/interface.IMultipleCallbacksModule.md)
- [❱ request](solidity/interfaces/modules/request/README.md)
- [IContractCallRequestModule](solidity/interfaces/modules/request/IContractCallRequestModule.sol/interface.IContractCallRequestModule.md)
- [IHttpRequestModule](solidity/interfaces/modules/request/IHttpRequestModule.sol/interface.IHttpRequestModule.md)
- [IRequestModule](solidity/interfaces/modules/request/IRequestModule.sol/interface.IRequestModule.md)
- [ISparseMerkleTreeRequestModule](solidity/interfaces/modules/request/ISparseMerkleTreeRequestModule.sol/interface.ISparseMerkleTreeRequestModule.md)
- [❱ resolution](solidity/interfaces/modules/resolution/README.md)
- [IArbitratorModule](solidity/interfaces/modules/resolution/IArbitratorModule.sol/interface.IArbitratorModule.md)
- [IBondEscalationResolutionModule](solidity/interfaces/modules/resolution/IBondEscalationResolutionModule.sol/interface.IBondEscalationResolutionModule.md)
- [IERC20ResolutionModule](solidity/interfaces/modules/resolution/IERC20ResolutionModule.sol/interface.IERC20ResolutionModule.md)
- [IPrivateERC20ResolutionModule](solidity/interfaces/modules/resolution/IPrivateERC20ResolutionModule.sol/interface.IPrivateERC20ResolutionModule.md)
- [IResolutionModule](solidity/interfaces/modules/resolution/IResolutionModule.sol/interface.IResolutionModule.md)
- [ISequentialResolutionModule](solidity/interfaces/modules/resolution/ISequentialResolutionModule.sol/interface.ISequentialResolutionModule.md)
- [❱ response](solidity/interfaces/modules/response/README.md)
- [IBondedResponseModule](solidity/interfaces/modules/response/IBondedResponseModule.sol/interface.IBondedResponseModule.md)
- [IResponseModule](solidity/interfaces/modules/response/IResponseModule.sol/interface.IResponseModule.md)
- [IArbitrator](solidity/interfaces/IArbitrator.sol/interface.IArbitrator.md)
- [IModule](solidity/interfaces/IModule.sol/interface.IModule.md)
- [IOracle](solidity/interfaces/IOracle.sol/interface.IOracle.md)
- [ITreeVerifier](solidity/interfaces/ITreeVerifier.sol/interface.ITreeVerifier.md)
- [❱ extensions](interfaces/extensions/README.md)
- [IAccountingExtension](interfaces/extensions/IAccountingExtension.sol/interface.IAccountingExtension.md)
- [IBondEscalationAccounting](interfaces/extensions/IBondEscalationAccounting.sol/interface.IBondEscalationAccounting.md)
- [❱ external](interfaces/external/README.md)
- [IWETH9](interfaces/external/IWETH9.sol/interface.IWETH9.md)
- [❱ modules](interfaces/modules/README.md)
- [❱ dispute](interfaces/modules/dispute/README.md)
- [IBondEscalationModule](interfaces/modules/dispute/IBondEscalationModule.sol/interface.IBondEscalationModule.md)
- [IBondedDisputeModule](interfaces/modules/dispute/IBondedDisputeModule.sol/interface.IBondedDisputeModule.md)
- [ICircuitResolverModule](interfaces/modules/dispute/ICircuitResolverModule.sol/interface.ICircuitResolverModule.md)
- [IDisputeModule](interfaces/modules/dispute/IDisputeModule.sol/interface.IDisputeModule.md)
- [IRootVerificationModule](interfaces/modules/dispute/IRootVerificationModule.sol/interface.IRootVerificationModule.md)
- [❱ finality](interfaces/modules/finality/README.md)
- [ICallbackModule](interfaces/modules/finality/ICallbackModule.sol/interface.ICallbackModule.md)
- [IFinalityModule](interfaces/modules/finality/IFinalityModule.sol/interface.IFinalityModule.md)
- [IMultipleCallbacksModule](interfaces/modules/finality/IMultipleCallbacksModule.sol/interface.IMultipleCallbacksModule.md)
- [❱ request](interfaces/modules/request/README.md)
- [IContractCallRequestModule](interfaces/modules/request/IContractCallRequestModule.sol/interface.IContractCallRequestModule.md)
- [IHttpRequestModule](interfaces/modules/request/IHttpRequestModule.sol/interface.IHttpRequestModule.md)
- [IRequestModule](interfaces/modules/request/IRequestModule.sol/interface.IRequestModule.md)
- [ISparseMerkleTreeRequestModule](interfaces/modules/request/ISparseMerkleTreeRequestModule.sol/interface.ISparseMerkleTreeRequestModule.md)
- [❱ resolution](interfaces/modules/resolution/README.md)
- [IArbitratorModule](interfaces/modules/resolution/IArbitratorModule.sol/interface.IArbitratorModule.md)
- [IBondEscalationResolutionModule](interfaces/modules/resolution/IBondEscalationResolutionModule.sol/interface.IBondEscalationResolutionModule.md)
- [IERC20ResolutionModule](interfaces/modules/resolution/IERC20ResolutionModule.sol/interface.IERC20ResolutionModule.md)
- [IPrivateERC20ResolutionModule](interfaces/modules/resolution/IPrivateERC20ResolutionModule.sol/interface.IPrivateERC20ResolutionModule.md)
- [IResolutionModule](interfaces/modules/resolution/IResolutionModule.sol/interface.IResolutionModule.md)
- [ISequentialResolutionModule](interfaces/modules/resolution/ISequentialResolutionModule.sol/interface.ISequentialResolutionModule.md)
- [❱ response](interfaces/modules/response/README.md)
- [IBondedResponseModule](interfaces/modules/response/IBondedResponseModule.sol/interface.IBondedResponseModule.md)
- [IResponseModule](interfaces/modules/response/IResponseModule.sol/interface.IResponseModule.md)
- [IArbitrator](interfaces/IArbitrator.sol/interface.IArbitrator.md)
- [IModule](interfaces/IModule.sol/interface.IModule.md)
- [IOracle](interfaces/IOracle.sol/interface.IOracle.md)
- [ITreeVerifier](interfaces/ITreeVerifier.sol/interface.ITreeVerifier.md)
2 changes: 1 addition & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ out = 'out-via-ir'
src = 'solidity/test'

[profile.docs]
src = 'solidity/interfaces/'
src = 'interfaces' # $output_folder variable in build-docs.sh

[fuzz]
runs = 1000
Expand Down

0 comments on commit 1ce9acc

Please sign in to comment.