Git Product home page Git Product logo

darkmark's Introduction

DarkMark

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

pip install darkmark
darkmark --help

 Usage: 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.

```python {.python .darkmark}
r = requests.get('https://waylonwalker.com')
r.status_code
```

Then run darkmark <file>.md and darkmark will insert the results of the codeblock.

``` {.console .darkmark_output}
200
```

Automatic imports

Automatic imports are provided by pyflyby.

Supported Languages

Currently the only language supported is python.

  • python

Example

Running darkmark watch <file.md> updates the file on save.

darkmark.webm

License

darkmark is distributed under the terms of the MIT license.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.