Merge pull request #34 from FMotalleb/main

add `nu_plugin_image` plugin
This commit is contained in:
Darren Schroeder 2023-12-10 08:52:10 -06:00 committed by GitHub
commit 3d12969388
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 75 additions and 18 deletions

View File

@ -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).

View File

@ -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
@ -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

View File

@ -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)

View File

@ -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`