Skip to content

Refactor model

Sean Colsen requested to merge gh-6bea8e5b/45/seanmadsen/refactor-model into master

Created by: seanmadsen

This is a pretty extensive refactor with the following goals:

  • Parse all book yaml files into one Library object... which has many Book objects... each having many Language objects... each having many Version objects. Then use these objects throughout the rest of the app (instead of the current approach which passes around one big array with all the book data).
  • Conform to CiviCRM's coding standards
  • Use shorter functions to improve readability (e.g. publish() currently 137 lines)
  • Do more error handling
  • More docblocks
  • Let the app handle more requests which nginx is currently 404-ing

Overall, I'm trying to make it easier to build new features into civicrm-docs. This PR doesn't add much in the way of features, but there are a lot of improvements that I want to work on (including many of the currently open issues), and I think this refactoring will make that work easier.

Big caveat! This PR changes the nginx.conf file and now expects book builds to live within /web/ instead of /web/static. I'm open to undoing this change if others have concerns, and I can say more if needed. But if we do go forward with this change, we'll need to make sure that we update the production server's nginx config when doing the git pull after this PR and move the current book builds into /web/.

Merge request reports