-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replicate default maven-site table style #166
Comments
From @sikron on August 13, 2015 20:43 ok, i am answering my own question: |
Glad you could find a solution. |
From @sikron on August 14, 2015 14:25 i am not 100% happy with the theming actually, but right now it suffices, i think. |
Please, let us know if there's anything that can be improved. |
From @sikron on August 16, 2015 17:36 Hi again, The html-output of apt is a here a picture with the apt-table at the top and the asciidoc-table below. many thanks! |
Can you share that project? It will help me a lot to look into the issue. Also if you feel like hacking a bit yourself 😉 you can have a look at the code (https://github.com/asciidoctor/asciidoctor-maven-plugin/blob/master/src/main/java/org/asciidoctor/maven/site/AsciidoctorParser.java#L52). Two options come to my mind that need testing:
This created the next table block Personally, I don't like the second options because it's susceptible for changes in the asciidoctor generation format. And even if you plan to use the document in different backends, you coud add some conditional block to add the rol only under some conditions (check http://discuss.asciidoctor.org/Conditional-inclusion-td2568.html).
Btw, I'll move this issue to the maven plugin tomorrow. Today I'm not at home. |
Here is my sample project. The sub-modules are maven-sites with apt- and asciidoc-format. I tried option 1 and the result looked a little bit better, but still no table-grid, only a caption with grey background. thx & bye! |
@abelsromero maybe you could also be so kind and rename the issue to "Maven site HTML theme issues" as the PDF in the title does not fit so good anymore, thx! |
Seems to general to me. How about "Replicate dafault maven-site table style"? |
agreed |
I've been looking into it and I have bad and good news. I hope it's no suprise that Asciidoctor style was not build thinking in this use case (or other similars), so it's normal that styles are not compatible. But there're options, as a alternative solution you can add a file named Note that, this is not only affecting tables, source highlighting won't work, Font Awesome icons won't show, and admoniton blocks are not correctly presented. That's what I've seen so far. Given the degree of customization required, maybe you should consider building the site with another tool like jBake or Awestruck. 😞 That deppends of course on what features you require. |
Ideally, we should include (or at the very least document) a default stylesheet like we do with Asciidoctor. However, as you have observed, we can't simply drop in the default stylesheet from Asciidoctor because it was designed with a very different "framing" in mind. The default Asciidoctor stylesheet is intended for a standalone document. Within the Maven site layout, we need a stylesheet that is more focused on the content. Solving asciidoctor/asciidoctor-stylesheet-factory#18 would help here. |
I am sorry to hear, that this is a bigger issue. Using a maven site for my docu was just the first idea, which came to my mind as i am used to document my stuff in a maven site :-) Maybe you could point out these few drawbacks on the README.md, so other people can make a better evualuation, whether to use this plugin for creating a maven-site beforehand. In any case thank you very much for clarifying my issue here! |
I agree with @mojavelinux that we should include a style sheet. with what I saw of the API, it should be possible to modify the header of the pages to add another CSS so we don't still people to add a custom Curiously, I stumbled upon the same problem trying to embbed some converted document in Confluence. My only doubt, is should we create a special CSS or try to create a universal one? |
As I mention in the linked issue, we need some sort of starting point and then maybe additional styles can be added to it for it to fit better in the environment (Confluence, Maven Site, etc). Conceptually, this is actually pretty easy. We're just defining base styles. The tedium is that it needs to be tested a lot to see where style conflicts occur and which elements get missed. It's correct to say that it's an iterative process. |
Any progeess on this issue yet? I too would like to generate docuentation for the site but the way it looks like right now is not so appealing. Thanks |
This looks like it is biting us as well, over at the Apache Log4j 2 project. We might switch back to Markdown unless we can get a fix :-( |
What exactly is the requirement? I admit CSS is in my skill set and that why style site issues have never been fixed. However, if we are talking about tables of some specific element, I can see to get some help from some college to get a decent result. |
The simplest way to put this is that the requirement would be that everything you listed in your response from Aug 17, 2015 (3 1/2 years ago) would work properly. Table borders and grids need to work, source highlighting needs to work. Basically, what we want to accomplish is to move the Log4j site from xdoc/markdown to asciidoc and have the pages look the same. I would expect that when I view something in Intellij that it is going to look very similar when I see it on our web site. |
While it would certainly be nice to add a default stylesheet, I'm not sure why it's our responsibility to provide a stylesheet for your site. As far as I understand, you can provide your own CSS. In which case you have the power to add the styling features you need for your site, whether it be table borders or source highlighting. How exactly does Markdown solve that for you? It doesn't provide a stylesheet by default, so it's completely unrelated to this discussion. We're glad to help, but "we're switching to Markdown" isn't going to motivate us to do that. On the other hand, concrete questions about which styles to apply would. |
That is a fair point. We have a site.css but it contains almost nothing. What you seem to be suggesting is that we abandon the Maven Site Theme and create our own CSS that is compatible with what asciidoctor is generating instead of asciidoctor generating html that is compatible with the theme. |
The body area which Asciidoctor generates is going to use the default HTML that Asciidoctor outputs. This has nothing to do with anything else going on around it (in other words, Asciidoctor is not aware of the context outside of the embedded HTML). If you want to influence this HTML, you could provide a custom converter, which which case you can change every bit of HTML generated. That would be an Asciidoctor extension. |
@abelsromero Is there an example available for using custom Asciidoctor templates in the context of a Maven site? (or is it even possible?) That should help this process move along. |
Should be possible, I'll see to add an integration test with it as soon as possible. |
Awesome! Thanks! |
Just to let know that this is first thing in my queue, but I am trapped on other community things. Worst case, I'll work on it on Saturday afternoon (GMT+1). |
I built an example of how to use a template to correctly show tables in with the the default skin (or no custom skin) and fluido. See here the results Lessons learnt:
Things to fix:
Things to improve:
Based on these points I am inclined to add the templates to the maven-plugin-examples repo as reference trying to keep compatibility with |
It was closed with the release of parser doxia module. See docs for the list of all supported Doxia elements https://docs.asciidoctor.org/maven-tools/latest/site-integration/parser-module-setup-and-configuration/. |
From @sikron on August 13, 2015 17:31
Hi,
i want to use asciidoc for both my maven-site and a generated PDF. I followed both your 'asciidoc-maven-site-example' and 'asciidoctor-pdf-example' with no alterations.
The generated PDF looks really great, but the maven-site does not look like the PDF at all, e.g.
Is this by intention? Can i customize this by myself - preferrable without editing the css, but e.g. by attributes in the pom.xml?
I added pictures for better understanding. this is the poor-looking maven-site:
and this is the great-looking PDF:
Copied from original issue: asciidoctor/asciidoctor-maven-examples#31
The text was updated successfully, but these errors were encountered: