-
-
Save srijanshetty/9fe59c86aff7aa5c52cb to your computer and use it in GitHub Desktop.
Ramda documentation browser using command line
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Browse Ramda documentation in Terminal | |
# Requires jq and a tool such as fzf or peco for interactive filtering | |
LATEST="https://raw.githubusercontent.com/raine/ramda-json-docs/gh-pages/latest.json" | |
DOCS_URL="http://ramdajs.com/docs/" | |
json=$(curl -s $LATEST) | |
functions=$(echo "$json" | jq -r '.[] | if .sig and (.sig | length > 0) then .name + " :: " + .sig else .name end') | |
fn=$(echo "$functions" | fzf --reverse) || exit 0 | |
fn_name=$(echo $fn | awk '{print $1}') | |
desc=$(echo "$json" | jq -r ".[] | select(.name == \"$fn_name\") | .description" | fmt) | |
docs_url="$DOCS_URL#$fn_name" | |
echo "$fn" | |
echo | |
echo "$desc" | |
echo | |
echo "$docs_url" | |
# Open URL in browser | |
# open $docs_url | |
# xdg-open $docs_url # linux |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GIF89a4�w !�NETSCAPE2.0 !� 6 , 4��#$$&$,., 9,0$,,01!"<:(%5$4++123.(024=>??OI0CT9K^7WB8S@>SK=RfD7I'$H($C8 {92C4Zc]$m[$rY)~V(Up|Ys~sMzyPzbcTfm`jqbm|zWr�^v�}R�\�S`�Tc�Wh�`p�bt�fp��p���71�LS�TY�[e�hx�d��k��i��o��{��y���8��;��B��C��f��x��E��O��O��}��o��j��]��T��q��rҴ]��d��g��r��q��z��z��������Ն��������� � H����"�°!C�#J�H��ŋ3j�ȱ�Ǐ C�I��ɓ:Dɲ�˗0cʜI��M�,��A�)J֠BID� o*]ʴ�ӧP�JM8�H�0=RS�L | |
�V�p9�éhӪ]˶�[�%� 10�2]@찅� | |
�~yK���È3mq�ȃ�9�fi0І�*��U̹��Ϡ�01���@h���j&b�$���۸s{4��G 6��� �U��b`�+bMhF������CkaE�2\@�d�Ȓ�qY�A���˟O�� ��x¸a!�@���q��_�mV߃F(!H � D�PUWe%�V]}�aXc���(���0�U?T@]9��b%Q։,����pU�CWX)� bA�d��)�TVY|Vf��b��`�Y��b�i�l���l���p�)�t�i�x��|��矀*蠄j衈&�袌6�裐F*餔Vj饘f�馜v�駠�*ꨤ�jꩨ��ꪬ��꫰��*무�j뭸�뮼����+��k��&���6���F+���Vk���f����v�����+��k�覫������+���k�������� ,��l��'���7���G,��Wl��g���w��� �,��$�l��(����,����0�,��4�l��8���<����@-��Dm��H'���L7���PG-��TWm��Xg���\w���`�-��d�m��h����l����p�-��t�m��x���|����߀.���n��'���7���G.��Wn��g���w��砇.�褗n�騧��ꬷ����.���n�����������/���o���'����7����G/���Wo���g����w�����/���o��觯��������/����o����������� � H���L���:����'H� | |
Z��̠7��z�� �GH����(L� | |
W�����0��gH����8̡w�����@�s�H�"�HL����&:�P���H�*Z�X̢���.z�`��H�2��hL����6��p���H�:��x̣���>��� I�B�L�"��F:�$'��� !� ,5 �$(2=802D>R^UA,BBAMAE]muj\HxgQoqqqqw~����|��v������������������ _ (Ђ�� D�P�@��hA" |