LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > General
User Name
Password
General This forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun!

Notices


Reply
  Search this Thread
Old 05-25-2017, 06:46 AM   #1
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,657

Rep: Reputation: 255Reputation: 255Reputation: 255
Programming a graphical universal markup non-bloated browser (HTML?)


Hello,

There is no doubt about it: "web is bloated".

Everyone, all, talk that the web browsers take a vast amount of resource and memory. Internet browsers make computers run slow. There is an important increase of CPU cycles. Many people complain that their browser is slow, so, they need to buy a newer PC. New Windows, but the system takes more more Endless story, right? Users most often need to read news, simple documents, and maybe POST few things. These many operations are most often simple. For simple Markup document, simple format, you may make use of your simple low resource/hardware perfs Kindle ebook for instance. HTML5? -Too heavy. Mobile html? Or, original 18-20 functions of HTML 1-2 ? Asciidoc? (forget Markdown due to ---- ==== much too complex to programme). Actually ASCIIDOC has a much better Markup syntax, since it is less complex than HTML and with few fopen/fgets/... string analysis, a document can be rendered. Wanna read your news on your Ebook Kindle, mobile, Raspberry without important resource dependency? Your Kindle is pretty slow, right? Shall it be slow? - No, since Markup is just few lines of C code to render a markup document. Instead of keep using Firefox, could you benefit of programming a graphical universal markup non-bloated browser (HTML?)? Dillo is a good idea, but it won't be compiled on a Kindle?

Sorry for the very very bad grammar of the prev paragraph. Don't bash, this thread is for positive mind and for plain C programmers only.

You are gently, kindle'ly, invited you to discuss within this thread on small resource markup syntax, markup document renderers, and portable plain C compiling/programming.

Last edited by Xeratul; 05-26-2017 at 03:54 PM.
 
Old 05-25-2017, 10:46 PM   #2
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,657

Original Poster
Rep: Reputation: 255Reputation: 255Reputation: 255
Programming a graphical universal markup non-bloated browser (HTML?)

Hello,

I prefer ASCIIDOC to anything else since it is easy to convert using plain C language to html. Sections of ASCIIDOC are easy to handle with C (one on the line with '=' char(s)). Very probably someone is directly uploading Asciidoc page and lets do PHP the magic to render (simply convert) it directly on the website. I can convert my C source code to php, if you'd like. Let me know.

Maybe, would you likely know an already existing PHP code to render ASCIIDOC on website?

Last edited by Xeratul; 05-26-2017 at 03:54 PM.
 
Old 05-26-2017, 06:16 AM   #3
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,138

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
In 1983 I worked with ZOG which was a hypertext system that was used for interactive documents made up of formatted text, pictures and links. It ran fine on a 6 MIPS computer without any of the bloat and frills taken for granted today.
 
Old 05-26-2017, 10:50 AM   #4
dedec0
Senior Member
 
Registered: May 2007
Posts: 1,372

Rep: Reputation: 51
95% of websites run fine with Javascript disabled. It is a feature I play a lot in the reasonably old Opera 11 and 12 versions (the last versions before Opera changed to Chromium code base and I stopped using its current version). These versions (11 and 12) are reasonably light in RAM, and fairly compatible with most websites I use (although I force the use of mobile versions of Twitter and Facebook, which are, IMO and needs, better).

If I would build a website for anything with mostly text and images, I would use HTML 3.2. HTML 4.01 with a few simple CSS styles are also practical and light resource needs (and compatible with many many many different platforms and browsers, old and new). HTML5, like you said... "thank you, I pass it".

