From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <9front-bounces@9front.inri.net> X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=DATE_IN_PAST_06_12, DKIM_INVALID,DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI autolearn=no autolearn_force=no version=3.4.4 Received: from 9front.inri.net (9front.inri.net [168.235.81.73]) by inbox.vuxu.org (Postfix) with ESMTP id 11A4E2D6E8 for ; Thu, 3 Oct 2024 20:44:12 +0200 (CEST) Received: from mx1.riseup.net ([198.252.153.129]) by 9front; Thu Oct 3 14:42:59 -0400 2024 Received: from fews02-sea.riseup.net (fews02-sea-pn.riseup.net [10.0.1.112]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx1.riseup.net (Postfix) with ESMTPS id 4XKLCP4ggkzDqJk for <9front@9front.org>; Thu, 3 Oct 2024 18:42:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1727980977; bh=JUU2aoUFgAEA773yu5y/gOYQFP+RwBvOh2WRmGT9tPg=; h=To:From:Subject:Date:From; b=j7iRZ6j4IC7t56IDHCj8THvNKqNDmQbThZ0/snrqlYH7ZzBzVu8ApQfH7tgVjqk1J UBulHGIkP647oUFvLP9ldly5/7bkRa2GxezG6jYJg0vTWyQXiMrgowbtqqWRAAxgS7 wXTZqrpS6+uXLpno+R69fGBJk6RXEJ/WJquSAfBE= X-Riseup-User-ID: F3FFC89BAADA281676A6C032B30F8263E4E432D0493F1ABECE84ADAA91786585 Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews02-sea.riseup.net (Postfix) with ESMTPSA id 4XKLCN01NlzFpxf for <9front@9front.org>; Thu, 3 Oct 2024 18:42:55 +0000 (UTC) To: 9front@9front.org From: mkf9 Message-ID: Date: Thu, 3 Oct 2024 16:10:18 +0330 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: element injection-scale GPU-scale manager Subject: [9front] LN macro Reply-To: 9front@9front.org Precedence: bulk Hello. I have a patch for ms2html, which adds a new macro to insert hyperlinks into documents, currently, the best solution we have currently is hard-coding html tags, example in htmlroff: .html a this is a link .html a or in ms2html: ._H this is a link ._H both of which are not very good. It'd be nice if we had a common way to insert hyper links into html and pdf (and possibly ps) documents, without hard-coding any thing specific to those formats. this is what .LN macro tries to solve, at least for ms2html, for now. i'll send a patch for htmlroff and mhtml later on. comments are welcome. :) diff d8973bdc75d5e7c7a35855f78ade347c01f985f1 uncommitted --- a/sys/src/cmd/ms2html.c +++ b/sys/src/cmd/ms2html.c @@ -87,13 +87,14 @@ F g_br, g_ft, g_sp, g_de, g_lf, g_so, g_rm, g_in; F g_nr, g_ig, g_RT, g_BS, g_BE, g_LB, g_ta; -/* macros to include ML in output */ -F g__H, g__T; +/* macros to include HTML in output */ +F g__H, g__T, g_LN; Goobie gtab[] = { { "_T", g__T, }, { "_H", g__H, }, + { "LN", g_LN, }, { "1C", g_ignore, }, { "2C", g_ignore, }, { "AB", g_AB, }, @@ -2264,6 +2265,25 @@ printargs(argc, argv); Bprint(&bout, "\n"); titleseen = 1; +} + +/* HTML tag */ +void +g_LN(int argc, char **argv) +{ + static int onlink = 0; + if(onlink) + { + Bprint(&bout, "\n"); + onlink = 0; + } + else + { + Bprint(&bout, "\n"); + onlink = 1; + } } void