Comments (14)
I don't really need pretty HTML at all so I don't have a preference. I guess ideally both, but disabling it globally would probably be easier. Looking at the code you would just have to skip the indent call.
from htmlflow.
Ok, I see your problem. What kind of disable indentation feature are you thinking?
-
Do you want to disable indentation at all and print whole document without any indentation?
-
Or do you want stop indentation at certain point (e.g. before invoking
pre()
) and then enable indentation again?
from htmlflow.
Ok, I will include that feature for release 3.3. Can you please include here a small function with your use case of the pre
element for unit testing?
from htmlflow.
@Test
public void bla() throws Exception {
HtmlView htmlView = new HtmlView<>();
htmlView.body().pre().text("Some text");
String s;
try (ByteArrayOutputStream out = new ByteArrayOutputStream()) {
htmlView.setPrintStream(new PrintStream(out));
htmlView.write();
s = out.toString();
}
assertTrue(s.replaceAll("<pre>\\s+", "<pre>").contains("<pre>Some text"));
assertFalse(s.contains("\tSome text"));
assertTrue(s.contains("<pre>Some text"));
}
from htmlflow.
@theotherp which version of HtmlFlow are you using?
from htmlflow.
@theotherp can you please tell me which version of HtmlFlow are you using?
from htmlflow.
2.0 I know it's a bit older but updating libraries is kind of a hassle here...
from htmlflow.
I just realized how crazy it is to write a feature request when I don't use the newest version... I'll try to update and see if it works. Sorry about that...
from htmlflow.
@theotherp Don't sorry.... In fact your issue just allow us to find a bug in the last release 3.2. Your example body().pre()
does not compile in the last version, because it does not allow pre()
after body()
. We will both fix that bug and also implement the disable indentation feature.
Thanks for your feedback.
from htmlflow.
@theotherp I have just released a new version with support to disable pretty print / indentation. Basically now we provide a new setIndented(boolean isIndented)
setter in HtmView
. Note that HtmlView
instances are immutable, so whenever you call setIndented
it returns a new HtmlView
object rather than changing the existing one.
Here in HtmlWithoutIndentation.java you can find some use cases of setIndented
usage.
Sorry for this late feature but I have been overwhelmed and I also included some other required fixes on this version.
By the way, I think you are not an HtmlFlow stargazer yet. Could you please give us a star?
Best regards,
Miguel
from htmlflow.
from htmlflow.
@theotherp As you may be aware, I am the author and primary advocate for the HtmlFlow Java library. As part of my continuous endeavors, I am required to provide justification for this project to my university.
HtmlFlow serves as a versatile auxiliary tool utilized across various sectors, facilitating software development by streamlining tasks such as HTML reporting automation, web templating, and more.
If you have utilized HtmlFlow, I kindly request your testimony regarding my dedication to addressing issues, implementing new features, or otherwise aligning with your requirements and/or your company within the scope of a specific project, task, or work that utilized HtmlFlow during a certain timeframe.
Your testimony will play a crucial role in demonstrating my work to my university.
Please feel free to send your testimonial to my email address at ISEL: [email protected]
Thank you in advance for your attention and assistance.
from htmlflow.
@theotherp Even if you are not currently using HtmlFlow, I kindly request your acknowledgment that I was actively engaged in maintaining, tracking issues, or new features during the time of this issue. It is imperative for me to justify my efforts on HtmlFlow during the period of this issue to my university.
I would greatly appreciate it if you could once again provide your acknowledgment to my email address at ISEL: [email protected].
Thank you in advance for your attention and assistance.
from htmlflow.
Will do.
from htmlflow.
Related Issues (20)
- View with dynamic and static attribute / Placement of dynamic() block HOT 6
- Inline SVG from string add to view HOT 2
- How to use For Loop / If condition / Map with HTML FLow? HOT 6
- Tags gets confused with text HOT 2
- setIndented(false) also removes new lines from text in views HOT 3
- Missing oncontextmenu and disable textarea whitespace HOT 6
- Typos in blog post HOT 2
- Documentation expansion HOT 2
- Gradle build warnings... HOT 5
- Groovy compilation errors ... HOT 4
- Security Scan Warning - JSOUP...? HOT 1
- Input attribute checked=false|true not compliant HOT 3
- Cannot have full dynamic page HOT 1
- Is there any idea code folding plugin recommendation? HOT 3
- slf4j-simple should not be declared as a dependecy HOT 2
- Multiple model with single template HOT 3
- option.attrSelected unexpected behavior HOT 7
- Enhance documentation with complete list of methods HOT 4
- Script tag, attribute type HOT 5
- Reflexion on template and java 21 features HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from htmlflow.