[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: saving a buffer without images [PATCH attached]
Boruch Baum <boruch_baum@xxxxxxx> writes:
> * A command that would act either on a selected region or on an entire
> buffer, and which would by default save only the text, ie. links and
> placeholders for images would be stripped. The default save name
> would be based upon the page name, and would save to the default w3m
> save folder.
For a region maybe cut and paste is enough. For the whole page it might
be cute to have options like C-u 2 C-x C-s to control the type of save.
Could split out the code finding the default filename if you wanted to
get that and then add your own wild kind of save.
When cutting and pasting text I haven't liked getting trailing spaces.
Are they to help when waving the mouse around the buffer? Or just what
w3m gives? I delete as necessary after pasting.
> * An option would exist to mark and display all links in lnum format,
> similar to how the programs 'lynx --dump' or 'urlview' render
> pages, with all urls footnoted at the bottom of the page.
-o display_link_number=1 does something like that. I see it has to go
in w3m-halfdump-command-arguments to take effect. You could experiment
to see if you like it. I imagine it's better for text save than for
> * A second option would allow for stripping or inclusion of sections
> of a page based upon names or id's in their html 'span' or 'div'
> elements. This would, for instance, improve readability for many
> pages that have sidebars and header menus
Yes they're often bad. You can tell a disorganised site by the size of
the menus it thinks it must stick on every page :-).
There's some perl HTML::ExtractMain which tries to find real text parts.
It did surprisingly well for just a few lines when last I tried, but
overall is a bit limited. w3m-filter has a chance to mangle the html is
all sorts of creative ways before drawing doesn't it?
> (if (not w3m-save-buffer-html-only)
That would like to consider the C-u no-images argument too.
I went into town last week and when I parked the car there was a fella
on the corner shouting "the end is nigh". I asked him how nigh, since
maybe I only needed to half fill the meter.