On Fri, 10 Nov 2017 21:17:26 +0000
jack da <[email protected]> wrote:
> [Jaromil]
>
> When I write about the Busybox version of sinit-rc [as I call the
> original sinit plus sh scripts rc.init and rc.shutdown], it should
> again be in MarkDown format. I am not sure if it will fit in with
> dev1galaxy. I will write it first. Sadly, I don't have a
> stand-alone markdown viewed [I used the one on the talk.devuan.org
> site for paper1].
Yes. The second you write it in Markdown, somebody will say it should
be in Asciidoc. And then when you do that, they'll say to put it in
Asciidoctor. And then. And then...
If you use the Bluefish editor to quickly and easily create a valid and
well formed Xhtml page, it will be instantly viewable on any reasonably
complete browser the same as HTML. Meanwhile, because Xhtml is really
XML with a specific and known DTD, you can use a programming language
with an XML parser plugin (Python comes to mind) to trivially turn your
document into Asciidoc, Asciidoctor, Markdown, ePub, and probably LaTeX
(which would probably be ugly).
When building an Xhtml doc, if you do anything non-wellformed, Chromium
(and probably others) error out with the exact error. Meanwhile, on a
regular 2 per hour basis, you can run the following Python program on
it to make sure it's still well formed:
==================================================
#!/usr/bin/python
import sys
import re
import xml.etree.ElementTree as ET
fname = sys.argv[1]
print('\nTesting for well formedness {} ...\n'.format(fname))
try:
tree = ET.parse(fname)
except ET.ParseError, err:
(line, col) = err.position
code = str(err.code)
errmsg = 'ERROR: {}'.format(str(err))
print(errmsg)
if re.search(' ', errmsg):
print('Replace all with   to solve problem.')
print('\n')
sys.exit(1)
else:
print('Congrats, {} is well formed!'.format(fname))
print('')
==================================================
If an Xhtml file passes the preceding, it will look pretty much
identical on every browser, unlike "real" HTML.
By the way, somebody (me for instance) should really fix it so &nsbp;
passes, instead of forcing the author to   to pass. Same for
™ instead of ™ and ® instead of ® and ©
instead of ©.
If you author in Xhtml, you can convert it to almost anything.
SteveT
Steve Litt
October 2017 featured book: Rapid Learning for the 21st Century
http://www.troubleshooters.com/rl21
#!/usr/bin/python
import sys
import re
import xml.etree.ElementTree as ET
fname = sys.argv[1]
print('\nTesting for well formedness {} ...\n'.format(fname))
try:
tree = ET.parse(fname)
except ET.ParseError, err:
(line, col) = err.position
code = str(err.code)
errmsg = 'ERROR: {}'.format(str(err))
print(errmsg)
if re.search(' ', errmsg):
print('Replace all with   to solve problem.')
print('\n')
sys.exit(1)
else:
print('Congrats, {} is well formed!'.format(fname))
print('')
_______________________________________________
Dng mailing list
[email protected]
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng