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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --format flag to spago docs #299

Merged
merged 3 commits into from Jul 2, 2019

Conversation

elliotdavies
Copy link
Collaborator

@elliotdavies elliotdavies commented Jul 1, 2019

Description of the change

Add a flag to spago docs to support different documentation formats. Fixes #294.

Running stack test on master seems to lead to about half the tests failing, so I can't verify that these changes haven't broken them further.

Checklist:

  • Added the change to the "Unreleased" section of the changelog
  • Added some example of the new feature to the README
  • Added a test for the contribution (if applicable)

P.S.: the above checks are not compulsory to get a change merged, so you may skip them. However, taking care of them will result in less work for the maintainers and will be much appreciated 馃槉

@elliotdavies elliotdavies force-pushed the feature/docs-flag branch 2 times, most recently from 9b3f54b to a2d22f3 Compare July 1, 2019 12:30
Copy link
Member

@f-f f-f left a comment

Choose a reason for hiding this comment

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

Looks great! 馃憦

@f-f f-f marked this pull request as ready for review July 1, 2019 13:14
@elliotdavies
Copy link
Collaborator Author

@f-f Awesome, I just need to do a bit more work to specify an output file when you choose markdown | ctags | etags - otherwise by default the compiler just dumps to stdout. (You only get generated files when choosing html.)

@elliotdavies
Copy link
Collaborator Author

@f-f Actually, a question - in PureScript 0.13 the compiler will output HTML and MD to a generated-docs directory and ctags/etags to tags or TAGS files by default. In 0.12 it outputs HTML to generated-docs but any other option gets dumped to stdout.

What do you think is best for Spago to support? The defaults in 0.13 are fine, I think, but for anyone using 0.12 the stdout dump isn't going to be very useful (you can't even do spago docs --format ctags > tags because the tags file will end up including Spago's own logging). I could implement an --output option but purs doesn't support that in 0.12 so we'd have to implement it ourselves. Or we can just leave all the behaviour as it is.

@f-f
Copy link
Member

f-f commented Jul 1, 2019

@elliotdavies great point. Since we're still in 0.x of both Spago and Purs let's not worry too much about old Purs versions (i.e. it's fine unless we break them, which doesn't seem the case).
And once we fix #256 we'll have a --silent flag to silence Spago's own output, so we should be good anyways.

So I'd say let's go with 0.13 defaults

@elliotdavies
Copy link
Collaborator Author

@f-f OK! In that case I think this is ready to review 馃槃

src/Spago/Purs.hs Show resolved Hide resolved
@f-f f-f merged commit a77b869 into purescript:master Jul 2, 2019
@f-f
Copy link
Member

f-f commented Jul 2, 2019

Thank you @elliotdavies! 馃檪

@elliotdavies elliotdavies deleted the feature/docs-flag branch July 2, 2019 09:16
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 this pull request may close these issues.

Allow pass-through flags for spago docs
2 participants