Skip to content

Commit

Permalink
Add "input" option (#13)
Browse files Browse the repository at this point in the history
GitHub: fix GH-12

It controls wheter a converted `.html` includes code inputs or not.

### Changes:

- Updated  `README.md ` to include the new feature description
- Added the `--no-input` command line argument in `converter.rb`,
similar to how it was implemented for `--no-prompt`. Both features
follow the same logic.
  • Loading branch information
ashishmathew0297 authored Sep 19, 2024
1 parent 4f890d1 commit a4e3e90
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,24 @@ jupyter_notebook:
prompt: false
```

### `input`

Similar to how `prompt` works, you can also control whether a converted `.html` includes code inputs or not by using `input`:

```yaml
jupyter_notebook:
input: true
```

The default value is `true`. It means that input code blocks are shown.

You can remove them by using `false`:

```yaml
jupyter_notebook:
input: false
```

## Authors

* Kouhei Sutou \<kou@clear-code.com\>
Expand Down
1 change: 1 addition & 0 deletions lib/jekyll-jupyter-notebook/converter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def convert_notebook(content, config)
"--to", "html",
"--stdout",
]
command_line << "--no-input" unless config.fetch("input", true)
command_line << "--no-prompt" unless config.fetch("prompt", true)
command_line << notebook.path
pid = spawn(*command_line, out: output)
Expand Down

0 comments on commit a4e3e90

Please sign in to comment.