Design Discussion: build and generate #501
Closed
oscarlevin
started this conversation in
General
Replies: 1 comment 1 reply
-
|
Just quickly chiming in to apologize for dropping off the past few days - been working on preparing for MathFest and POSE proposal stuff. My goal is to be back in dev mode by this afternoon's dropin. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
As part of the refactor, I've been thinking about separation of concerns for the basic functionality of the CLI. This is most prevalent with
buildandgenerate, althoughviewanddeploymight require some attention too.Right now, when a user runs
pretext build, we first run through thebuildfunction ofcli.py, whichproject.generate(which will becometarget.generate)project.build(soontarget.build)Then the class methods in
project/__init__.pytake over. This entails:buildfunction frombuild.py(either a single one or one based on the format)Then the
buildfunction ofbuild.py:build.py.html()) then makes the output directory if needed, does some reporting, and then in a working directory context, calls thecore.[format-name]function.The story for
generateis almost the same, except the last step also specifies some formats based on the target-format, and re-verifies that anything needs to be done at all (this seems unnecessary).I don't like having to look in three or four spots to find where each check, message, directory-making occurs. It seems like we should be able to eliminate the
build.pyandgenerate.pyfunctions by making them methods of thetargetclass. However, that makes the target class really bulky. I've seem some options for pulling these functions into their own files (inside theprojectmodule/directory), the simplest being to just include these in the__init__.pyfile. Another option would be to do some sort of subclass thing, but I'm not seeing what the objects would be.What do you think?
Beta Was this translation helpful? Give feedback.
All reactions