"links" is a textmode browser I eventually use. Its compatibility with some websites is surprising (in a very good way) to me! (:

Last edited by dedec0; 05-28-2017 at 01:12 PM.
 
Old 05-26-2017, 11:09 AM   #5
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,056

Rep: Reputation: Disabled
Salut,

I don't understand the need for a PHP code on the server side as the asciidoc application's purpose is to convert a text file in Asciidoc format to a static (x)html page, that will be rendered as any the web page by the browser.

As an example this page:
http://slint.fr/old/fr/tools.html
was built from the file "tools.fr.txt" with this simple command:
Code:
asciidoc -b xhtml11 -a icons -f $CONF_FILE -o $ll/${page}.html ${page}.${ll}.txt
where CONF_FILE is the config file for asciidoc, ll=fr for French and page=tools
You can see the source file tools.fr.txt clicking on "Texte source" on the bottom of the menu on the left of the web page.

PS See also the link to convtags in my signature.

PPS Did you rewrote the Python application asciidoc.py in C? Is your version complete then?
I guess you did that as an exercise, as the python app is fast enough (a few seconds to build the whole website whose root is http://slint.fr/old/ here). Or you could use asciidoctor if you prefer Ruby.

Last edited by Didier Spaier; 05-26-2017 at 11:26 AM.
 
Old 05-26-2017, 12:27 PM   #6
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,657

Original Poster
Rep: Reputation: 255Reputation: 255Reputation: 255
Quote:
Originally Posted by Didier Spaier View Post
Salut,

I don't understand the need for a PHP code on the server side as the asciidoc application's purpose is to convert a text file in Asciidoc format to a static (x)html page, that will be rendered as any the web page by the browser.

As an example this page:
http://slint.fr/old/fr/tools.html
was built from the file "tools.fr.txt" with this simple command:
Code:
asciidoc -b xhtml11 -a icons -f $CONF_FILE -o $ll/${page}.html ${page}.${ll}.txt
where CONF_FILE is the config file for asciidoc, ll=fr for French and page=tools
You can see the source file tools.fr.txt clicking on "Texte source" on the bottom of the menu on the left of the web page.

PS See also the link to convtags in my signature.

PPS Did you rewrote the Python application asciidoc.py in C? Is your version complete then?
I guess you did that as an exercise, as the python app is fast enough (a few seconds to build the whole website whose root is http://slint.fr/old/ here). Or you could use asciidoctor if you prefer Ruby.
this is really amazing.
http://slint.fr/old/tools.fr.txt

I would think to upload via ftp the Asciidoc only documents (txt) on my website. And I can do even edit it with my phone or anything. No need of conversion at all, since Php does the rest to make the html. What ddo you think about this idea?
 
Old 05-26-2017, 02:22 PM   #7
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,657

Original Poster
Rep: Reputation: 255Reputation: 255Reputation: 255
Quote:
Originally Posted by smallpond View Post
In 1983 I worked with ZOG which was a hypertext system that was used for interactive documents made up of formatted text, pictures and links. It ran fine on a 6 MIPS computer without any of the bloat and frills taken for granted today.
ZOG is no longer much documented. In 1983, computer were running on nothing (few bytes)
 
Old 05-26-2017, 02:44 PM   #8
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,056

Rep: Reputation: Disabled
Quote:
Originally Posted by Xeratul View Post
I would think to upload via ftp the Asciidoc only documents (txt) on my website. And I can do even edit it with my phone or anything. No need of conversion at all, since Php does the rest to make the html. What do you think about this idea?
Nothing good:
  1. You will need to write a program in PHP , somehow reinventing the wheel as it will do the same things as asciidoc.py (in python) or asciidoctor (in Ruby). It will take you months to provide the same features (if you don't give up), for no benefit that I can think of. Do I miss something?
    Also your statement "no conversion at all" is wrong as the conversion would be done by the PHP script, but it would still be a conversion.
  2. If you goal is to build the html files on the fly from the txt files it would be way easier and faster to execute a command similar to the one in my last post as a CGI script on your web server. But what for? I don't see any advantage over providing already converted html pages.
 
Old 05-26-2017, 03:10 PM   #9
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,263
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
Tiny PHP code to render ASCIIDOC on your website?
Programming a graphical universal markup non-bloated browser (HTML?)

Although not duplicates, these two threads by the same OP share the theme of tiny vs bloat, and ASCIIDOC rendering on the web.

Neither asks a programming question but seem intended to promote a general discussion of their subject. As such, they have been combined and moved from the Programming forum to the General forum where they will have better exposure for that purpose.
 
Old 05-26-2017, 03:58 PM   #10
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,657

Original Poster
Rep: Reputation: 255Reputation: 255Reputation: 255
Quote:
Originally Posted by Didier Spaier View Post
You will need to write a program in PHP , somehow reinventing the wheel as it will do the same things as asciidoc.py (in python) or asciidoctor (in Ruby). It will take you months to provide the same features (if you don't give up), for no benefit that I can think of. Do I miss something?
In few hours, it is easy to make run a PHP code that does several syntax functions of ASCIIDOC.
I still wonder why you wouldn't find it comfortable to make a website directly without cumbersome converting. PHP does the job and it can save you a bunch of time.

But the best would be a tiny browser that understand asciidoc, which is easy in C language.
 
Old 05-26-2017, 08:14 PM   #11
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,056

Rep: Reputation: Disabled
Quote:
Originally Posted by Xeratul View Post
In few hours, it is easy to make run a PHP code that does several syntax functions of ASCIIDOC.
I still wonder why you wouldn't find it comfortable to make a website directly without cumbersome converting. PHP does the job and it can save you a bunch of time.

But the best would be a tiny browser that understand asciidoc, which is easy in C language.
These statements make me think that you have no idea how much work is needed to to do what you suggest, assuming that you really know what you are talking about, of which I am not sure.

I doubt that you be able to write a small program in C or PHP implementing a significant subset of ASCIIDOC's syntax. Take it as a challenge

Last edited by Didier Spaier; 05-26-2017 at 08:15 PM.
 
Old 05-26-2017, 11:34 PM   #12
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,657

Original Poster
Rep: Reputation: 255Reputation: 255Reputation: 255
Quote:
Originally Posted by Didier Spaier View Post
These statements make me think that you have no idea how much work is needed to to do what you suggest, assuming that you really know what you are talking about, of which I am not sure.

I doubt that you be able to write a small program in C or PHP implementing a significant subset of ASCIIDOC's syntax. Take it as a challenge
WIKI:
Quote:
Lightweight markup languages can be categorized by their tag types. Like HTML (<b>bold</b>), some languages use named elements that share a common format for start and end tags (e.g. BBCode bold), whereas proper lightweight markup languages are restricted to ASCII-only punctuation marks and other non-letter symbols for tags, but some also mix both styles (e.g. Textile bq. ) or allow embedded HTML (e.g. Markdown), possibly extended with custom elements (e.g. MediaWiki <ref>source</ref>).

Presentation oriented languages include AsciiDoc, atx, BBCode, Creole, Crossmark, Epytext, Haml, JsonML, MakeDoc, Markdown, Org-mode, POD, reST, RD, Setext, SiSU, SPIP, Xupl, Texy!, Textile, txt2tags, UDO and Wikitext.
It is not complicated to convert basic syntax (**only basics**) of asciidoc using PHP to html. Tu sais probablement aussi le faire, Didier... herewith what can do PHP asciidoc to html on the site. Let me know if you need something like this, or directly you can give me syntax input and html output so that I code it. I can do it.

Code:
= My Article
*J. Smith*

http://wikipedia.org[Wikipedia] is an
on-line encyclopaedia, available in
English and many other languages.

== Software

You can install 'package-name' using
the +gem+ command:

 gem install package-name

== Hardware

Metals commonly used include:

* copper
* tin
* lead
It shall look after conversion: https://pastebin.com/raw/W4tCvnHe
Here I used libreoffice to make it to html.
Afterwards, I clean up a bit the html code, and I introduce functions into the PHP code. It is fairly possible. I see no difficulty at all. Actually, when you look well, isn't HTML very ugly? ASCIIDOC has a nicer look and is much nicer for eyes. Wanna continue with html5,6,7...10? I am curious about the real meaning since programmers will become dependent to their system due to lack of clarity of HTML source code. Definitely basic ASCIIDOC (or other minimalist markup's) should be first available on a browser.

Last edited by Xeratul; 05-27-2017 at 12:07 AM.
 
Old 05-27-2017, 02:20 AM   #13
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,056

Rep: Reputation: Disabled
Quote:
Originally Posted by Xeratul View Post
Let me know if you need something like this
I don't need that, as I already stated.
Quote:
or directly you can give me syntax input and html output so that I code it.
This is what I used as specification to write convtags. See also this article I wrote to know most syntactic constructs. If you can read Python, you can also directly look how Stuart Rackham did it in asciidoc.py, attached as asciidoc.py.txt
Quote:
I can do it.
I will believe you when will have done it.
Attached Files
File Type: txt asciidoc.py.txt (248.2 KB, 703 views)
 
Old 05-27-2017, 03:03 AM   #14
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,657

Original Poster
Rep: Reputation: 255Reputation: 255Reputation: 255
Quote:
Originally Posted by Didier Spaier View Post
I don't need that, as I already stated.
This is what I used as specification to write convtags. See also this article I wrote to know most syntactic constructs. If you can read Python, you can also directly look how Stuart Rackham did it in asciidoc.py, attached as asciidoc.py.txtI will believe you when will have done it.
For headers (section), bold,... items, and tables, might be a first step, leet's say.
= gives html title
== gives html header h1
=== gives html header h2
...
right?
I found the syntax : http://powerman.name/doc/asciidoc#_document_header

Asciidoc or maybe there might be better choice? markdoc? bbcode?

Last edited by Xeratul; 05-27-2017 at 03:05 AM.
 
Old 05-27-2017, 04:13 AM   #15
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,056

Rep: Reputation: Disabled
Thumbs up

Quote:
Originally Posted by Xeratul View Post
For headers (section), bold,... items, and tables, might be a first step, leet's say.
= gives html title
== gives html header h1
=== gives html header h2
...
right?
I found the syntax : http://powerman.name/doc/asciidoc#_document_header
You would have find that in the documents I linked to, had you read it. And that just 1% of the syntax or so...
Quote:
Asciidoc or maybe there might be better choice? markdoc? bbcode?
As long as your aim is just to feed a discussion but you not do not intend to do anything beyond that (like coding something), every markup is fine

Last edited by Didier Spaier; 05-27-2017 at 04:15 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
universal footer for html lleb Linux - General 8 04-22-2016 12:56 PM
LXer: Markup lowdown: 4 markup languages every team should know LXer Syndicated Linux News 0 08-26-2015 10:41 AM
[SOLVED] Is there a graphical browser which will read local compressed html files (html.gz) ? harryhaller Linux - Software 2 02-18-2014 09:54 AM
[SOLVED] No rule to make target 'Markup.cpp', needed by `Markup.o'. Stop. shamjs Programming 11 12-10-2011 10:51 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > General

All times are GMT -5. The time now is 08:00 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration