PluginProbe
Code Block Pro – Beautiful Syntax Highlighting / 1.27.4
Code Block Pro – Beautiful Syntax Highlighting v1.27.4
1.27.1 1.27.2 1.27.3 1.27.4 1.27.5 1.27.6 1.27.7 1.28.0 1.3.0 1.4.0 1.5.0 1.5.1 1.5.2 1.6.0 1.7.0 1.8.0 1.9.0 1.9.1 1.9.2 1.9.3 trunk 1.1.0 1.10.0 1.11.0 1.11.1 All 63 releases
code-block-pro / build / shiki / samples / nushell.sample

nushell.sample in Code Block Pro – Beautiful Syntax Highlighting 1.27.4, at build/shiki/samples/nushell.sample

68 lines 2.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 #!/usr/bin/env nu
2
3 def query-week-span [] {
4 let site_table = [
5 [site repo];
6 [Nushell nushell]
7 [Extension vscode-nushell-lang]
8 [Documentation nushell.github.io]
9 [Wasm demo]
10 [Nu_Scripts nu_scripts]
11 [RFCs rfcs]
12 [reedline reedline]
13 [Nana nana]
14 # ] [Jupyter jupyter]
15 ]
16
17 let query_prefix = "https://api.github.com/search/issues?q=repo:nushell/"
18 let query_date = (seq date --days 7 -r | get 6)
19 let per_page = "100"
20 let page_num = "1" # need to implement iterating pages
21 let colon = "%3A"
22 let gt = "%3E"
23 let eq = "%3D"
24 let amp = "%26"
25 let query_suffix = $"+is($colon)pr+is($colon)merged+merged($colon)($gt)($eq)($query_date)&per_page=100&page=1"
26
27 for repo in $site_table {
28 let query_string = $"($query_prefix)($repo.repo)($query_suffix)"
29 let site_json = (
30 http get -u $env.GITHUB_USERNAME -p $env.GITHUB_PASSWORD $query_string
31 | get items
32 | select html_url user.login title
33 )
34
35 if not ($site_json | all { |it| $it | is-empty }) {
36 print $"(char nl)## ($repo.site)(char nl)"
37
38 for user in ($site_json | group-by user_login | transpose user prs) {
39 let user_name = $user.user
40 let pr_count = ($user.prs | length)
41
42 print -n $"- ($user_name) created "
43 for pr in ($user.prs | enumerate) {
44 if $pr_count == ($pr.index + 1) {
45 print -n $"[($pr.item.title)](char lparen)($pr.item.html_url)(char rparen)"
46 } else {
47 print -n $"[($pr.item.title)](char lparen)($pr.item.html_url)(char rparen), and "
48 }
49 }
50
51 print ""
52 }
53 }
54 }
55 }
56
57 # 2019-08-23 was the release of 0.2.0, the first public release
58 let week_num = ((seq date -b '2019-08-23' -n 7 | length) - 1)
59 print $"# This week in Nushell #($week_num)(char nl)"
60
61 if ($env | select GITHUB_USERNAME | is-empty) or ($env | select GITHUB_PASSWORD | is-empty) {
62 print 'Please set GITHUB_USERNAME and GITHUB_PASSWORD in $env to use this script'
63 } else {
64 query-week-span
65 }
66
67 # From https://github.com/nushell/nu_scripts/blob/main/make_release/this_week_in_nu_weekly.nu
68