mirror of
https://github.com/doomemacs/doomemacs.git
synced 2025-12-06 10:31:23 -08:00
1. Add jump-to-heading functionality for EWW buffers
2. Bind within imenu (replaces +eww/jump-to-url-on-page; bound to
`:localleader l`)
The new functions are based on existing `eww--capture-url-on-page` and
`+eww/jump-to-url-on-page`. However, I took a different approach and
used alists to hide the position/coordinates from the `completing-read`.
Also, unlike `+eww/jump-to-url-on-page`, we don't give the user an
option of limiting the scope to a region or visible portion of the
buffer. `+eww/jump-to-heading-on-page` always prompts based on the
entire buffer.
Examples:
1. `<h1>H1</h1>`
- "H1"
2. `<h1>H1</h1><h2>H2</h2>`
- "H1"
- "H1/h2"
3. `<h1>H1</h1><h2>H2</h2><h3>H3</h3>`
- "H1"
- "H1/H2"
- "H1/H2/H3"
4. `<h1>H1-1</h1><h2>H2</h2><h1>H1-2</h1>`
- "H1-1"
- "H1-1/H2"
- "H1-2"

Gaps in the hierarchy (for example a `<h2>` followed by an `<h5>`) are not
represented in the labels presented to the user. Take the Wikipedia
entry for Emacs (above) as an example. The `<h2>` "Content" is the first
heading on the page, there's no preceeding `<h1>`, so it's shown to the
user as "Content" without any prefix. Examples:
1. `<h2>H2</h2>`
- "H2"
2. `<h2>H2</h2><h4>H4</h4>`
- "H2"
- "H2/H4"
3. `<h2>H2</h2><h4>H4</h4><h5>H5</h5>`
- "H2"
- "H2/H4"
- "H2/H4/H5"
4. `<h2>H2</h2><h1>H1</h1><h5>H5</h5>`
- "H2"
- "H1"
- "H1/H5"
- modules/emacs/eww/autoload.el
- (eww--capture-url-on-page): Rename to `eww--capture-urls-on-page`
- (eww--capture-headings-on-page): Add; based on existing `eww--capture-urls-on-page`
- (+eww/jump-to-heading-on-page): Add; based on existing `+eww/jump-to-url-on-page`
- modules/emacs/eww/config.el
- (keybind) Bind `+eww/jump-to-heading-on-page` to `<:localleader.>`;
based on existing org-mode jump-to-heading keybind (`consult-org-heading`)
|
||
|---|---|---|
| .. | ||
| dired | ||
| electric | ||
| eww | ||
| ibuffer | ||
| tramp | ||
| undo | ||
| vc | ||
| .doommodule | ||
| README.org | ||
:emacs
Description
Modules in this category augment and extend the built-in features of Emacs.
Frequently asked questions
This category has no FAQs yet. Ask one?