From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: James Thomas Newsgroups: gmane.emacs.help Subject: Browsing Github using eww Date: Sat, 27 Jul 2024 17:42:25 +0530 Message-ID: <86sevvt4nq.fsf@gmx.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20982"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jul 27 14:12:56 2024 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sXgIB-0005Hx-6Q for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 27 Jul 2024 14:12:55 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sXgHw-0003Kw-H6; Sat, 27 Jul 2024 08:12:40 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sXgHu-0003Kl-ML for help-gnu-emacs@gnu.org; Sat, 27 Jul 2024 08:12:38 -0400 Original-Received: from mout.gmx.net ([212.227.17.20]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sXgHn-0007l0-2I for help-gnu-emacs@gnu.org; Sat, 27 Jul 2024 08:12:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1722082349; x=1722687149; i=jimjoe@gmx.net; bh=hhAVC2zk3uClDVuuGg6ak6Ww2Eho5g7xyroFziWAN0A=; h=X-UI-Sender-Class:From:To:Subject:Date:Message-ID:MIME-Version: Content-Type:cc:content-transfer-encoding:content-type:date:from: message-id:mime-version:reply-to:subject:to; b=NK+123H6fovbt/tpXTUbDs7YAnSR7PULfbagliVzW+foPCuuEAKQ/wTdH8cqTV2P 9jdn9W21nUCu76Vl72bUbymOFtAC5cL4Mzqycj8htQ2aintiB8WdqgTZ71vGNODC4 nS8Xn4KTASc9Vtr+VShJfdyNfPSRfS3uBfh3W6nZyLz3J2yAVSFeQxntUkj5PwuRv shUqhy3mhXtyMvFRQsICDomt7z8NydCvu1pREC1cZVj+Lpc298cqJbtn0ptWpYqV5 LjDlyLroRUZxygAFyd/1SK1iHmTd5KnZPHUnuPO4LPgbVmARGtFo35+vWKjug9luy cl99/rnOcqf1KBi/gQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from user-Inspiron-3493 ([117.206.136.148]) by mail.gmx.net (mrgmx104 [212.227.17.174]) with ESMTPSA (Nemesis) id 1MfHEJ-1s5neh3oOR-00kTUv for ; Sat, 27 Jul 2024 14:12:29 +0200 X-Provags-ID: V03:K1:6LE+EWRQKB/yCGz8s8Vnbb9HUFv5L6G6NP3q/iNnUwGHzasCCD3 I+cYcuRgRrEljiA52IFY90ITWnFj4Jz4Cs+i5Auv4AHs/nF54bQQITKBDZqwBiQxzx1ywIs zAX/j08UhscPNgKrvwJyES/OdjLDHqqzUtD+Z5iLFJ6zTvyYaySDpRfjQMNJNgJe7u0uC4q zy8GJVdRvabRkE9x+bkGQ== UI-OutboundReport: notjunk:1;M01:P0:ZbLq/gOP4cI=;OzSc73kiguxPuSdpLre4N/hXerK zzv1e4PdypEYEHIQngu+EuVQOMCuosRehu0chs28fP72D08pFWyaSyFvQXACPSiMR7hKp/YD8 E4q1hLTK/xAbJj5hyYyNppzbVOCzqShtSVm9vOLlWpxkZ8K2d2/K45WGKNFhSr7pcbvVKFOux ozDhmjj7nEy0EMiaCn6Mhpi6M5fMOGBBNrBClJW0QwT4a11hvlMbfK0k0Tv6UcWIt9gZ4mvya D5pFUspPas3sVESjIzdeFja8/5eR0EPavTCJIgfxQpDzcxlEqjO0Tlj/FKjfAX67YH3pRntd9 Jmv46n1QYzT+rJF/6mZR2PJql1py99VQs6pBEEGt7/EqHR+tst3UeNS92KbvklktQ7FMOYBu8 o0RLuF8INLi2i9WbXJUT16lZGVOwYE8h+1lxg06Yw1S4vgYUfSTAyH6vzE++B9/9ECvzTUbBG PdWB4LboLsRdX/GPYW+SJr0GZYUkS8BOshzV0Q6TljecZAn/6IW69FFqiFWgQjDKF0AMhskZD UFftxdC8K6ZJozsJIu3xdvIN7HcPK4TNrebZsG/mOucD16ZNMrfjMsfNyCBYpVtR750dXZ1mT 4fjWzldcq/WpacwjY81U5Sl5/Gxrumbsvxdop7PiZKcebgapzVJyJiewNPb67FpVR3kRUCjCH fbezUTUyHPiiqEi+tCdv6EsJ+VzMBJLvYLkO8YVngv56WjaY+TYsTqb6hQTxnxuDdY2aa96KX WRfgjg7uxnu2aTlLMLv8kdDXWJtTn88TEd/vZTzmZehZ1Cmvv2cK0uBSYuIvaY9+7++8JPlS Received-SPF: pass client-ip=212.227.17.20; envelope-from=jimjoe@gmx.net; helo=mout.gmx.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:147397 Archived-At: I had, by now, accumulated the following hacks: --8<---------------cut here---------------start------------->8--- ;; For eww-url-transformers (defun eww-redirect-github (url) "Redirect github.com automatically." (replace-regexp-in-string "^https://\\(github.com/\\(.*?\\)/blob\\)/.*" "raw.githubusercontent.com/\\2" url t nil 1)) ;; For file list being hidden. (defun my/eww-tag-script (dom) (when-let ((url (eww-current-url)) (_ (string-prefix-p "https://github.com/" url)) (_ (string= "application/json" (dom-attr dom 'type))) (_ (string= "react-app.embeddedData" (dom-attr dom 'data-target))) (start (point))) (seq-map (lambda (i) (shr-ensure-newline) (shr-tag-a (dom-node 'a (list (cons 'href (replace-regexp-in-string "https://github.com/[a-zA-Z0-9-_.]+/[a-zA-Z0-9-_.]+/tree/[a-zA-Z0-9-_.]+/\\(.+\\)" (gethash "path" i) url t t 1))) (gethash "name" i)))) (gethash "items" (gethash "tree" (gethash "payload" (json-parse-string (car (dom-children dom))))))) ;; (put-text-property start (point) 'face 'shr-code) )) (setq shr-external-rendering-functions '((script . my/eww-tag-script))) --8<---------------cut here---------------end--------------->8--- ...for this, but I've realized that the latter, for e.g. may not be necessary: refreshing the page 3-4 times gets a version with the files list shown. So I was wondering if someone out there has something better (simpler, cheaper, more reliable) to share. Or know of anyone maybe compiling any such workarounds - for others like Gitlab as well? Regards, James