bengarrett / retrotxt Goto Github PK
View Code? Open in Web Editor NEWRetroTxt is the WebExtension that turns ANSI, ASCII, NFO text into web documents.
Home Page: https://retrotxt.com
License: GNU Lesser General Public License v3.0
RetroTxt is the WebExtension that turns ANSI, ASCII, NFO text into web documents.
Home Page: https://retrotxt.com
License: GNU Lesser General Public License v3.0
If I open a text file via a file:// URL in Chrome 57.0.2987.133 32-bit in Windows 7, and then click on the RetroTxt toolbar button, the tab goes black and there is a big progress spinner. It seems this would go on forever, with nothing actually happening. I can use the mouse to highlight the un-transformed black-on-black text forming the black background and make it visible. This happens with both .nfo and .txt extensions.
I tried starting Chrome with --allow-file-access-from-files
in case that was necessary and confirmed the option took effect, but this did not change anything.
If instead use python -m SimpleHTTPServer
and access the same files via http:// then I can view and transform .txt files, though if I try .nfo then Chrome wants to download it.
Move most of the technical conversation from the README into /docs/index.md
. Then use GitHub Pages to host these online has HTML.
Publish Your Project Documentation with GitHub Pages
Keep the following in README.md
, move everything else to /docs
CHANGES.md
to docs?test/example_files/ecma-48.txt says:
The start of the file MUST begin with an ECMA-48 escape sequence.
Could not find the requirement in standard (http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-048.pdf)
Moreover, if the file does not begin with an escape sequence, there is no way to view it coloured in RetroTxt.
Steps to reproduce: erase the first ๏ฟฝ[0; from test/example_files/ecma-48.txt and see the ugly unformatted text.
Correct behaviour: There should be some way to force ECMA-48 coloring of the file that does not begin with an escape sequence.
In the Options, turn [C] icon to a a href
direct link pointing to the licence file.
Is it possible to have a different screen width? I want to see my Jenkins console without the text going on the second line.
The example screenshots on the store pages are out of date and need updating for use with RetroTxt 2.1.
Capture the screenshots featuring the browser border, tabs and toolbar to make it clear as to the function of the application.
The browsers by default convert <
>
into <
>
to avoid conflicts with <tags>
. Unfortunately RetroTxt treats these as 4 separate characters and displays them as such.
<SaC>
is shown as <SaC>
Parts of the SAUCE record that rely on unsigned binary values can become corrupted. This is due to the browser loading the files as UTF-16 text instead of binary data. SAUCE TInfo1
and TInfo2
are common candidates for corruption when their values rely on 2 or more bytes.
The solution would be to re-download the file again using the Fetch API and extract the SAUCE record using its arrayBuffer method to extract the needed data.
The issue with this workaround would be with large ANSI artworks that would require a re-download and the extra memory overhead just to extract a few bytes of data.
To add
If you're interested, please add a Zenburn-like theme to the add-on. Looks quite nice IMO.
The Chrome API does not allow the forceful display of files in browser. Might be able to work around this issue by using the chrome.downloads.open method, but it could also trigger the same behavior.
can we have 25% - 50% - 75% scanlines?
The current release v.2.4 has been denied approval on Mozilla's Add-on page.
Due to some changes in their tools, as of a few months ago RetroTxt triggers a number UNSAFE_VAR_ASSIGNMENT Unsafe assignment to innerHTML warnings. These are not errors and have been approved in the past. But due to the fact each release submission review is done by a different volunteer, there is no guarantee a release will be approved, despite the code being open and my own reassurances.
There have been previous issues too, such as when the submission of v2.1.6 took 5 weeks to get approval.
See configMaxColumns()
in text_emca48.js
Possible solutions is to create another separate loop through the textAsArray to determine the document's width before running the for loop block.
for (let i = 0, len = textAsArray.length; i < len; i++) {}
/blocktronics_block_n_roll/N-BTSLDS.ANS
in is 210 columns but fails in RetroTxt.
/blocktronics_baud_dudes/WZ - Kali.ans
160 columns.
Detect the various encoding and CSI methods and output them to the Text & font information header.
[background-]color: RGB(x,x,x);
ESC[(0|1);R;G;Bt
ESC[=4h
aka CGA, see text_ecma48.js
line 1047.Note: CGA 2-bit allowed either, Cyan Magenta Black and White or Red Green Black and Yellow.
Maybe create a 16 colour ANSI proof sheet and display it in DOSBox & PCem in CGA to see the results.
I have RetroTxt set to apply to any local text files, it works for tabs in foreground but not for background tabs... I made a short screencast here: https://a.pomf.cat/qnsmjz.mp4
I think that it would be better if the defaults settings would be to use system fixed width font instead of using other fonts.
My need is to be able to parse console logs what have coloring (saved with tee
) and the best user experience would be if it would be as close as possible to the rendering mode of the text files in the browser, just to convert ANSI escapes to HTML tags, nothing more.
I believe this may have to do with ListDefaults().width = 640px
within functions.js
. In which some of the wider fonts rending 80 columns of text per row are wider than this set pixel width.
Currently, parts of RetroTxt use a less secure but an easier to implement method of building an HTML document. It takes an ANSI/ECMA48 encoded document and replaces their escape codes with text representing HTML and injects them into the DOM innerHTML
.
It is a hack and not considered good practice and now flags up issues with Mozilla's tools. In the long term, RetroTxt should use the Node API interface to build the HTML from scratch while iterating over each ANSI/ECMA48 escape sequence.
It will require a lot rewritten code but could enable the RetroTxt to support more escape sequences such as cursor movement back and up. These are currently lacking in the extension and break its ability to display ANSImations which are commonly used in early 1990s ANSI art.
A temporary Firefox fix?: https://developer.mozilla.org/en-US/docs/Archive/B2G_OS/Security/Security_Automation
Share the source on this repo but keep it as self-contained Node script within a subdirectory.
But share font resources and CSS?
Strip out all the WebExtension browser functionality. Clone relevant Options menu items into command line options.
Refactor the RetroTxt files to use webextension, node.js or npm naming conventions?
Output could be of 3 ways below, and also to screen, to automatic filename, or user supplied filename.
Monitor changes for saved RetroTxt Options and settings. If any are deleted say by browser clean-up add-ons or user intervention. Replace the deletions with RetroTxt defaults.
Modify the eventpage.js
menusCreate()
and menusUpdate()
functions to show a โ where ever a menu item option is active.
Find and include true type variants of the Amiga fonts mentioned in the SAUCE spec. Can test against artpacks released by Impure!ascii.
A certain nfo file doesn't look correct when displayed with RetroTxt, other viewers work fine though.
Download nfo here: http://www.nfohump.com/savenfo.php?id=251021
Do tests for chrome.blah !== undefined
for all event listeners.
To allow easier editing and possible themes move all hard-coded rgb()
styles into classes stored in separate external CSS files.
Currently, RetroTxt will mistakenly attempt to convert existing UTF encoded files into UTF encoding. Which then scrambles the body of the text. Unfortunately, Chrome API is JavaScript based and JS's internal encoding is UTF-16. So any text loaded into JS for annalist will already be converted into UTF-16. This makes it difficult to determine which files are encoded into which character set if the source web server does not provide the accurate information.
The possible best option is to incorporate a stripped down version the node.js jschardet library?
https://github.com/aadsm/jschardet
Steps to reproduce:
Result: The tab goes into some kind of looping state where the tab label is flickering constantly.
Loosen file extension requirements for autorun
on pre-approve websites? Instead assume all hosted plaintext files which don't begin with the characters <
or {
are text?
<
most probably is markdown.
{
most probably is json.
@ encoded text will fail if the start of the document includes newline characters.
@CLS@@code@
The functions BuildBBS()
& findControlSequences()
will need to be modified to fix.
Possible solution is to impose a user editable white-list of sites to use the auto-detect feature with.
Also add a menu item to the context menus to add / remove current site to the whitelist?
The lazy option would be to just hard code a blacklist of URLs to automatically ignore
Some known websites that RetroTxt automatic detect conflicts with.
Context menu ticks are failing to work as expected in Chrome 62.
Maybe the context menu API has changed?
https://developer.mozilla.org/en-US/Add-ons/WebExtensions/user_interface/Context_menu_items
https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/menus
https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/menus/OnClickData
https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/menus/update
Whenever RetroTxt is installed for the first time, an embedded plain text file should loadup in a new tab. This text file will be encoded as DOS CP-437 and include its unique glyphs for display. The text will also include some welcome text and maybe some help.
The text file should also be referenced with a link in the Options screen in between the Help and Github links.
Wherever possible move all JavaScript functionality of style manipulation to classes contained in separate and user edit-friendly CSS files.
These include the edits to the main
tag, font width, height and line-spacing adjustments.
Test case: https://defacto2.net/file/view/aa2eb8
Is the problem triggered by the ยซ
(174) [00AB] character or each individual error?
My retro side is telling me it's against the rules,
but an option to add a few extra pixels between each lines would increase readability
and would satisfy my visual side ;)
This seems to happen on all files even though it was only intended as white space management.
It is probably an issue with handleColumn()
or buildNewRows()
.
Some documents start as ASCII but actually contain ANSI control sequences deeper within. RetroTxt currently scans the first line but if no ANSI sequences are found, it assumes the document is ASCII.
Examples.
I often use Readability to turn a bloated webpage in a single text.
can RetroTXT work to postprocess the output ?
Currently the work-in-progress MS-DOS ANSI.SYS
support is accurate for around 5070% of documents. The following are a list of issues that maybe fixable. RetroTxt will never have the same level of compatibility as ANSILove due to the nature of rendering HTML tags vs the output to a terminal or a HTML <canvas>
.
Add HTML element title=""
s to font credit links that give more information on what they are being credited for.
Some usual documents include PCBoard at codes such as @cls@ as well as ANSI control sequences. RetroTxt mistakes these as PCB ASCII instead of ANSI.
Example
Create a checkbox to double the size of RetroTxts output on-screen. It would append an extra CSS class double-sized
that would add 2em
and 200%
to all existing CSS properties.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.