-
Notifications
You must be signed in to change notification settings - Fork 208
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
docs(book): include PRQL changelog in book #2348
Conversation
CHANGELOG.md
Outdated
@@ -233,17 +233,21 @@ This release has 74 commits from 12 contributors. Selected changes: | |||
formats. _format-arg_ can be `format:csv` or `format:json`. _string-arg_ can | |||
be a string in any format. (@aljazerzen & @snth, #1514) | |||
|
|||
```prql | |||
```elm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these never be prql
?
Maybe we add a grep lint in pre-commit
if so; otherwise folks are going to forget?
Or are they OK / actually good in prql
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your review.
The problem here is that in the book the prql
code blocks are evaluated by the preprocessor and displayed alongside the sql
code blocks.
If we could disable the evaluation of prql
code blocks throughout the particular file with ignore settings, special comments or yaml front matter, I think we could continue to use prql
code blocks there.
Is that possible now?
Maybe we add a grep lint in
pre-commit
if so; otherwise folks are going to forget?
I did not know of a solution that would make that possible. This is a good method at this stage!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prql_no_test
will skip over creating a comparison table: https://github.com/prql/prql/blob/13d0060dfe80ee3ab098b85207ef6fae9d367a55/web/book/src/lib.rs#L155
(Though do we sometimes want a comparison table?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the issue here is the gap between rendering on GitHub and rendering on Book.
That is, if prql
code blocks are recognized on GitHub in the future (#1636), Changelog will need to use prql
code blocks, but may not want to output sql
on the Book.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Considering that the syntax has changed and past prql
code block can no longer be compiled, Changelog still needs to disable prql
code evaluation on a file-by-file basis.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I actually thought I'd make a change to use a list, quick PR at https://github.com/PRQL/prql/pull/2350/files
(doesn't affect this PR though)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, wonderfully fast work, thanks!
So can we merge this PR now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What should the instructions for including change blocks here be? "Always use elm
"? "Only use prql
if you want a comparison table"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What should the instructions for including change blocks here be? "Always use
elm
"? "Only useprql
if you want a comparison table"?
Good point.
It seems we need to stay with elm
for now.
For now, it seems that when the prql
code block is evaluated, a header PRQL
is added and the display is corrupted.
Lines 315 to 327 in fe1b7d4
- _Experimental:_ The | |
[`case`](https://prql-lang.org/book/language-features/case.html) function sets | |
a variable to a value based on one of several expressions (@aljazerzen, | |
#1278). | |
```prql | |
derive var = case [ | |
score <= 10 -> "low", | |
score <= 30 -> "medium", | |
score <= 70 -> "high", | |
true -> "very high", | |
] | |
``` |
One thing we want to avoid here is:
We could run |
* refactor: Use tags for the language code blocks Idea from #2348 * change to spaces
I added |
Perfect! Should we also add a https://pre-commit.com/#pygrep so no one puts a |
|
It would be great if we could automatically link to issue numbers and GitHub user accounts like |
for more information, see https://pre-commit.ci
Yes totally. A challenge for the future (...generations...)! |
I hit the button to get this in for 0.7.0, hope that's OK! |
In! Thanks @eitsupi ! |
Thanks! |
* refactor: Use tags for the language code blocks Idea from PRQL#2348 * change to spaces
Close PRQL#2344 Since `prql` code blocks in md files included in the Book will evaluated and replace with html, this PR introduce a new Option `no-eval` that modifies the Book preprocessor to not evaluate Changelog's `prql` code blocks. Also add a pre-commit hook to avoid using bare `prql` code blocks on `CHANGELOG.md`. --------- Co-authored-by: Maximilian Roos <5635139+max-sixty@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Close #2344
Since
prql
code blocks in md files included in the Book will evaluated and replace with html, this PR introduce a new Optionno-eval
that modifies the Book preprocessor to not evaluate Changelog'sprql
code blocks.Also add a pre-commit hook to avoid using bare
prql
code blocks onCHANGELOG.md
.