Talk:Text to HTML: Difference between revisions

m
 
(7 intermediate revisions by 3 users not shown)
Line 10:
:::: I was assuming that the results would be comparable. So, for example, if one implementation treats hanging indentation as a paragraph format, another treats it as a list format and a third and fourth treats that case as a table (one as a single row table, another as a table with one row per line of plain text), what would we be comparing? Or, as an extreme case (emulating fixed width presentation despite the possible absence of any fixed-width fonts) I might represent plain text as a (borderless) table with one cell per character (and all the characters in the original which represent a url would have a link to the corresponding url). --[[User:Rdm|Rdm]] 14:40, 6 January 2012 (UTC)
::::: well, yes, the results should be comparable. after the requirements are fixed. before that i hope we can explore which requirements are sensible by discussing them here, possibly including a few sample implementations that demonstrate how specific requirements can be met.--[[User:EMBee|eMBee]] 15:03, 6 January 2012 (UTC)
 
I've done a Tcl “solution” to this that only handles a subset of all the things mentioned. In particular, it doesn't do links, centering or tables. The latter two are really rather optional IMO (I may add links later). But it does do (non-nested) numbered and bulleted lists, and it does headings too. It also does simple bold, italic and typewriter formatting; that actually covers enough to be useful. Remember, it shouldn't feel like ''work'' to implement an RC task! –[[User:Dkf|Donal Fellows]] 20:20, 31 March 2012 (UTC)
 
== Concrete requirements? ==
Line 104 ⟶ 106:
 
the concern and motivation for this task (which rules out just using <code>&lt;pre&gt;&lt;/pre&gt;</code>) is that plaintext without linebreaks can become unreadable if the lines are to long. any solution that can address this problem is worth considering.--[[User:EMBee|eMBee]] 16:39, 8 January 2012 (UTC)
 
:Quoting >, < and & and prepending newline characters with <nowiki><br /></nowiki> should be sufficient for that purpose? --[[User:Rdm|Rdm]] 22:38, 8 January 2012 (UTC)
:: for that purpose only,sure. but then that wouldn't be much of a task. therefore i want to explore what else can be done to improve the presentation.--[[User:EMBee|eMBee]] 03:30, 9 January 2012 (UTC)
::: In my opinion, there are two kinds of transforms to consider: "changes that lose information" and "changes that do not lose information". A "non-lossy" transformation is one that can be reversed. One ideal would be a non-lossy mechanical transformation which minimizes information losses at rendering time for typical browsers -- here, the goal is to get out of the way and not be an obstacle for the provider of the text.
::: Much of the discussion on this page seems to be about "lossy transformations". For a lossy transformation to be implemented properly, I think that we would need a clear understanding of the purpose of the transformation.--[[User:Rdm|Rdm]] 15:07, 9 January 2012 (UTC)
:::: the purpose of the transformation is stated above. which aspects would you like me to clarify? i don't know if the transformation can be done non-lossy. certainly sounds like it would be nice to get that. but it's not a deciding factor. ''"get out of the way and not be an obstacle for the provider of the text"'', however is cetainly a quality i'd like to achive. it is one reason why i do not want to consider markup.--[[User:EMBee|eMBee]] 17:38, 9 January 2012 (UTC)
::: Also, is there a reason why we are discussing a new transform here, and not an existing transform? --[[User:Rdm|Rdm]] 15:07, 9 January 2012 (UTC)
:::: i am not aware of any existing transforms that do not depend on explicit markup. if you can point to any, please share. i'd be happy if this task can be solved with existing tools or based on existing rules.--[[User:EMBee|eMBee]] 17:38, 9 January 2012 (UTC)
::::: What is the difference between the rules you are suggesting here, and "markup"?
::::: Anyways, a google search for <code>plain text to html</code> finds numerous hits. Superficially speaking, it looks like http://txt2html.sourceforge.net/ does what you want (and its design should serve as a caution for this as a rosettacode task). --[[User:Rdm|Rdm]] 17:48, 9 January 2012 (UTC)
:::::: i did search, but somehow i missed this one. interesting find,thank you! yes, it does pretty much what i want. and as you note it does to much to be suitable for a task. but perhaps a subset of its features that we can agree on would be appropriate?--[[User:EMBee|eMBee]] 16:22, 10 January 2012 (UTC)
::::::: Fine by me. Pick some feature set, list those features, and create some task examples? --[[User:Rdm|Rdm]] ([[User talk:Rdm|talk]]) 02:12, 6 May 2015 (UTC)
6,951

edits