[ 
https://issues.apache.org/jira/browse/SOLR-11584?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hoss Man updated SOLR-11584:
----------------------------
    Attachment: SOLR-11584_customjs.patch

ok -- here's a patch that:

* beefs up the java validator code to check for everything we talked about and 
more (see below)
* tweaks the javascript so that when tab-panes are missing their id or label, 
the javascript draws your attention to it if/when you look at the generated 
pills
** the validator will have already failed, but if you look at the HTML in a 
browser wondering what the deal is the dynamic DOM will draw your attention to 
it with pill text like "BAD TAB-PANE HAS NO ID" or "BAD TAB-PANE HAS NO 
TAB-LABEL"

Here's an example of the types of failures that the validation code complains 
about with the "nocommits" i've sprinkled into 
stream-decorator-reference.adoc...

{noformat}

build-site:
     [java] 
file:/home/hossman/lucene/dev/solr/build/solr-ref-guide/html-site/stream-decorator-reference.html
 contains a 'dynamic-tabs' with 0 'tab-pane' decendents -- must be at least 2
     [java] 
file:/home/hossman/lucene/dev/solr/build/solr-ref-guide/html-site/stream-decorator-reference.html
 contains a 'dynamic-tabs' with content outside of a 'tab-pane': nocommit: a 
'dyna...
     [java] 
file:/home/hossman/lucene/dev/solr/build/solr-ref-guide/html-site/stream-decorator-reference.html
 contains a 'dynamic-tabs' with content outside of a 'tab-pane': nocommit: some 
te...
     [java] 
file:/home/hossman/lucene/dev/solr/build/solr-ref-guide/html-site/stream-decorator-reference.html
 contains a 'tab-pane' that does not have a (unique) '#id'
     [java] 
file:/home/hossman/lucene/dev/solr/build/solr-ref-guide/html-site/stream-decorator-reference.html
 contains 'tab-pane' with 0 'tab-label' decendents -- must be exactly 1
     [java] 
file:/home/hossman/lucene/dev/solr/build/solr-ref-guide/html-site/stream-decorator-reference.html
 contains 'tab-pane#nocommit_id' with 0 'tab-label' decendents -- must be 
exactly 1
     [java] 
file:/home/hossman/lucene/dev/solr/build/solr-ref-guide/html-site/stream-decorator-reference.html
 contains 'tab-pane#nocommit_id' with a 'tab-label' using <em> -- each 
'tab-label' must be <strong> (example: '[.tab-label]*Text*')
     [java] 
file:/home/hossman/lucene/dev/solr/build/solr-ref-guide/html-site/stream-decorator-reference.html
 contains 'tab-pane#nocommit_blank_label' with 0 'tab-label' decendents -- must 
be exactly 1
     [java] 
file:/home/hossman/lucene/dev/solr/build/solr-ref-guide/html-site/stream-decorator-reference.html
 contains 'tab-pane#nocommit_id2' that is not a decendent of a 'dynamic-tabs'
     [java] 
file:/home/hossman/lucene/dev/solr/build/solr-ref-guide/html-site/stream-decorator-reference.html
 contains 'tab-pane#cartesianParams' with 'active' defined -- this must be 
removed
     [java] 
file:/home/hossman/lucene/dev/solr/build/solr-ref-guide/html-site/stream-decorator-reference.html
 contains 'tab-pane#cartesianSyntax' with 0 'tab-label' decendents -- must be 
exactly 1
     [java] 
file:/home/hossman/lucene/dev/solr/build/solr-ref-guide/html-site/stream-decorator-reference.html
 contains 'tab-pane#daemoncommands' with text before the 'tab-label' 
('Commands')
     [java] ID occurs multiple times: nocommit_id
     [java]  ... 
file:/home/hossman/lucene/dev/solr/build/solr-ref-guide/html-site/stream-decorator-reference.html
     [java]  ... 
file:/home/hossman/lucene/dev/solr/build/solr-ref-guide/html-site/stream-decorator-reference.html
     [java] Processed 2048 links (1416 relative) to 2615 anchors in 220 files
     [java] Total of 13 problems found

BUILD FAILED
/home/hossman/lucene/dev/solr/solr-ref-guide/build.xml:263: Java returned: 255
{noformat}

...note in particular the {{contains a 'dynamic-tabs' with content outside of a 
'tab-pane'}} check.  This is a mistake i think cassandra's original patch had 
somewhere in the "daemon" section which i mentioned being confused by before 
(and think i fixed in a way that's sensical?).  I introduced this type of error 
deliberately in the "classify" tabs with a "nocommit" sentence so you can see 
how weird it looks to have content like this as you toggle back and forth 
between the tabs

> Ref Guide: support Bootstrap components like tabs and pills
> -----------------------------------------------------------
>
>                 Key: SOLR-11584
>                 URL: https://issues.apache.org/jira/browse/SOLR-11584
>             Project: Solr
>          Issue Type: Improvement
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: documentation
>            Reporter: Cassandra Targett
>            Assignee: Cassandra Targett
>            Priority: Minor
>             Fix For: 7.2
>
>         Attachments: SOLR-11584.patch, SOLR-11584_customjs.patch, 
> SOLR-11584_customjs.patch, refguide-tabs.png, tabbed_api_output_example.png
>
>
> The theme I initially copied as the basis for the new Ref Guide included a 
> Bootstrap integration, which has the potential to provide us with a number of 
> options, such as organizing some content on a page into tabs (to present the 
> same information in multiple ways - such as Windows vs Unix commands, or 
> hand-editing schema.xml/managed-schema vs Schema API examples). 
> However, the way AsciiDoctor content is inserted into a Jekyll template made 
> it difficult to know how to use some of Bootstrap's features. Particularly 
> since we have to make sure whatever we put into the content comes out right 
> in the PDF.
> I had a bit of a breakthrough on this, and feel confident we can make 
> straightforward instructions for anyone who might want to add this feature to 
> their content. A patch will follow shortly with more details but the summary 
> is:
> * Add an AsciiDoctor passthrough block that includes the Bootstrap HTML code 
> to create the tabs.
> ** This has an {{ifdef::backend-html5[]}} rule on it, so it will only be used 
> if the output format is HTML. The PDF will ignore this section entirely.
> * Use AsciiDoctor's "role" support to name the proper class names, which 
> AsciiDoctor will convert into the right {{<div>}} elements in the HTML.
> ** These will take multiple class names and a section ID, which is perfect 
> for our needs.
> ** One caveat is the divs need to be properly nested, and must be defined on 
> blocks so all the content is inserted into the tab boxes appropriately. This 
> gets a little complicated because you can't nest blocks of the same type 
> (yet), but I found two block types we aren't using otherwise.
> ** The PDF similarly ignores these classes and IDs because it doesn't know 
> what to do with custom classes (but in the future these may be supported and 
> we could define these in a special way if we want).
> * Modify some of the CSS to display the way we want since AsciiDoctor inserts 
> some of its own classes between the defined classes and the inheritance needs 
> to be set up right. Also the default styling for the blocks needs to be 
> changed so it doesn't look strange.
> I'll include a patch with a sample file that has this working, plus detailed 
> instructions in the metadocs. In the meantime, I've attached a screenshot 
> that shows a small snippet from my testing. 
> While the focus here is using tabs & pills, we will be able to use the same 
> principles to support collapsing sections if that's preferred for 
> presentation.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to