This package is a plugin for the Emacs Dashboard which inserts a section containing a configurable number of top stories from Hacker News.
M-x package-install RET dashboard-hackernews
Installation with use-package
(use-package dashboard-hackernews)
Since this version of the package is available on MELPA there’s no need to explicitly set the load-path, but if you’re interested in forking the repository and trying out your own local modifications you can do so like this:
(use-package dashboard-hackernews
:load-path "path/to/files/emacs-dashboard-hackernews"
:config
(require 'json))
Installation with straight.el
Installation with straight.el
is a breeze.
(straight-use-package 'dashboard-hackernews)
If you’d like to pull directly from GitHub or reference a fork of this repository, simply define a custom recipe.
(straight-use-package
'(dashboard-hackernews
:type git
:host github
:repo "hyakt/emacs-dashboard-hackernews"))
When using both straight.el
and use-package
, the configuration looks like this:
(use-package dashboard-hackernews
:straight t)
or…
(use-package dashboard-hackernews
:straight (:type git :host github :repo "hyakt/emacs-dashboard-hackernews")
:config
(require 'json))
This package provides a new section for the dashboard, simply include it in the dashboard-items
list with an integer specifying how many links you’d like to show.
Below is a minimal, bare-bones, example. Assuming emacs-dashboard
has already been loaded, the
following would show a single section containing a Hacker News feed of 10 stories.
(require 'dashboard-hackernews)
(setq dashboard-items '((hackernews . 10)))
For those who require a little more context, the following is a more complicated example showing
configuration with use-package
and straight.el
.
(use-package dashboard-hackernews
:straight (:type git
:host github
:repo "hyakt/emacs-dashboard-hackernews"
:branch "master")
:config
(require 'json))
(use-package dashboard
:after dashboard-hackernews
:config
(setq dashboard-banner-logo-title "My Dashboard" ; set the title
dashboard-startup-banner 'logo ; show the logo in the banner area
dashboard-set-init-info t ; show package load / init time
dashboard-set-heading-icons t
dashboard-set-file-icons t
dashboard-items '((recents . 5) ; this is where the magic happens
(bookmarks . 5)
(hackernews . 5)
(agenda . 5))
dashboard-center-content t ; center the dashboard
dashboard-week-agenda t) ; set the agenda
(dashboard-setup-startup-hook))