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

Creating a log file for examples #2759

Closed
Ant13731 opened this issue Aug 3, 2021 · 2 comments · Fixed by #2774
Closed

Creating a log file for examples #2759

Ant13731 opened this issue Aug 3, 2021 · 2 comments · Fixed by #2774
Assignees

Comments

@Ant13731
Copy link
Collaborator

Ant13731 commented Aug 3, 2021

Building off of #1541 and @balacij's suggestions from a few meetings ago, I think it would be good to make a log file that would tell the user the following:

  • all UIDs in the chunk database
  • chunks that are not dependent on anything
  • chunks that are not used (referenced) by anything

The first one should be easy enough to just print the UIDs (maybe term and abbreviation too if they exist?), and the other UIDs can be obtained through the traceability matrix/graph functions, but I'm not sure of the best way to implement it.

It might be nice to have its own make target (something like example_logs), but I'm not sure how to get the SystemInformation from that point. Maybe we could create a haskell file in the scripts folder that depends on the examples, and just pull the system info from there.

Or we could just make a function and add it to each example's Main.hs file, so that the logs generate every time the file is run (similar to how the traceability graphs always generate up-to-date dot files). But I don't think we would want the logs in stable, or for the logs to run every time.

I was just thinking of making the three points into alphabetically ordered lists just to get the information down, but there's probably a better method of seeing the information.

@Ant13731 Ant13731 self-assigned this Aug 3, 2021
@JacquesCarette
Copy link
Owner

Good idea. It feels like this ought to be an option inside generating the examples itself, as opposed to a separate target. Some kind of Debug option in Choice?

@Ant13731
Copy link
Collaborator Author

Ant13731 commented Aug 4, 2021

Okay, I like the idea of using the example itself (it will probably be much easier to work with). I'm not sure if we can use the existing choices type since that's meant for generated code, but I do have an idea for selecting options.

In #2751 we said that users should have a list of options to feed into the generator function for the kinds of files we want to output. We could instead use a record type to do this, something like:

data SRSChoices = SRSChc {
html :: Bool,
pdf :: Bool,
log :: Bool,
ntbook :: Bool }

Maybe we shouldn't use booleans, but something like that. Or perhaps:

data SRSChoices = SRSChc {
srsTypes :: [DocType]
showLog :: ShowLog}

where ShowLog is a type with two constructors. We could also add a Debug option to the Drasil generators, so the Main.hs file would look like:

main :: IO()
main = do
  setLocaleEncoding utf8
  gen (DocSpec SRS     "Projectile_SRS") srs printSetting
  gen (DocSpec Debug "Projectile_SRS") srs printSetting
  gen (DocSpec Jupyter "Projectile_SRS") srs printSetting
  gen (DocSpec Jupyter "Projectile Motion Lesson") PL.nb PL.printSetting
  genCodeWithChoices choiceCombos
  genDot fullSI

Edit: See PR #2771 for the type setup, will probably change once I have a working copy of the log generators.

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 a pull request may close this issue.

2 participants