Bug 1088051 - [RFE] Ability to provide a snippet of code, with user option to click and expand to see all of it
Summary: [RFE] Ability to provide a snippet of code, with user option to click and exp...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Publican
Classification: Community
Component: publican
Version: future
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: 4.2
Assignee: Jeff Fearn 🐞
QA Contact: Bruce Reeler
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-04-15 23:35 UTC by Bilhar
Modified: 2016-08-16 01:56 UTC (History)
4 users (show)

Fixed In Version: 4.2.0
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-09-01 03:40:24 UTC


Attachments (Terms of Use)

Description Bilhar 2014-04-15 23:35:23 UTC
Currently, if want to show a large chunk of code, there are two options: show all of it in the <screen> or <programlisting> output, or have an appendix at the end of the book. Neither one of these is great from the user perspective.

It would be good to have the ability to provide a snippet of code, for example 5-10 lines, and then have a link that allows the user to click on it to see all of the code. For example:

<programlisting>
line 1
line 2
line 3
........
</programlisting> Click here to see all the code

This keeps the book clean with no long pieces of code, but provides the user an option to see all of the code. Preferably, when the user clicks to see all of the code, it opens a new tab in their browser.

Comment 1 Jeff Fearn 🐞 2014-05-21 05:05:50 UTC
If you set role="popper" on a program listing, screen, or synposis, it will:

1: add a 'Show All' link to the top
2: show the first 4.5 lines of code
3: add a dashed border to the bottom

Clicking "Show All" will reveal the rest of teh content and change the link to "Hide".

Demo is two list items above http://fedorapeople.org/~jfearn/HTML5_Test/html/chap-Publican-Users_Guide-Installing_Publican.html#sect-Users_Guide-Linux_operating_systems-OpenSuse_12

To ssh://git.fedorahosted.org/git/publican.git
   725d2e6..ae38cf1  devel -> devel

Comment 2 Bruce Reeler 2014-08-26 01:26:58 UTC
(In reply to Jeff Fearn from comment #1)
> If you set role="popper" on a program listing, screen, or synposis, it will:
> 
> 1: add a 'Show All' link to the top
> 2: show the first 4.5 lines of code
> 3: add a dashed border to the bottom
> 
> Clicking "Show All" will reveal the rest of the content and change the link
> to "Hide".
> 

Reviewed.

1) This does not work in docbook 4.5, only in docbook 5. Is this expected?

2) I created a docbook 5 book and tested using "role=popper" inside a <screen> tag. It works, except:
 - there is no 'Show all' link

It does however show 4 lines of text with a dotted line below, and when one hovers the mouse pointer over the screen text, it gets a colored background, and clicking displays the whole screenful of text, as it should.

So setting this bug back to assigned for the lack of "show all" link in para 2) and just to confirm 4.5 vs. 5 in 1).

Comment 3 Jeff Fearn 🐞 2014-08-26 03:18:32 UTC
(In reply to Bruce Reeler from comment #2)
> (In reply to Jeff Fearn from comment #1)
> > If you set role="popper" on a program listing, screen, or synposis, it will:
> > 
> > 1: add a 'Show All' link to the top
> > 2: show the first 4.5 lines of code
> > 3: add a dashed border to the bottom
> > 
> > Clicking "Show All" will reveal the rest of the content and change the link
> > to "Hide".
> > 
> 
> Reviewed.
> 
> 1) This does not work in docbook 4.5, only in docbook 5. Is this expected?

Yes, we are not adding new features to docbook 4.

> 2) I created a docbook 5 book and tested using "role=popper" inside a
> <screen> tag. It works, except:
>  - there is no 'Show all' link
> 
> It does however show 4 lines of text with a dotted line below, and when one
> hovers the mouse pointer over the screen text, it gets a colored background,
> and clicking displays the whole screenful of text, as it should.
> 
> So setting this bug back to assigned for the lack of "show all" link in para
> 2) and just to confirm 4.5 vs. 5 in 1).

Did you test using the common-db5 brand? It might be other brands need updating.

Comment 4 Bruce Reeler 2014-08-26 03:52:41 UTC
Yes, publican.cfg has:
xml_lang: "en-US"
dtdver: "5.0"
brand: "common-db5"
type: Book

Comment 5 Jeff Fearn 🐞 2014-08-26 06:04:24 UTC
Hi, the show/hide tags where removed by the designer for UX reasons.

Comment 6 Bruce Reeler 2014-08-26 06:09:13 UTC
Ah, OK, thanks.
Setting to Verified then.

Comment 7 Jeff Fearn 🐞 2014-09-01 03:40:24 UTC
A fix for this shipped in Publican 4.2.0.


Note You need to log in before you can comment on or make changes to this bug.