Giter Club home page Giter Club logo

Comments (4)

kylekatarnls avatar kylekatarnls commented on May 24, 2024

Hi,

prettyprint is not about PHP compilation but as in pug-js, it's for final HTML output. For PHP debugging, I created the phpSingleLine option. You can pass it to true to get a new line for each PHP statement generated.

But I'm agree prettyprint=true as no real meaning except maybe to display HTML for a demonstration. In production, you should always set it to false. And for inline tags render, use:

span a
span b

To get ab and:

span a
=" "
span b

To get a b, or you can also:

| #[span a] #[span b]

This is the recommended syntax for long texts with inline tags inside, like in:

| I'm #[strong happy] to see you.

To come back to prettyprint, it can be handled by an other program to compress or to beautify. But this is a port of pug-js. We try to implement pug-js features as it and adapt them to PHP syntax and possibilities as close as possible to the original pug to provide a standard solution.

It's out of the question to display all tags with PHP. And the priority remains to allow in production (prettyprint=false) all the syntaxes above to be able to display inline tags with or without spaces between.

If I can improve this rendering without break this logic and with no extra PHP code in compiled files, I'll do it; but I will not take the risk to cause regressions. I prefer to keep standard tools as it and provide customizations so if thoses syntaxes and phpSingleLine do not cover your need, please tell me you final goal. I will try to give you the best way to acheive it.

from pug.

kylekatarnls avatar kylekatarnls commented on May 24, 2024

Hi, with the new refactorized version, we will try to be as close as possible as the pug-js results for both pretty and non-pretty options but we will try to provide more customizations.

from pug.

kylekatarnls avatar kylekatarnls commented on May 24, 2024

Hi, there is a new option now available to use the native pugjs engine (until the 3.0):

$pug = new Pug(array(
    'pugjs' => true
));
echo $pug->render('
span a
=" "
span b
');

This is a pure wrapper solution with no PHP support in templates (all run with node.js).

from pug.

kylekatarnls avatar kylekatarnls commented on May 24, 2024

You can update to 3.0.0-alpha2, it should be fixed. Consecutive span are no longer affected by prettyprint option. Please don't hesitate to test the new pug-php 3 and give us your feedback.

from pug.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.