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

[MAINTENANCE] Serve Contributor Guide from Local File #323

Conversation

alexsherstinsky
Copy link
Collaborator

Scope

  • Instead of opening a new tab into external repository (https://github.com/ludwig-ai/ludwig) to display the CONTRIBUTING.md guide (in a separate tab), the present approach is to download this file into the local documentation directory in the Ludwig documentation repository and then source it from this local file as before.
  • The module code_doc_autogen.py was modified in order to download the source contributor guide (using wget).
  • The README.md was modified to provide the instructions to execute python code_doc_autogen.py and commit the changes, if the source contributor guide was modified and synchronized.

…code repository, and update README instructions.
…code repository, and update README instructions.
new_local_file_path: str = wget.download(url, out=local_path)
print(f'\nCONTRIBUTING.md downloaded and saved to: "{new_local_file_path}".')
except Exception as e:
print(f'Failed to download "CONTRIBUTING.md" file. Error: {e}')
Copy link
Contributor

Choose a reason for hiding this comment

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

this is a print, wonder if it's better to print or tu return an actual error

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@w4nderlust This is a very good point. I changed it such that it both prints the cause of the exception, includes the trace, and re-raises the exception such that it is fatal (script execution must not continue). Thank you.

@alexsherstinsky alexsherstinsky force-pushed the bugfix/docs/alexsherstinsky/overall/fix_varios_typos-2023_12_02-2 branch from 6a7d2f0 to 02abb5d Compare December 3, 2023 17:17
@alexsherstinsky alexsherstinsky force-pushed the bugfix/docs/alexsherstinsky/overall/fix_varios_typos-2023_12_02-2 branch from 32029c0 to f0cb738 Compare December 3, 2023 17:23
projects it made possible, shout out on Twitter every time it has helped you, or simply star the
repo to say "thank you".

Check out the official [ludwig docs](https://ludwig-ai.github.io/ludwig-docs/) to get oriented
Copy link
Collaborator

@Infernaught Infernaught Dec 6, 2023

Choose a reason for hiding this comment

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

nit: Could we please capitalize Ludwig in "ludwig docs"?

Copy link
Collaborator Author

@alexsherstinsky alexsherstinsky Dec 6, 2023

Choose a reason for hiding this comment

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

@Infernaught I cannot believe I missed that one. Fixing immediately -- this would have to be in the Ludwig-code repo. But I will update it here for now as well (custom). Once the next Ludwig-code lands, it will be automatic by running the code_doc_autogen.py script. Thanks.vi

Copy link
Contributor

@geoffreyangus geoffreyangus left a comment

Choose a reason for hiding this comment

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

LGTM! Nice change,

documentation are immensely valuable contributions as well.

It also helps us if you spread the word: reference the library from blog posts on the awesome
projects it made possible, shout out on Twitter every time it has helped you, or simply star the
Copy link
Collaborator

@Infernaught Infernaught Dec 6, 2023

Choose a reason for hiding this comment

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

I'm not sure what "reference the library from blog posts" means here. Is there a way to make this clearer? Something like, "Post about all of the awesome projects Ludwig has made possible".

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@Infernaught This would have to be fixed in the Ludwig-code repository.

@alexsherstinsky alexsherstinsky force-pushed the bugfix/docs/alexsherstinsky/overall/fix_varios_typos-2023_12_02-2 branch from deecb67 to 373ca7b Compare December 6, 2023 22:19
@@ -558,3 +598,4 @@ def generate_render_functions(_methods):
f.write(mkdown)

# shutil.copyfile('../CONTRIBUTING.md', 'os.path.join(OUTPUT_DIR, 'contributing.md'))
download_contributor_guide() # Sync from source in Ludwig code repository.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Perhaps we can consider rename the binary to generate_docs_auto_artifacts.py or regenerate_docs_artifacts.py as the scope of the script has expanded to not only parse docstrings, but syncrhronize standalone files from Ludwig github repo.

Also, would you be able to add a docstring at the top of this file describing what this script does?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@justinxzhao Renaming the script would be out of scope as I only added a specific function, but I will try to describe it using a comment. Thanks.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ok! Thanks for adding the comment.

@alexsherstinsky alexsherstinsky force-pushed the bugfix/docs/alexsherstinsky/overall/fix_varios_typos-2023_12_02-2 branch from 04e75f1 to e8371ce Compare December 6, 2023 22:38
Copy link
Collaborator

@Infernaught Infernaught left a comment

Choose a reason for hiding this comment

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

As long as the appropriate changes get propagated correctly from the code repo, this LGTM! Thanks, Alex!

@@ -558,3 +598,4 @@ def generate_render_functions(_methods):
f.write(mkdown)

# shutil.copyfile('../CONTRIBUTING.md', 'os.path.join(OUTPUT_DIR, 'contributing.md'))
download_contributor_guide() # Sync from source in Ludwig code repository.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ok! Thanks for adding the comment.

@alexsherstinsky alexsherstinsky merged commit bc99581 into master Dec 6, 2023
2 checks passed
@alexsherstinsky alexsherstinsky deleted the bugfix/docs/alexsherstinsky/overall/fix_varios_typos-2023_12_02-2 branch December 6, 2023 22:55
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.

5 participants