GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Add sphinx extension myst-nb to enable writing executable Markdown notebooks by seisman · Pull Request #3379 · GenericMappingTools/pygmt Conversation
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @@ -1,3 +1,7 @@ | |||
| --- | |||
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Add metadata at the top so that myst-nb can recognize it as a MyST notebook.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| --- | ||
| tags: [remove-stdout] | ||
| mystnb: | ||
| image: center | ||
| --- |
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
---
tags: [remove-stdout]
---
These lines are cell-level metadata for controlling the format of the output. Usually it's not necessary. Here remove-stdout is necessary to hide the long output from pygmt.show_versions().
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| fig.text(position="MC", text="PyGMT", font="80p,Helvetica-Bold,red@75") | ||
| fig.show() | ||
| ``` | ||
| {.align-center width="70%"} |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
No need to include the external image.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
… into the document
| # Workaround from https://github.com/executablebooks/MyST-NB/issues/363 to prevent | ||
| # myst-nb from parsing the .ipynb and .py files generated by sphinx-gallery. | ||
| "**/*.ipynb", | ||
| "**/*.py", |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Can these be more specific to point to a specific folder instead of using **?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Done in 90bb110.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| ```{code-cell} ipython | ||
| --- | ||
| tags: [remove-stdout] | ||
| --- | ||
|
|
||
| import pygmt | ||
| pygmt.show_versions() | ||
|
|
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
These lines are cell-level metadata for controlling the format of the output. Usually it's not necessary. Here remove-stdout is necessary to hide the long output from pygmt.show_versions().
Would it be nicer to actually show the output of pygmt.show_versions() actually? Suggestion to:
pygmt.show_versions() and one for fig = pygmt.Figure() belowpygmt.show_versions() in a dropdown using the hide-output tag (see https://myst-nb.readthedocs.io/en/v0.13.2/use/hiding.html#hide-code-cells).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Readthedocs is showing the PyGMT version as v0.1.dev64+g7a38068.d20240812, but I guess that's ok 😆
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.