Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #11945

Re: PHP functions to convert markup efficiently

From "James Harris" <james.harris.1@gmail.com>
Newsgroups comp.lang.php
Subject Re: PHP functions to convert markup efficiently
Date 2013-11-23 16:38 +0000
Organization A noiseless patient Spider
Message-ID <l6qlml$dvj$1@dont-email.me> (permalink)
References <l6ljfj$fue$1@dont-email.me> <528F32EE.5030800@arnowelzel.de> <l6njsf$rat$1@dont-email.me> <528F7B7D.4030701@arnowelzel.de>

Show all headers | View raw


"Arno Welzel" <usenet@arnowelzel.de> wrote in message 
news:528F7B7D.4030701@arnowelzel.de...
> Am 22.11.2013 13:48, schrieb James Harris:
>
>> Having looked at Markdown and Smarty that people suggested it might be
>> better if I bite the bullet and develop my own markup language. It would
>> then be easier both to limit what it allows and also to add features as
>> needed. I have been running some syntax tests and it seems quite easy to 
>> do
>> and fast to process even though the markup is currently a little 
>> cumbersome
>> to write.
>
> I think this is not a good idea.
>
> Existing markup languages are well documented and there are existing
> implementations to parse the markup and convert it to HTML (or other
> formats) which are not only used by one person - so it is likely that
> bugs will be fixed as well within a reasonable time.

Noted.

> Besides Markdown and Smarty you can also try DokuWiki - it's markup can
> be extended using syntax plugins (and you can create your own plugins as
> well to handle block level or inline elements etc.).

I took a look at DokuWiki (having previously looked at the others). It's 
good but does things I don't want. At first glance I couldn't see a way to 
take them away and to restrict the formatting it accepts. I'm not sure I 
want to invest the time needed to learn any of those packages when, at least 
for now, it seems that native PHP is easy enough to use and is far more 
flexible.

>>> What kind of markup is needed?
>>
>> Quite a lot. Things like these:
>> * bold, italic
>> * links to local pages and remote URLs
>> * images, code
>> * headers, lists, line breaks
>> * tables
>> * other things will likely be required but are not defined yet
>
> So - if HTML is to complicated you should really try DokuWiki first.
>
> And if even this syntax is too complicated you should not use a markup
> language at all but a WYSWIG editor which produces valid HTML (for
> example TinyMCE or CKEditor).

I am not trying to avoid complexity. Using PHP to convert markup to HTML 
allows me to do things like these:
* restrict the elements that can be used (for security)
* add features such as a server-side TOC
* pull in data from various sources
* choose where to place elements such as footnotes
* make each page of the site a consistent structure

Basically, the combination of HTML, CSS, PHP and my own markup codes seems 
ideal. Aside from having to devise the coding the rest is completely 
standard and incredibly lightweight. As such, there will be no packages and 
associated bugfixes to install and it should be very fast.

I'll keep in mind that there are prebuilt options, though, in case I run 
into difficulties as I work on this.

James

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

PHP functions to convert markup efficiently "James Harris" <james.harris.1@gmail.com> - 2013-11-21 18:30 +0000
  Re: PHP functions to convert markup efficiently The Natural Philosopher <tnp@invalid.invalid> - 2013-11-21 18:39 +0000
    Re: PHP functions to convert markup efficiently "James Harris" <james.harris.1@gmail.com> - 2013-11-21 18:57 +0000
      Re: PHP functions to convert markup efficiently Christoph Michael Becker <cmbecker69@arcor.de> - 2013-11-21 20:10 +0100
        Re: PHP functions to convert markup efficiently "James Harris" <james.harris.1@gmail.com> - 2013-11-21 19:29 +0000
          Re: PHP functions to convert markup efficiently Christoph Michael Becker <cmbecker69@arcor.de> - 2013-11-21 21:18 +0100
  Re: PHP functions to convert markup efficiently Salvatore <sal@yojimbo.hack.invalid> - 2013-11-21 19:03 +0000
  Re: PHP functions to convert markup efficiently Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-11-21 21:27 +0100
  Re: PHP functions to convert markup efficiently Arno Welzel <usenet@arnowelzel.de> - 2013-11-22 11:33 +0100
    Re: PHP functions to convert markup efficiently "James Harris" <james.harris.1@gmail.com> - 2013-11-22 12:48 +0000
      Re: PHP functions to convert markup efficiently Jerry Stuckle <jstucklex@attglobal.net> - 2013-11-22 08:53 -0500
        Re: PHP functions to convert markup efficiently "James Harris" <james.harris.1@gmail.com> - 2013-11-23 06:21 +0000
          Re: PHP functions to convert markup efficiently Jerry Stuckle <jstucklex@attglobal.net> - 2013-11-23 06:59 -0500
          Re: PHP functions to convert markup efficiently Christoph Michael Becker <cmbecker69@arcor.de> - 2013-11-23 13:12 +0100
      Re: PHP functions to convert markup efficiently Arno Welzel <usenet@arnowelzel.de> - 2013-11-22 16:42 +0100
        Re: PHP functions to convert markup efficiently "James Harris" <james.harris.1@gmail.com> - 2013-11-23 16:38 +0000
          Re: PHP functions to convert markup efficiently Richard Yates <richard@yatesguitar.com> - 2013-11-23 13:24 -0800
            Re: PHP functions to convert markup efficiently "James Harris" <james.harris.1@gmail.com> - 2013-11-23 22:07 +0000
          Re: PHP functions to convert markup efficiently Arno Welzel <usenet@arnowelzel.de> - 2013-11-24 17:09 +0100
            Re: PHP functions to convert markup efficiently "James Harris" <james.harris.1@gmail.com> - 2013-11-24 18:11 +0000
              Re: PHP functions to convert markup efficiently Arno Welzel <usenet@arnowelzel.de> - 2013-11-24 23:18 +0100
                Re: PHP functions to convert markup efficiently "James Harris" <james.harris.1@gmail.com> - 2013-11-24 23:44 +0000
                Re: PHP functions to convert markup efficiently Arno Welzel <usenet@arnowelzel.de> - 2013-11-25 08:11 +0100
  Re: PHP functions to convert markup efficiently "James Harris" <james.harris.1@gmail.com> - 2013-11-23 19:21 +0000

csiph-web