LinuxQuestions.org
Help answer threads with 0 replies.
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-27-2017, 02:06 PM   #16
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,357

Original Poster
Rep: Reputation: 213Reputation: 213Reputation: 213

@Didier:
There is herewith below in the link a first approach to read and output it.

@Didier: Salut Didier, regardes voila un example d'approche pour la lecture du fichier et l'ecriture sur le screen (for debugging).
fputs could be used to output it to file directly.

https://github.com/spartrekus/PHP-Asciidoc-to-Html
(draft, version 0.0000001)

Last edited by Xeratul; 05-27-2017 at 02:19 PM.
 
Old 05-27-2017, 02:35 PM   #17
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-14.2.1.2 on Lenovo Thinkpad W520
Posts: 9,816

Rep: Reputation: Disabled
Well, that's just for <h1>and <b>. It will take you a lot of time to do the other tags!

Anyway I have no doubt that's it is possible to code the conversion asciidoc => html in PHP.

What I still don't understand is who needs that and to do what

PS I have considered writing a sed script to do the same thing (building on what I have already done writing convtags) but nobody needs that either so I'd just loose my time.

Last edited by Didier Spaier; 05-27-2017 at 02:38 PM.
 
Old 05-27-2017, 02:45 PM   #18
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,357

Original Poster
Rep: Reputation: 213Reputation: 213Reputation: 213
Quote:
Originally Posted by Didier Spaier View Post
Well, that's just for <h1>and <b>. It will take you a lot of time to do the other tags!
with VIM/VI, it goes quite fast actually. Just a need to copy/paste, just a new syntax function.

Quote:
Anyway I have no doubt that's
... I am wondering if it would be thinkable, since it means that daily people would need a crontab to ask the website/apache/.../site to rebuild daily the HTML pages.

However, it can be very handy, for people that update their website directly by upload a ascii doc and nothing else to think about converting. If you update a lot of ascii doc webpages, it may be useful to feel free step of asciidoc.py.

(+) Using Python with asciidoc.py is really unreliable. This Python application is not working all the time (e.g. latinX,...). Utf8 might be ok, but I doubt.

The best is to use C/C++. This is reliable. Do you eventually know C?
C is great for any use, even strings manips.
 
Old 05-27-2017, 03:14 PM   #19
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-14.2.1.2 on Lenovo Thinkpad W520
Posts: 9,816

Rep: Reputation: Disabled
Quote:
Originally Posted by Xeratul View Post
with VIM/VI, it goes quite fast actually. Just a need to copy/paste, just a new syntax function.
Then do it.

Nobody prevents you to do something even if is completely useless, as it is in this case.

Quote:
(+) Using Python with asciidoc.py is really unreliable. This Python application is not working all the time (e.g. latinX,...). Utf8 might be ok, but I doubt.
This is completely wrong. in http://slint.fr/old/ I have pages in many languages including Russian, Greek Chinese Ukrainian and Persian. Of course I use UTF-8.

Quote:
The best is to use C/C++. This is reliable. Do you eventually know C?
C is great for any use, even strings manips.
I won't loose my time re-writing in another language a converter that already exists in Python and Ruby and is reliable.

PS And if you just use an asciidoc command to build an html page you do it only once unless you need to edit it: no need to run again a PHP script every time someone wants to access the page, so that's far less costly. And rebuilding all the pages accessible from http://slint.fr/old/ takes less than one minute for instance.

On the other hand if you need to make frequent edits and have remote contributors, better use a wiki as I do in http://slint.fr for all the pages listed in the SITEMAP.

Last edited by Didier Spaier; 05-27-2017 at 03:27 PM.
 
Old 05-28-2017, 06:16 PM   #20
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 9,985

Rep: Reputation: 4568Reputation: 4568Reputation: 4568Reputation: 4568Reputation: 4568Reputation: 4568Reputation: 4568Reputation: 4568Reputation: 4568Reputation: 4568Reputation: 4568
This is what XHTML was supposed to be for.

HTML was meant to be rendered even if it wasn't completely valid. As a result, a huge number of browser issues were caused by the need to handle invalid HTML and to anticipate all the ways that the HTML could be invalid. It was the cause of almost all "browser-compatibility issues" as no two browsers handled invalid HTML the same way. You could imagine how much "bloat" was needed to handle invalid HTML.

XHTML was either valid, or it wouldn't display at all. This was supposed to cut out all of the browser "bloat" needed to handle invalid markup.

Last edited by dugan; 05-29-2017 at 01:42 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 10:47 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