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

Uniswap v4 Technical Reference #781

Merged
merged 9 commits into from
Sep 30, 2024
Merged

Uniswap v4 Technical Reference #781

merged 9 commits into from
Sep 30, 2024

Conversation

saucepoint
Copy link
Collaborator

@saucepoint saucepoint commented Sep 27, 2024

1. Run forge doc in ../v4-core and ../v4-periphery script runs doc generation now
2. Run ./scripts/v4-forge-doc.sh


  • script for copying forge docs to the proper directory structure, with proper filenames
  • script injects a note that Technical Reference is generated by forge doc
  • script handles converting relative paths to the new directory structure

NOTE:

forge doc will document internal functions too, and is entirely natspec driven

Copy link

vercel bot commented Sep 27, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 30, 2024 6:34pm

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the file to review / provide feedback on

Copy link

@marktoda marktoda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was just looking at the docs script, lgtm generally

# i.e. /home/user/docs, /home/user/v4-periphery, /home/user/v4-core

# Copy v4-core
find ../v4-core/docs/src -type f -regex '.*\.sol/[^.]*\.[^.]*\.md' | while read file; do

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so requires v4-core to be in a sibling repo and updated to latest manually? Would prefer if you handle dep management locally via submodule or something

# Replace relative path links within the file with full paths
sed -i 's|/src/\([^/]\+\)/\([^/]\+\)\.sol/\([^/]\+\)\.\([^/]\+\)\.md|contracts/v4/reference/periphery/\1/\2.md|g' "$new_file"

echo "Copied: $file -> $new_file"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider deduping code into a helper fn? something like

process_component() {
    local component="$1"
    local src_dir="../v4-$component/docs/src"
    local dest_dir="docs/contracts/v4/reference/$component"

    find "$src_dir" -type f -regex '.*\.sol/[^.]*\.[^.]*\.md' | while read -r file; do

@saucepoint saucepoint merged commit dcce743 into main Sep 30, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants