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

feat(doc): Include extrernal libraries into forge doc scope #6290

Merged
merged 3 commits into from
Nov 12, 2023

Conversation

klkvr
Copy link
Member

@klkvr klkvr commented Nov 11, 2023

Motivation

Closes #5761 and adds ability to generate docs for external dependencies via --include-libraries flag

Solution

List of documents now always contains all .sol files found in lib directories. They are getting filtered out if --include-libraries is off when the mdbook is generated.

  • ContractInheritance preprocessor captures inherited contracts from external libraries only if --include-libraries is on
  • GitSource preprocessor never generates git source links for contracts from external libraries
  • InheritDoc always includes contracts from external libs when matching @inheritdoc statements

Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

this looks great, scanning all lib docs should still be fast enough.

only smol style nit


if parser_result.is_err() {
if from_library {
// Ignore failures for library files
Copy link
Member

Choose a reason for hiding this comment

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

this is reasoanble

eyre::eyre!(
let parser_result = solang_parser::parse(&source, i);

if parser_result.is_err() {
Copy link
Member

Choose a reason for hiding this comment

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

I'd like this as a match statement insted that assigns let (mut source_unit, comments) =

so we can get rid of the unwraps

@klkvr klkvr requested a review from mattsse November 12, 2023 15:40
@mattsse mattsse merged commit 529559c into foundry-rs:master Nov 12, 2023
19 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.

forge(doc): Inherited Natspec is not captured
2 participants