Skip to content

Commit

Permalink
Merge pull request nushell#34 from FMotalleb/main
Browse files Browse the repository at this point in the history
add `nu_plugin_image` plugin
  • Loading branch information
fdncred committed Dec 10, 2023
2 parents b5fab67 + 32d0508 commit 3d12969
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 18 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ You can find some examples about how to create and use plugins in the [Nushell P
- [nu_plugin_msgpack](https://github.com/hulthe/nu_plugin_msgpack): Nushell plugin for converting to and from msgpack.
- [nu_plugin_bash_env](https://github.com/tesujimath/nu_plugin_bash_env): A Bash environment plugin for nushell.
- [nu_plugin_units](https://github.com/JosephTLyons/nu_plugin_units): A Nushell plugin for easily converting between common units.
- [nu_plugin_image](https://github.com/FMotalleb/nu_plugin_image): A nushell plugin to open png images in the shell and save ansi string as images.

> If the shell freezes while registering the command, that means the plugin is using an older Nu version no longer compatible with your current version. Consider bumping the Nu version to the latest in the `cargo.toml`, (may lead to breaking the script).
Expand Down
41 changes: 27 additions & 14 deletions action.nu
Original file line number Diff line number Diff line change
Expand Up @@ -209,20 +209,25 @@ export module plugin-list {
]: record -> record {
let input = $in
use version "compare to"
if ($input | is-empty) {
return $input
}
if ((($input.plugin | compare to $min_plugin) == -1) or ($input.protocol | compare to $min_protocol) == -1) {
return ($input
| upsert plugin $"⛔($input.plugin)"
| upsert protocol $"⛔($input.protocol)"
)
match [$input.plugin?, $input.protocol?,] {
[$plugin_version,$protocol_version] if ($plugin_version != null and $protocol_version != null) => {
if ((($plugin_version | compare to $min_plugin) == -1) or ($protocol_version | compare to $min_protocol) == -1) {
return ($input
| upsert plugin $"⛔($plugin_version)"
| upsert protocol $"⛔($protocol_version)"
)
}

return ($input
| upsert plugin $"($plugin_version | compare to $plugin | get icon)($plugin_version)"
| upsert protocol $"($protocol_version | compare to $protocol | get icon)($protocol_version)"
)
}
_ => {
return $input
}
}

return ($input
| upsert plugin $"($input.plugin | compare to $plugin | get icon)($input.plugin)"
| upsert protocol $"($input.protocol | compare to $protocol | get icon)($input.protocol)"
)
}

# crete a table entry from given plugin record
Expand All @@ -241,8 +246,16 @@ export module plugin-list {
# creates a table of plugins from given plugin list yaml file
export def create-table [] : record -> table {
let config: record = $in
let plugin_version = ($config.core.plugin_repository | get-toml main | get package.version | get self or version)
let protocol_version = ($config.core.protocol_repository | get-toml main | get package.version | get self or version)
let plugin_version = ($config.core.plugin_repository
| get-toml main
| get package.version
| get self or version)

let protocol_version = ($config.core.protocol_repository
| get-toml main
| get package.version
| get self or version)

let result = $config.plugins
| par-each { |i| $i
| make entry
Expand Down
6 changes: 5 additions & 1 deletion config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,11 @@ plugins:
repository:
url: https://github.com/JosephTLyons/nu_plugin_units
branch: main

- name: nu_plugin_image
language: rust
repository:
url: https://github.com/FMotalleb/nu_plugin_image
branch: main
# Example
# - name: nu_plugin_bin_reader # the plugins name (mandatory)
# language: python # programming language (mandatory)
Expand Down
45 changes: 42 additions & 3 deletions plugin_details.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,43 @@
[table 36 rows]
EvalBlockWithInput(Span { start: 107690, end: 107694 }, [CantFindColumn { col_name: "plugin", span: Span { start: 114641, end: 114647 }, src_span: Span { start: 114634, end: 114640 } }])
|name|version|description|plugin|protocol|
|-|-|-|-|-|
|[nu_plugin_periodic_table](https://github.com/JosephTLyons/nu_plugin_periodic_table)|0.2.7|A periodic table of elements plugin for Nushell|⚠️0.85.0|⚠️0.85.0|
|[nu_plugin_query](https://github.com/nushell/nushell/tree/main/crates/nu_plugin_query)|0.87.2|A Nushell plugin to query JSON, XML, and various web data|✅0.87.2|✅0.87.2|
|[nu_plugin_inc](https://github.com/nushell/nushell/tree/main/crates/nu_plugin_inc)|0.87.2|A version incrementer plugin for Nushell|✅0.87.2|✅0.87.2|
|[nu_plugin_gstat](https://github.com/nushell/nushell/tree/main/crates/nu_plugin_gstat)|0.87.2|A git status plugin for Nushell|✅0.87.2|✅0.87.2|
|[nu_plugin_net](https://github.com/fennewald/nu_plugin_net)|1.3.0|A nushell plugin for enumerating network interfaces in a platform-agnostic way|✅0.87.0|✅0.87.0|
|[nu_plugin_pnet](https://github.com/fdncred/nu_plugin_pnet)|1.3.0|A nushell plugin for enumerating network interfaces in a platform-agnostic way|✅0.87.1|✅0.87.1|
|[nu_plugin_bin_reader](https://github.com/WindSoilder/nu_plugin_bin_reader)|0.0.0|A high level, general binary data reader.|⛔0.0|⛔0.0|
|[nu_plugin_from_parquet](https://github.com/fdncred/nu_plugin_from_parquet)|0.1.0|nu plugin to add parquet support|✅0.87.1|✅0.87.1|
|[nu_plugin_bio](https://github.com/Euphrasiologist/nu_plugin_bio)|0.85.0|Parse and manipulate common bioinformatic formats in nushell.|⚠️0.85.0|⚠️0.85.0|
|[nu_plugin_regex](https://github.com/fdncred/nu_plugin_regex)|0.1.1|nu plugin to search text with regex|✅0.87.1|✅0.87.1|
|[nu_plugin_template](https://github.com/fdncred/nu_plugin_template)|0.0.2|A `cargo-generate` template for making it easier to create nushell plugins.|⚠️0.80.0|⚠️0.80.0|
|[nu_plugin_plist](https://github.com/ayax79/nu_plugin_plist)|0.1.6|Plist parsing for nushell|⚠️^0.83|⚠️^0.83|
|[nu_plugin_plot](https://github.com/Euphrasiologist/nu_plugin_plot)|0.76.0|Plot graphs in nushell using numerical lists.|✅0.87.1|✅0.87.1|
|[nu_plugin_from_hdf5](https://github.com/Berrysoft/nu_plugin_from_hdf5)|0.1.0|A plugin to parse HDF5 files into nushell record.|✅0.87|✅0.87|
|[nu_plugin_from_beancount](https://github.com/jcornaz/nu_plugin_from_beancount)|2.0.0|A nushell extension to load a beancount file into nu structured data|⚠️0.83.0|⚠️0.83.0|
|[nu_plugin_from_bencode](https://github.com/bluk/nu_plugin_from_bencode)|0.8.1|A Nushell plugin to convert bencode data into Nu structured values.|✅0.87.1|✅0.87.1|
|[nu_plugin_dialog](https://github.com/Trivernis/nu-plugin-dialog)|0.2.0|A nushell plugin for user interaction|⚠️0.78.0|⚠️0.78.0|
|[nu_plugin_formats](https://github.com/nushell/nushell/tree/main/crates/nu_plugin_formats)|0.87.2|An I/O plugin for a set of file formats for Nushell|✅0.87.2|✅0.87.2|
|[nu_plugin_dcm](https://github.com/realcundo/nu_plugin_dcm)|0.1.8|A nushell plugin to parse Dicom files|⚠️0.68|⚠️0.68|
|[nu_plugin_hcl](https://github.com/Yethal/nu_plugin_hcl)|0.87.1|A nushell plugin for parsing Hashicorp Configuration Language file format|✅0.87.1|✅0.87.1|
|[nu_plugin_json_path](https://github.com/fdncred/nu_plugin_json_path)|0.0.4|a nushell plugin created to parse json files using jsonpath|✅0.87.1|✅0.87.1|
|[nu_plugin_str_similarity](https://github.com/fdncred/nu_plugin_str_similarity)|0.1.0|a nushell plugin called str_similarity|✅0.87.1|✅0.87.1|
|[nu-plugin-bexpand](https://codeberg.org/Taywee/nu-plugin-bexpand)|1.1.5|A brace expansion plugin compatible with Bash for nushell|⚠️0.81.0|⚠️0.81.0|
|[nu_plugin_highlight](https://github.com/cptpiepmatz/nu-plugin-highlight)|1.0.7|A nushell plugin for syntax highlighting|⚠️0.86|⚠️0.86|
|[nu_plugin_emoji](https://github.com/fdncred/nu_plugin_emoji)|0.0.2|a nushell plugin called emoji|✅0.87.1|✅0.87.1|
|[nu_plugin_kdl](https://github.com/amtoine/nu_plugin_kdl)|0.83.2|Add support for the KDL data format to Nushell.|⚠️0.83.2|⚠️0.83.2|
|[nu_plugin_file](https://github.com/fdncred/nu_plugin_file)|0.1.0|a nushell plugin called file|✅0.87.1|✅0.87.1|
|[nu_plugin_dns](https://github.com/dead10ck/nu_plugin_dns)|1.0.4-alpha.1|A DNS utility for nushell|⚠️0.86.0|⚠️0.86.0|
|[nu_plugin_port_scan](https://github.com/FMotalleb/nu_plugin_port_scan)|1.0.7|A nushell plugin for scanning ports on a target|✅0.87.1|✅0.87.1|
|[nu_plugin_port_list](https://github.com/FMotalleb/nu_plugin_port_list)|1.2.7|A nushell plugin to list all active connections|✅0.87.1|✅0.87.1|
|[nu_plugin_audio_hook](https://github.com/FMotalleb/nu_plugin_audio_hook)|0.1.9|A nushell plugin to make and play sounds|✅0.87.1|✅0.87.1|
|[nu_plugin_desktop_notifications](https://github.com/FMotalleb/nu_plugin_desktop_notifications)|1.0.6|A nushell plugin to send desktop notifications|✅0.87.1|✅0.87.1|
|[nu_plugin_clipboard](https://github.com/FMotalleb/nu_plugin_clipboard)|0.3.1|A nushell plugin to copy text into clipboard or get text from it.|✅0.87.1|✅0.87.1|
|[nu_plugin_explore](https://github.com/amtoine/nu_plugin_explore)|0.1.1|A fast structured data explorer for Nushell.|✅0.87.0|✅0.87.0|
|[nu_plugin_qr_maker](https://github.com/FMotalleb/nu_plugin_qr_maker)|1.0.0|A nushell plugin to create qr code in terminal|✅0.87.1|✅0.87.1|
|[nu_plugin_msgpack](https://github.com/hulthe/nu_plugin_msgpack)|0.1.0||✅0.87.1|✅0.87.1|
|[nu_plugin_bash_env](https://github.com/tesujimath/nu_plugin_bash_env)|0.0.0|A Bash environment plugin for Nushell.|✅0.87|✅0.87|
|[nu_plugin_units](https://github.com/JosephTLyons/nu_plugin_units)|0.1.0|A Nushell plugin for easily converting between common units|⚠️0.86.0|⚠️0.86.0|
|[nu_plugin_image](https://github.com/FMotalleb/nu_plugin_image)|0.2.0|A nushell plugin to open png images in the shell and save ansi string as images (like tables or ...)|✅0.87.1|✅0.87.1|

last update at `2023-12-06 07:11:16 +00:00`
last update at `2023-12-10 12:22:42 +00:00`

0 comments on commit 3d12969

Please sign in to comment.