Giter VIP home page Giter VIP logo

Comments (17)

patricktalmadge avatar patricktalmadge commented on August 17, 2024

I hesitate to enforce this in bootstrapper. Some people my try to reduce page weight my removing white space in the generated HTML.

Are you using blade? Blade should create newlines for you because of the way it wraps calls with ?>

I will leave the issue open and see what other people think.

from bootstrapper.

Geczy avatar Geczy commented on August 17, 2024

Yes I am using blade actually. But it's not adding the new lines...Where did you read that it should?

from bootstrapper.

Anahkiasen avatar Anahkiasen commented on August 17, 2024

In all cases better use the PHP_EOL constant. \n is platform-specific.

from bootstrapper.

Geczy avatar Geczy commented on August 17, 2024

Agreed for PHP_EOL, would love to see this added

from bootstrapper.

Geczy avatar Geczy commented on August 17, 2024

Any movement on this, @patricktalmadge ? The HTML looks ugly as it is, would really prefer those EOLs added.

from bootstrapper.

Anahkiasen avatar Anahkiasen commented on August 17, 2024

Thing is, it's not as easy as just adding line breaks everywhere. It's just still as ugly if you don't add the corresponding tabs where required and that's where it gets tricky. I'm working on this in a branch somewhere but I have to edit all the tests accordingly so it really takes a while.

from bootstrapper.

Geczy avatar Geczy commented on August 17, 2024

I'm working on it in another branch as well, it appears to be that easy. What's the tricky part?

Geczy@a4bade4

from bootstrapper.

Anahkiasen avatar Anahkiasen commented on August 17, 2024

Well the tricky part is when you get nested elements in navigation, dropdowns and such and need to keep track of the depth to output the correct amount of tabbing. It's not hard per se but as I haven't had much time to work on Boostraper lately it slowed me down

from bootstrapper.

Geczy avatar Geczy commented on August 17, 2024

Do you want me to continue adding EOL and tabs to the libraries per my commit above?

from bootstrapper.

Anahkiasen avatar Anahkiasen commented on August 17, 2024

Yeah if you can work up a pull request that'd be a great addition ! Just don't forget to edit the tests accordingly, most are made with matchers so they don't need to be edited but some are created with exact output and the added line breaks will fail. Thank you :)

from bootstrapper.

patricktalmadge avatar patricktalmadge commented on August 17, 2024

Your welcome to work on a pull request for this. But I still don't understand why this is needed. Most modern browsers will format your html in a nested and readable manor in developer tools for debugging. (Even IE does this). I've never had a client complain because the HTML was ugly.

I my experience it's never going to look good. The tabs be off because generated elements will be nested at different levels in the html.

from bootstrapper.

Geczy avatar Geczy commented on August 17, 2024

Yes, modern browsers will format your HTML when using developer tools. When not, such as viewing source ( CTRL + U ), the HTML will be however it's outputted by your application.

Say the rest of your HTML is pretty and well formatted. But then you use a helper and create a carousel rather than manually typing the HTML. That carousel will be all on one line, which is horrid to look at.

Before

After

from bootstrapper.

patricktalmadge avatar patricktalmadge commented on August 17, 2024

The problem is that the after still looks ugly. The generated code still sticks out because of the formatting. The carousel div isn't nested correctly with the parent span12. The child divs have a different tab indention then the rest of the HTML.

That being said. Your welcome to make a pull request. I will merge it in as long as the tests are also updated.

from bootstrapper.

Geczy avatar Geczy commented on August 17, 2024

It's far less ugly than what it was before. I'd accept the sticking out over the one line of code any day :)

If I have time I'll make a pull

from bootstrapper.

Geczy avatar Geczy commented on August 17, 2024

@patricktalmadge So turns out if you output your PHP as blade, the formatting will be inline with your HTML. So it won't be ugly anymore :).

All that has to happen now is PHP EOLs be added

from bootstrapper.

patricktalmadge avatar patricktalmadge commented on August 17, 2024

@Geczy good to hear. Hopefully it isn't a ton of work.

from bootstrapper.

Anahkiasen avatar Anahkiasen commented on August 17, 2024

We'll wait for an eventual pull request, in the meantime this isn't on the to-do list or at the very bottom as that would require adding a lot of code spaghetti and redoing some tests for not much.

from bootstrapper.

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.