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

Move EasyDiffraction Library Docs from EasyDiffractionLibDocs to docs/ in EasyDiffractionLib #168

Merged
merged 5 commits into from
Feb 4, 2025

Conversation

AndrewSazonov
Copy link
Member

@AndrewSazonov AndrewSazonov commented Feb 3, 2025

This pull request moves the EasyDiffraction Library documentation from the separate repository EasyDiffractionLibDocs to the docs/ directory within the EasyDiffractionLib repository.

Reasoning

  • Simplified Project Structure
    Integrating the documentation within the main repository streamlines the overall structure of the EasyScience organization.

  • Improved Maintainability
    Keeping the documentation alongside the source code ensures easier updates, better consistency, and reduced overhead in maintaining a separate repository.

  • Automated Documentation Builds

    • Documentation builds are now triggered automatically when pushing to the develop or master branches.
    • This ensures that the documentation remains up to date with ongoing development, simplifying the release preparation process.

@AndrewSazonov AndrewSazonov added the documentation Improvements or additions to documentation label Feb 3, 2025
@AndrewSazonov AndrewSazonov self-assigned this Feb 3, 2025
Copy link
Member

@rozyczko rozyczko left a comment

Choose a reason for hiding this comment

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

Some issues raised

  • reasoning behind running doc build on each push on each branch
  • possibility of simplifying the yml file and the development instructions

echo "\033[0;33m:::::: Create the mkdocs.yml configuration file\033[0m"
cp ../assets-docs/mkdocs.yml mkdocs.yml
echo "" >> mkdocs.yml
cat docs/mkdocs.yml >> mkdocs.yml
Copy link
Member

Choose a reason for hiding this comment

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

isn't just

cat ../assets-docs/mkdocs.yml docs/mkdocs.yml > mkdocs.yml

simpler?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is definitely much simpler. Thank you!

'pytest-cov', # Coverage
'pytest-xdist', # Enable parallel testing
'ruff', # Linting and formatting code
'validate-pyproject[all]', # Validate pyproject.toml
Copy link
Member

Choose a reason for hiding this comment

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

Do we still need npm and prettier with validate-pyproject?

Copy link
Member

Choose a reason for hiding this comment

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

I guess they are aimed at two different things - validate-project checks if the yml file is of valid syntax, while prettier checks/fixes the layout.

Copy link
Member Author

Choose a reason for hiding this comment

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

Exactly. Plus, Prettier is used for all non-Python file types.

DEVELOPMENT.md Outdated
cp -R examples/ docs/examples/
cp ../assets-docs/mkdocs.yml mkdocs.yml
echo "" >> mkdocs.yml
cat docs/mkdocs.yml >> mkdocs.yml
Copy link
Member

Choose a reason for hiding this comment

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

or maybe replace this set of commands with asking users/devs to run tools/prepare_docs.sh instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

Purpose of DEVELOPMENT.md

The idea behind DEVELOPMENT.md was to provide a single, comprehensive example of the full development process, outlining all the possible steps along with their short descriptions. This serves as a quick reference for anyone looking to get an overview of the development workflow in one place, without needing to dig into multiple files.

  • It acts as a simple guide, tested on macOS, though it might require adaptations for Windows and other environments.
  • It eliminates the need to open individual shell scripts to understand how each step is actually implemented.
  • This makes it a useful starting point for new contributors or for anyone needing a quick refresher on specific steps in the development process.

Regarding the Collection of Build Scripts (tools/*.sh)

The build scripts were originally just a personal simplification for my workflow. However, they would also need adjustments for Windows and similar environments. This raises the question: Are they necessary here at all?

Redundancy with GitHub Workflows (.github/workflows/*.yml)

  • All these above steps are already covered in the .github/workflows/*.yml files.
  • These workflows are well-structured into separate files, jobs, and steps, with clear comments on each action.
  • Technically, having them should be sufficient, as they already document the process in an actionable way.

However, finding the right workflow file, locating the correct job, and identifying the required step can sometimes be cumbersome. In contrast, having everything summarized in DEVELOPMENT.md makes it much easier to quickly refresh one's memory about the process.

Final Thoughts

Both tools/*.sh scripts and DEVELOPMENT.md effectively duplicate .github/workflows/*.yml, which means additional maintenance is required to keep everything in sync.

  • Keeping DEVELOPMENT.md still seems valuable as a quick reference guide.
  • The shell scripts (tools/*.sh) should either be deleted or refactored to be called directly from the GitHub workflow YAML files, reducing redundancy.

rm -rf node_modules/
rm mkdocs.yml
rm package-lock.json
rm package.json
Copy link
Member

Choose a reason for hiding this comment

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

same here - maybe just reference tools/cleanup_docs.sh

Copy link
Member Author

Choose a reason for hiding this comment

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

Check out my reply above.

cp assets-branding/EasyDiffraction/icons/ed-icon_256x256.png docs/assets/images/favicon.png
mkdir -p overrides/.icons/
cp assets-branding/EasyDiffraction/icons/ed-icon_bw.svg overrides/.icons/easydiffraction.svg
cp assets-branding/EasyScience/icons/es-icon_bw.svg overrides/.icons/easyscience.svg
Copy link
Member

Choose a reason for hiding this comment

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

These preparatory steps are present in tools/prepare_docs.sh - why not just run this script here?
(and for all other steps, which have corresponding scripts)

Copy link
Member Author

Choose a reason for hiding this comment

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

Check out my reply above.


on:
# Trigger the workflow on push
push:
Copy link
Member

Choose a reason for hiding this comment

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

Build docs on each push? We mostly do code changes and silly ruff fixes. Maybe have this run on master and develop only? If we need to write new docs and check them before pushing to develop, we can always trigger the docs rebuild manually.

Copy link
Member Author

Choose a reason for hiding this comment

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

No, this is something I forgot to change after debugging the workflow. Thanks for noticing!

@AndrewSazonov AndrewSazonov merged commit 91ddcbf into develop Feb 4, 2025
53 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants