Commit Graph

54 Commits

Author SHA1 Message Date
6ad59020a1 force new paragraph after a preformatted html block 2024-02-07 10:22:24 +01:00
95b5c96534 adding a linebreak after a preformatted block 2024-02-06 15:10:31 +01:00
8be531e5e2 a simple type was forcing images to be rendered twice 2024-02-01 14:33:44 +01:00
1bf98cf060 support for preformatted them - close #38 2024-01-31 17:25:33 +01:00
Bert Livens
1cd331170c Added support for <dd> and <dt> tags to ansicat to render websites like https://fsl.software/ better.
Signed-off-by: Bert Livens <bert@bertlivens.be>
2024-01-29 16:51:21 +01:00
6d7c45188f fallback to timg if chafa fails to load an image 2023-12-22 18:50:03 +01:00
Bert Livens
426161e35d Added initial support for html <video> elements, including for their poster tag.
Signed-off-by: Bert Livens <bert@bertlivens.be>
2023-12-19 22:24:35 +01:00
ba5f6ecb91 easier error messages for pictures 2023-12-16 23:50:15 +01:00
e3e81fe344 tentatively fix #33 2023-12-10 22:54:37 +01:00
92516082c1 Access to xdg folders now refactored to be a function
Instead of creating three global variables, a xdg() function now returns
the DATA,CONFIG and CACHE folders.

This allows us to create the cache only when tentatively accessed
(this fixes bug #27)
2023-12-04 11:10:20 +01:00
3164658352 Fixed a crash when parsing hidden_urls bug #32
GemtextRenderer is parsing the text for URLs not starting with "=>" and
adding them later to the list to avoid having to copy/paste with the
mouse. This is an hidden feature.

In this case, the url was not supposed to be one and included [] chars
which prevent urllib to know how to handle it.

The fix involved refactoring the looks_like_url functions out of offpunk
and add it to offutils so it can be used by ansicat to ensure a function
looks_like_url before giving it to urllib.
2023-12-02 00:11:34 +01:00
1dddec0e86 switch the new_page duration from 60 to 600 seconds to catch the same reload 2023-11-24 11:10:03 +01:00
6e09f0264b New theme option: new_link
In gemtext and RSS rendering, if a link point to a page which is
considered as "new" (it has been cached less than 60 seconds after the
page itself), we display it differently (by default in bold white).

This feature allows to quickcly see new links in RSS pages or aggregator
such as antenna.
2023-11-21 22:04:09 +01:00
b03cbd9c64 ansicat : added --mode option 2023-11-19 22:07:15 +01:00
b5640cc474 typo reported on mastodon 2023-11-09 13:13:19 +01:00
e7831338de don’t crash ansicat if run without arguments 2023-11-09 12:46:47 +01:00
5bf84c91fa documentation for ansicat/netcache/opnk 2023-11-09 12:36:32 +01:00
856b89ff45 fixes a crash when parsing invalid RSS dates 2023-11-03 23:01:46 +01:00
bf17b21b30 fixes hang/crash when meeting ; itemtype in gopher 2023-11-01 23:45:47 +01:00
29c447cd8e Revert completely previous fix.
Instead, if we do not support an inline image format, we don’t display
it at all instead of displaying a fake URL
2023-10-20 00:06:59 +02:00
2b234cdc43 initial tentative to support podcast RSS/atom feeds 2023-10-09 13:26:12 +02:00
deaa199303 gemtext renderer should be the default, not plaintextrenderer 2023-10-08 00:23:08 +02:00
1baf311f2c new html parsing for titles 2023-10-07 23:54:58 +02:00
d50bc5a8e2 force closing html title elements 2023-10-07 23:45:01 +02:00
f6cb7723e1 experimental: new plaintext renderer. Also used to view source 2023-10-07 23:30:09 +02:00
c19576bc43 shame on me: never commit without having launching the thing 2023-10-05 18:22:10 +02:00
d50925ce03 should fix ~lioploum/offpunk#24 2023-10-05 18:17:01 +02:00
5dd2238ef2 don’t crash if there’s no XMLParsedAsHTMLWarning in BS4 (as we are trying to avoid them anyway 2023-10-05 14:27:58 +02:00
4892b9e450 fixes a crash reported by Xavier Maillard for RSS feeds without link elemnet 2023-10-01 14:04:17 +02:00
f8d185eac9 ignoring encoding errors in ansicat 2023-09-23 10:42:45 +02:00
f33a4cb1e9 use chafa by default if version >= 1.10 2023-09-15 21:54:51 +02:00
ea82e81d75 Improve handling of base64 images
Also makes images links absolute in the rendering
2023-09-13 21:49:52 +02:00
7a606b71cf some ugly code to filter XMLparsedAsHTMLWarning from BS4 2023-09-12 18:06:42 +02:00
dc238309dd fixes gophermap being badly rendered as gemtext 2023-09-11 10:47:38 +02:00
b1effe57b6 not trying to display absent images 2023-09-04 10:29:14 +02:00
e14009f2a4 ansicat working again alone 2023-09-03 23:20:54 +02:00
0c2b24dd89 Themes and reload
- added background colours to theme
- theme for blockquote and preformatted in gemtext (untested)
- cleanup cache on reload
2023-08-31 10:53:24 +02:00
699fed78b9 Introducing themes
You can now customize the colors of offpunk by using the command
"theme".

See "help theme" or use the autocomplete.
2023-08-31 00:40:35 +02:00
1e002f3456 early support for themes in ansicat 2023-08-30 17:02:54 +02:00
5c5fcb3f9e new full_links_only mode to fetch all links from links saved in mode=full 2023-08-30 11:54:24 +02:00
Étienne Mollier
7ad75380a6 Homogenize shebang
Before the change, ansicat, netcache and opnk assume that the
interpreter location is always /bin/python.  While some distributions
do provide python at this location, even as a python3 interpreter,
some others such as Debian do not provide a plain python interpreter
anymore, at least not by default.  There exist packages to provide the
version 2 or the version 3 of the interpreter at that location, but
the three possible configurations (v2, v3 or none) are left at the
discretion of the administrator, so in practice can't really be
predicted in advance.

This change applies the same shebang as offpunk.py and the cache
migration script.  Use of /usr/bin/env has also the side effect of
easing use of python3 interpreters installed at weird locations.

Signed-off-by: Étienne Mollier <emollier@debian.org>
2023-08-30 09:22:08 +02:00
a1ce45403f I broke the feed renderer. Now it works 2023-08-27 13:46:33 +02:00
d7fe66b204 support for multiformat rendering (trying view full for RSS) 2023-08-27 13:11:34 +02:00
8c4f4eee65 compute size of lists 2023-08-22 15:43:17 +02:00
10b3a84be5 Solve the infamous application/javascript bug
Lot of html pages are now recognized as application/javascript. We now
force the HtmlRenderer for application/javascript.

Contact address has also be changed to offpunk2 everywhere
2023-08-22 14:59:20 +02:00
f4818c966e adding file as a dependancy 2023-08-21 01:08:13 +02:00
c7740e0d5e fixing crashes in the network code 2023-08-17 13:41:41 +02:00
67e7c6d7e7 images are now displayed using chafa 2023-08-17 13:41:41 +02:00
13fffcd882 list of todos 2023-08-17 13:41:41 +02:00
1da149e2fa changing licence 2023-08-17 13:41:04 +02:00