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

Output SRS Folder Names #1732

Closed
danscime opened this issue Jul 19, 2019 · 8 comments · Fixed by #2748
Closed

Output SRS Folder Names #1732

danscime opened this issue Jul 19, 2019 · 8 comments · Fixed by #2748
Assignees

Comments

@danscime
Copy link
Collaborator

danscime commented Jul 19, 2019

I feel like the names of the output folders for the examples should be changed.
SRS and Website both contain an SRS. The SRS folder contains the PDF version, and Website contains the HTML version.

Screen Shot 2019-07-19 at 12 05 00 PM

@JacquesCarette @smiths

@JacquesCarette
Copy link
Owner

I would be fine with PDF and HTML. Or maybe even better, have a SRS/ directory that contains both? Or a SRS/ directory that has 2 sub-directories, PDF and HTML? [We might gain other formats later].

@danscime
Copy link
Collaborator Author

I like the idea for an SRS folder with sub-directories containing the versions.

@smiths
Copy link
Collaborator

smiths commented Jul 22, 2019

Yes, I like this SRS folder with sub-directories idea too.

@Ant13731
Copy link
Collaborator

Ant13731 commented Jul 29, 2021

This issue is now a little bit more tricky to fix since the Drasil website relies on the Drasil generator as well. Should there be a new type that can determine the output type? Right now, the formatting options are as follows:

type Filename = String
data DocType = SRS | MG | MIS | Website
data DocSpec = DocSpec DocType Filename

But if we want to place the tex and html files in different directories, I think we would need something like this:

type Filename = String
data DocType = SRS | MG | MIS | Website
data OutputType = PDF | HTML
data DocSpec = DocSpec DocType OutputType Filename

This way, we can control both the document type (ex. the Drasil website would use the Website constructor, the other examples use SRS) and the output type (ex. Drasil website uses HTML, other examples would use both PDF and HTML.

Also, are MG and MIS currently being used? If so, would those go under the new SRS folder? I understand that they represent Module Guide and Module Interface Specification, but I don't think they are used.

Edit: I think this design isn't quite right, this change could be moved to drasil-printers rather than drasil-gen.

@Ant13731 Ant13731 self-assigned this Jul 29, 2021
@JacquesCarette
Copy link
Owner

MG and MIS are currently not used. They could be deleted.

Otherwise, I don't quite understand the problem. DocSpec doesn't really tell you anything about what kinds of file types will be put there (and it shouldn't). To be fair, I'm not even sure what DocSpec is really used for (anymore).

@Ant13731
Copy link
Collaborator

I think DocSpec currently tells the generators which kind of file to generate (SRS, MG, and MIS all go to .tex, while Website will go to .html) and the name of the generated file. It also uses the DocType to generate the folder name. Originally, I had thought we wanted to control both the folder name and the kind of file generated, but we don't need to do that. Instead, I think this change might be decent:

  • using the SRS DocType will generate both .tex and .html files in the subfolders as described above. This limits the flexibility a little bit, but I don't think there will be a time where we only want one type of SRS to be generated without the other. In other words, an SRS will always generate in both TeX and HTML in their expected subfolders. This also has the added benefit of reducing one line from each example's Main.hs file, since the generators only need to be called once.
  • Repurpose the Website constructor to be used only for the Drasil website (or any other websites we might want to create). This way, we maintain flexibility over the folder name and it will only generate in HTML. We don't want the website to be inside of an "SRS" folder, so using the Website constructor can tell the generator so.

@JacquesCarette
Copy link
Owner

Having DocSpec mean the kind of document to generate makes sense. Now, we might want a bit more control, i.e. the choice to generate just the HTML or just the latex version of the SRS (for example). This shouldn't be controlled by a 'file type', but something more meaningful. I'm drawing a blank for names, unfortunately! So maybe a list of kinds? And then instead of Filename, perhaps DirectoryRoot ?

I'm fine with re-purposing Website to mean something else entirely, as you suggest.

@smiths
Copy link
Collaborator

smiths commented Jul 29, 2021

Yes, I agree that we won't always want to generate all possible file types for all our outputs. Within our GitHub page, while we are developing Drasil, it makes sense for us to generate everything we can generate. However, when Drasil makes it out into the wild and someone is using it on a real project, they might not want everything. This becomes more noticeable if we extend the file formats for the SRS documents. For instance we could add a text version, or an rtf version. The person using the software might have no need for the tex version, and choose not to generate it. I don't think fine grained control on the types of files that are generated is a high priority, but we should allow for flexibility in the future.

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.

4 participants