Commit Graph

120 Commits

Author SHA1 Message Date
Mike Sharov b3af85e163 Move project to Sourceforge 2022-09-16 14:21:19 -04:00
Mike Sharov 9e7e7c8291 Sort smartfeeds by date 2022-08-03 11:09:40 -04:00
Mike Sharov 38b699e70e Treat misconfigured pkg-config as no pkg-config 2022-05-17 10:01:40 -04:00
Mike Sharov 70e83a214c Use plain bold for unread items 2022-05-16 17:24:45 -04:00
Mike Sharov f634289f12 Draw titles in plain bold 2022-05-15 15:18:36 -04:00
Mike Sharov 0591d0a3ae Print downloading feed status 2022-05-15 13:20:20 -04:00
Mike Sharov ffc34f3b2b Display feed name when description is empty 2022-04-20 12:19:26 -04:00
Mike Sharov 0b83cbb433 Add home and end keys in item display 2022-04-05 16:16:48 -04:00
Mike Sharov 66f56d699b Support local file urls 2022-02-14 09:41:55 -05:00
Mike Sharov bcac5268b9 Stop setting CFLAGS in Config.mk 2022-02-11 12:40:17 -05:00
Mike Sharov a534490236 Correct be@latin.po locale filename to be.po 2021-11-18 17:52:56 -05:00
Mike Sharov 3868284abb Remove mention of html_entities file from README
html_entities was removed by 5792d4aebd
because libxml2 can already convert all html entities without requiring
the user to manually type them in. Mention of this file was previously
removed from the man pages, but not from the README.
2021-11-14 08:29:42 -05:00
Страхиња Радић 0ea3edd48a po/sr.po: Add space at the end of some messages to match msgid
Signed-off-by: Страхиња Радић <contact@strahinja.org>
2021-10-26 14:27:28 -04:00
Страхиња Радић cf327de9af
po/sr.po: Update Serbian translation (#70) 2021-10-25 17:08:37 -04:00
Mike Sharov 82e16c8630 Update localization string use and data
Review the code for proper use of localized strings. Fix display code to
always output them as utf8. Recreate the localization template with the
strings currently in use. Convert all existing .po files to utf8. Run
msgmerge on all .po files to update strings to match the new template.

Due to my lack of experience in using gettext and subsequent avoidance
of messing with it, the localization data has not been updated in quite
some time and most strings have become obsolete. This unfortunately has
resulted in wasted effort from some translators, most recently @J0hsHH
and @Strahinja, to whom I can only offer an apology and an invitation to
review their translations.
2021-10-25 13:46:37 -04:00
Johannes Hove-Henriksen dbea2ae857
Add norwegian translation 2021-10-24 08:52:22 -04:00
Mike Sharov a43c1811c2 Restore linking to -lintl on non-linux platforms
Restore linking to -lintl, which contains gettext on non-linux
platforms. Was removed together with -liconv by commit
63f0d70806. iconv is no longer needed, but
intl still is. Fixes #68.
2021-10-19 08:46:41 -04:00
Mike Sharov d4b98ce555 Add ncurses -Defines when no pkg-config 2021-10-02 18:29:09 -04:00
Mike Sharov 91192d03b8 Rewrite the text wrapping code
Write a new, simpler and more efficient, text rewrapper. Remove
generation of the linked list of lines for display and instead
display lines directly from the buffer.
2021-10-02 18:17:22 -04:00
Mike Sharov 63f0d70806 Stop using iconv
Stop using iconvert and remove it. RSS text must always be formatted in
UTF8 and other locale encodings are not supported. With no encoding
conversion needed, libiconv is also no longer used, so stop linking it.
2021-10-02 10:38:01 -04:00
Mike Sharov c595baed67 Strip html tags when loading, not when drawing 2021-10-02 10:22:25 -04:00
Mike Sharov adbf83cf85 Remove obsolete stuff in docs/
- Remove docs/CHANGES; see git release tag description.
- Remove docs/CREDITS; see git history.
- Deprecate filters. Filters used to be necessary for getting
    https or Atom feeds. Since both of these were very common, everybody
    had to use filters. Now snownews reads https and Atom natively
    and filters just aren't needed any more for most people. So keep
    supporting them, but stop mentioning them favorably in the docs.
- Remove the bugzilla example script. Having contributed scripts in the
    main repository is a bad idea because I can't test them and thus
    have no idea whether they work. They were never even installed by
    default, making discoverability a problem.
2021-09-22 19:54:51 -04:00
Mike Sharov 5792d4aebd Remove html_entities configuration
Stop reading or creating the html_entities config file. libxml
htmlEntityLookup already knows about all the entities, so there is no
reason to make the user type them in manually.
2021-09-18 14:46:55 -04:00
Mike Sharov 7f5ddbc1df Rewrite the HTML-to-text converter
Simplify UIDejunk to strip tags in-place instead of reallocating the
output char-by-char. Remove hardcoded entity matching, use only
htmlEntityLookup from libxml, which already knows about them. Always
output UTF8 instead of the terminal locale when replacing entities.
2021-09-15 17:30:08 -04:00
Mike Sharov bdc12f8b29 Fix hang during text rewrapping
Should always use utf8_length when checking line length against screen
width, but always use strlen when checking the size of the buffer. Using
strlen to check against width resulted not cutting the loop.
2021-07-27 20:32:14 -04:00
Mike Sharov 1485f68c71
Merge pull request #64 from Strahinja/master
Add Serbian translation.
2021-07-21 08:55:30 -04:00
Страхиња Радић 2ae0096267 po/sr.po: New file
Signed-off-by: Страхиња Радић <contact@strahinja.org>
2021-07-21 10:22:52 +02:00
Mike Sharov bde296b92c Quit normally on non-fatal signals
SIGINT, SIGQUIT, and SIGTERM indicate that the user or something else is
trying to terminate snownews, rather than an internal error, so a clean
shutdown is more appropriate than an error message. Closes #63
2021-07-05 13:44:25 -04:00
Mike Sharov 09a39f36d2 Emphasise item title and expand description height 2021-06-06 12:10:18 -04:00
Mike Sharov 0c0bce7d59 Merge pull request #62 from sbruder/escape-opml-title-url
Encode feed title and url for urls.opml
2021-06-05 14:35:50 -04:00
Simon Bruder 01b291ebd0
Encode feed title and url for urls.opml
It is not uncommon to have feeds with an ampersand in the URL or a
quotation mark in the title, which currently make snownews use a
malformed URL or not read the feed entry at all.

This probably also affects categories and filters, though because they
are user-defined, one can just not use special XML characters in them.
2021-06-05 16:37:11 +02:00
Mike Sharov f0834270df Strip CDATA elements from content
Some incompetently written HTML descriptions contain CDATA tags,
sometimes in a horribly arranged soup that seems designed to break out
of a CDATA, which is what RSS wraps it with. The parser chokes on it, of
course, but once stripped, the item can be saved with only a few visual
artifacts of comments and tag pieces.
2021-06-04 14:12:52 -04:00
Mike Sharov 2f70afebac Ignore atom <link> tags where rel != "alternate"
Previously, the atom parsing function would fill in an items link string
with the `href` attribute of the last `<link>` that it found. However,
because the spec (https://validator.w3.org/feed/docs/atom.html#link)
allows an item to have multiple `<link>` tags, with different meanings,
identified by the `rel` attribute, this can lead to the wrong url being
used.

The one we want, the link to the post content, should have the attribute
`rel="alternate"`, or, as this is the default, no `rel` attribute at
all. The atom parsing function now checks for this, and will not set an
items link string unless this is the case.

Thanks to @Uks2 for the fix.
2021-05-29 15:48:29 -04:00
Mike Sharov 14f7135fc3 Save changes to smart feeds
Previously `_feed_list_changed` wouldn't be set to true when the '(New
Headlines)' feed was added or when any smart feed was removed. This
lead to unintuitive behaviour where these changed wouldn't be saved if
they were the only changed made, but would be saved if other feeds were
changed as well. Thanks to @Uks2 for the fix.
2021-05-29 15:41:16 -04:00
Mike Sharov c9b3745309 Add AddFeedToList
Adding a new pointer to the doubly-linked list _feed_list is not a
one-liner and that code was implemented in different ways in three
places. Make all of them call AddFeedToList instead to add a feed.
2021-05-29 15:30:47 -04:00
Mike Sharov 707f862ed6 Fix "categorize feed" keybinding not working
Condition was incorrectly allowing categories only for smartfeeds,
whereas it should be blocked for them. Fixes #61
2021-05-27 17:10:00 -04:00
Mike Sharov e27aa128a8 Make UI more vertically compact
Display feed title in the titlebar instead of on its own line.
Display item link in status bar in feed list and in item view.
Move modified date string to titlebar.
2021-05-21 15:30:04 -04:00
Mike Sharov f7a470d1ac configure: remove some unnecessary quoting
Commit c42dc99a55 went a bit overboard on
quoting. Remove quoting of non-path variables, since they are not
allowed to contain spaces anyway. escpath arguments no longer need to be
quoted because it now operates on all arguments.
2021-05-13 11:13:28 -04:00
Mike Sharov c42dc99a55 configure: portability improvements
Changes by @aabacchus, from running shellcheck.

Fix double-negative conditionals. Use double quotes around substitution
vars to prevent globbing and word splitting. Replace backquote calls
with $() for consistency. Fix syntax error for expr that can take
no arguments.
2021-05-11 20:44:50 -04:00
Mike Sharov 448f9e2049 Support ncurses without widechars
ncurses can be built without widechar support, indicated by not
setting NCURSES_WIDECHAR. In this case any non-english chars will be
substituted with a '?'. Closes #59
2021-05-11 19:03:37 -04:00
Mike Sharov ae41080f0d Do not store empty XML values
An RSS feed that has atom:link tags after link overwrote link value with
empty because atom:link stores the value in href attribute.
2021-04-20 17:13:10 -04:00
Mike Sharov 62f292badf Refactor XML parsing
libXML made a strange decision to use unsigned char pointers throughout
the API, even though all the strings anyone wants to give it are char.
An unreadable sea of casts results. So this adds wrapping calls to work
with char* and thus drastically shrinks and clarifies the parsing code.
2021-04-19 12:53:10 -04:00
Mike Sharov 1a0f39b94b Use title when no custom_title specified
A newly added feed has no custom title, but it will always have a title
downloaded with the feed XML. Save this title into urls.opml. Otherwise
the newly added feed will not be loaded on the next snownews launch.
2021-04-17 14:41:31 -04:00
Mike Sharov e07998c23e Convert man pages to UTF8. Closes #56. 2021-04-12 15:12:45 -04:00
Mike Sharov 181d1a670a Explicitly use ncursesw package. Fixes #55. 2021-04-12 14:56:31 -04:00
Mike Sharov 1b88d70810 Fix configure --with-debug 2021-04-12 14:54:53 -04:00
Mike Sharov 3b501dceb2 Bump version number for release 2021-04-11 18:41:14 -04:00
Mike Sharov f73bbe857f Put usage instructions from man page into README 2021-04-11 18:34:59 -04:00
Mike Sharov 62c0bd5e0e Store feed list as OPML
The old format consisted of |-separated lines, one per feed. OPML is the
usual standard for RSS feed lists, and snownews included the opml2snow
utility to convert to and from it. This commit converts urls format to
native OPML, removing the need for the utility. The file is also renamed
from urls to urls.opml.
2021-04-11 17:36:45 -04:00
Mike Sharov 6d776956ec Move configuration and cache to XDG dirs
snownews kept configuration in ~/.snownews and the feed cache in
~/.snownews/cache. This commit moves configuration to ~/.config/snownews
and the cache to ~/.local/share/snownews, conforming to the XDG basedir
specification. snownews will migrate old settings to the new location.
2021-04-11 14:16:53 -04:00