Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/waylonwalker/darkmark
Runs codeblocks marked with the darkmark, and inserts the results.
https://github.com/waylonwalker/darkmark
interactive ipython markdown python
Last synced: 24 days ago
JSON representation
Runs codeblocks marked with the darkmark, and inserts the results.
- Host: GitHub
- URL: https://github.com/waylonwalker/darkmark
- Owner: WaylonWalker
- License: mit
- Created: 2023-02-05T19:32:03.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-06-01T22:30:35.000Z (over 1 year ago)
- Last Synced: 2024-10-12T11:21:05.292Z (24 days ago)
- Topics: interactive, ipython, markdown, python
- Language: Python
- Homepage:
- Size: 37.1 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# DarkMark
Runs codeblocks marked with the darkmark, and inserts the results.
DarkMark uses tree-sitter to identify codeblocks. Currently it only supports python codeblocks in markdown files and runs them with ipython. Handy for writing docs/blog posts so you can stay right in your markdown editor of choice and get the outputs in line. No need to jump into a whole other tool just to do live execution.
---
## Installation
```console
pip install darkmark
``````console
❯ darkmark --helpUsage: darkmark [OPTIONS] COMMAND [ARGS]...
run code blocks in markdown
╭─ Options ──────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --install-completion [bash|zsh|fish|powershell|pwsh] Install completion for the specified shell. │
│ [default: None] │
│ --show-completion [bash|zsh|fish|powershell|pwsh] Show completion for the specified shell, to copy │
│ it or customize the installation. │
│ [default: None] │
│ --help Show this message and exit. │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ─────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ run │
│ sexp │
│ tui │
│ watch │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯```
## Usage
Mark your codeblocks with the darkmark.
~~~ markdown
```python {.python .darkmark}
r = requests.get('https://waylonwalker.com')
r.status_code
```
~~~Then run `darkmark .md` and darkmark will insert the results of the codeblock.
~~~ markdown
``` {.console .darkmark_output}
200
```
~~~## Automatic imports
Automatic imports are provided by [pyflyby](https://github.com/deshaw/pyflyby).
## Supported Languages
Currently the only language supported is python.
* python
## Example
Running `darkmark watch ` updates the file on save.
[darkmark.webm](https://user-images.githubusercontent.com/22648375/216849738-12897dfc-3e2b-4e5b-9b6d-cbb29c3ae782.webm)
## License
`darkmark` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.