Te

Text2troff – automatically converts plain text to TROFF format

Hacker News

Text2troff – automatically converts plain text to TROFF format

I) TEXT2TROFF is a bash script that uses a combination of awk and sed filters to convert a plain-text-file into TROFF text format, by inserting TROFF request and 'ms' macro commands. The result is sent to standard output, and can be processed further with available 'troff' tools with 'ms' macro package, preferrably GNU groff_ms(7), to produce typeset PostScript-, PDF-, HTML- or terminal ('nroff') output. As an alternative to processing a text-file, text2troff can also read (text) input from a pipe. The functionality includes interpretation of chapter headers, paragraphs, emphasized text, bullet item lists (whether or not nested), tables, footnotes and 'code blocks' (definition see below). It offers various options to set general text font family, style, size and color, the number of text columns per page, representation of chapter headers, paragraphs and tables, as well as end-of-sentence behavior. An option to automatically generate and include a Table of Contents (TOC) is present as well. text2troff offers an alternative to pandoc(1) for producing TROFF text output, by attempting to minimize as much as possible the degree of formatting required in the input text, yet enabling still highly acceptable text typesetting based on a very limited set of simple conventions. These are used by text2troff as criteria by which to 'best-guess' the intended layout of the text. The output produced by this program shouldn't be considered as more than an approximation of any full-blown end result. Further polishing can be done by any additional manual placement of TROFF-requests and/or ms macros if chosen for. Main intent for developing this program was the wish to be able to turn a quick-and-dirty piece of plain text into a decently sophisticated document 'at the push of a button', with enough options to vary its appearance. II) TEXT2TROFF_TABLE is a bash script that uses awk filtering to convert tabulated lines in a plain-text-file into TROFF formatted tables by inserting table requests and ms macros. All lines not interpreted as table lines are passed on unchanged. The result is sent to standard output, and can be processed further with available 'troff' tools with 'ms' macro package, preferrably GNU groff_ms(7), to produce typeset PostScript-, PDF-, HTML- or terminal ('nroff') output. As an alternative to processing a text-file, text2troff_table can also read (text) input from a pipe. III) TROFFORM is a bash script that activates a chosen document format (including ancient AT&T variants) within a TROFF text and deactivates any alternate document formats. It does so by reducing the number of dots prefixed to the ms macro belonging to the chosen format to one (1), and by prefixing two (2) dots to all other document formats ms macros. Unaffected text lines are passed on unchanged, and the result is sent to standard output. The output can be processed further with available 'troff' tools with 'ms' macro package, preferrably GNU groff_ms(7), to produce typeset PostScript-, PDF-, HTML- or terminal ('nroff') output. As an alternate to processing a text-file, trofform can also read (text) input from a pipe. Prerequisite for evoking any of the ancient/authentic AT&T document formats is the presence on the system of the original AT&T 'tmac.s' file with special macros. This special 'tmac.s' macro-file is in the public domain, can be found on the web, and should preferrably be renamed differently as to avoid collisions with the natively installed ms-macro files. In order to process the output correctly, groff must be given option -M with the path to the directory where the AT&T macro-file resides. trofform can be called both interactively (by options -I and -h) and non-interactively (by specifying no or any of the other options).

Share card

Actual performance

2points
Did not reach leaderboard

Launch Intel predictions

Analyze your own launch →
Indie HackersFits the IH revenue-focused audience · Strong signals: para, including · Missing: supports, reddit linkedin, podcasting
88%88% predicted probability of success on Indie Hackers, based on ML models trained on real launch data.
best fitHighest predicted score across all platforms for this description.
Hacker NewsStrong engagement from HN community · Strong signals: ide, pipe, io · Missing: https docs, excited, just released
66%66% predicted probability of success on Hacker News, based on ML models trained on real launch data.
nativeThis product was originally launched on this platform.
AppSumoMay struggle as an AppSumo deal · Missing: plus, platform, intuitive
47%47% predicted probability of success on AppSumo, based on ML models trained on real launch data.
Product HuntUnlikely to reach the leaderboard · Strong signals: mac, notes, code · Missing: agents, macos, agent
41%41% predicted probability of success on Product Hunt, based on ML models trained on real launch data.
TrustMRRLess likely to generate early MRR · Strong signals: para · Missing: mobile apps, ios, personal
27%27% predicted probability of success on TrustMRR, based on ML models trained on real launch data.
Acquire.comPre-revenue stage for this audience · Strong signals: active · Missing: arr, mrr, revenue
14%14% predicted probability of success on Acquire.com, based on ML models trained on real launch data.
BetaListMay not resonate with beta-testers · Missing: web3, chat, crypto
0%0% predicted probability of success on BetaList, based on ML models trained on real launch data.

Incorrect prediction on native model

Similar products

X-
X-File – The secure plain text format50%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

X-File – The secure plain text format

Hacker News3
En
Encrypt/Decrypt plain text POC58%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Encrypt/Decrypt plain text POC

Hacker News3
ow
owo – OneNote to Plain Text62%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

owo – OneNote to Plain Text

Hacker News83
Th
The clientside FormulaCompiler converts pseudocode to valid formulae35%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

The clientside FormulaCompiler converts pseudocode to valid formulae

Hacker News1
Ws
Wslpath – Converts Unix and Windows Format Paths in WSL45%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Wslpath – Converts Unix and Windows Format Paths in WSL

Hacker News3
Te
Teyit – Automatically format your Python unittest assertions58%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Teyit – Automatically format your Python unittest assertions

Hacker News8
Fr
Free Plain-Text Bookmarking69%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Free Plain-Text Bookmarking

Hacker News172
MT
MTXT – Music Text Format50%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

MTXT – Music Text Format

Hacker News124
Au
Automatically generate documents in any format49%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Automatically generate documents in any format

Hacker News11
SA
SAN syntax for Vim – a Sane and Nice configuration format59%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

SAN syntax for Vim – a Sane and Nice configuration format

Hacker News1