-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Bump abatilo/actions-poetry from 2.1.6 to 2.3.0 Bumps [abatilo/actions-poetry](https://github.com/abatilo/actions-poetry) from 2.1.6 to 2.3.0. - [Release notes](https://github.com/abatilo/actions-poetry/releases) - [Changelog](https://github.com/abatilo/actions-poetry/blob/master/.releaserc) - [Commits](abatilo/actions-poetry@v2.1.6...v2.3.0) --- updated-dependencies: - dependency-name: abatilo/actions-poetry dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Bump mkdocstrings from 0.19.1 to 0.25.1 Bumps [mkdocstrings](https://github.com/mkdocstrings/mkdocstrings) from 0.19.1 to 0.25.1. - [Release notes](https://github.com/mkdocstrings/mkdocstrings/releases) - [Changelog](https://github.com/mkdocstrings/mkdocstrings/blob/main/CHANGELOG.md) - [Commits](mkdocstrings/mkdocstrings@0.19.1...0.25.1) --- updated-dependencies: - dependency-name: mkdocstrings dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * (chore) lock update and update in CICD (#35) * (chore) lock update and update in CICD * (chore) updated preprocessor and added testing * (chore) updated pre commit hooks and versions * (chore) updated test to match boostrap distro, improved test error msg. * (chore) upgraded missing versions of checkout and python setup in cicd --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent
82250d3
commit c57d586
Showing
14 changed files
with
1,766 additions
and
1,394 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
from mkquartodocs.extension import AdmotionCellDataPreprocessor | ||
|
||
sample_cell_elements = [ | ||
':::: {.cell execution_count="1"}', | ||
"::: {.cell-output .cell-output-stdout}", | ||
':::: {.cell execution_count="3"}', | ||
"``` {.python .cell-code}", | ||
"```", | ||
"::::", | ||
] | ||
|
||
# Tests from quarto version 1.5.56 | ||
# Rendered with --to=markdown | ||
|
||
EXAMMPLE_INPUT_FILE = """ | ||
:::: {.cell execution_count="3"} | ||
``` {.python .cell-code} | ||
import warnings | ||
warnings.warn("This is a warning") | ||
``` | ||
::: {.cell-output .cell-output-stderr} | ||
... UserWarning: This is a warning | ||
warnings.warn("This is a warning") | ||
::: | ||
:::: | ||
""" | ||
|
||
EXAMPLE_OUTPUT_FILE = """ | ||
``` {.python .cell-code} | ||
import warnings | ||
warnings.warn("This is a warning") | ||
``` | ||
!!! warning "stderr" | ||
... UserWarning: This is a warning | ||
warnings.warn("This is a warning") | ||
""" | ||
|
||
|
||
def test_conversion(): | ||
preprocessor = AdmotionCellDataPreprocessor() | ||
out = [preprocessor._process_line(x) for x in sample_cell_elements] | ||
assert out == [ | ||
"\n\n", | ||
'!!! note "output"', | ||
"\n\n", | ||
"``` {.python .cell-code}", | ||
"```", | ||
"\n\n", | ||
] | ||
|
||
|
||
def test_conversion_file_chunk(): | ||
preprocessor = AdmotionCellDataPreprocessor() | ||
file_lines = EXAMMPLE_INPUT_FILE.split("\n") | ||
out = [preprocessor._process_line(x) for x in file_lines] | ||
|
||
out_str = "\n".join(out) | ||
assert EXAMPLE_OUTPUT_FILE.strip() == out_str.strip() |