How to use multi specifiers to format column in asciidoc - asciidoc

In AsciiDoc manual 23.2. Column Formatting, it says:
To apply a specifier to a column, you must set the cols attribute and assign it a value. A column specifier can contain any of the following components:
multiplier
align
width
style
Each component is optional.
But I didn't find an example that uses multi specifiers.
For example, I want to use both width and style specifiers in the below table.
[cols="h,a,a",options="header"]
|===
| | compare times | move times
| 1 | n-1 | 2n-2
| 2 | (n-1)(n+4)/4 | (n-1)(n+8)/4
| 3 | (n-1)(n+2)/2 | (n-1)(n+4)/2
|===
Since the first column contains few text, so I want to add the attribute [cols="1,4,4"] to it.
I don't know how to implement that, could somebody help me?

The section of the Asciidoctor documentation that you linked to does include multiple examples of composite column formatting specifiers, including relative widths, centering, left/right alignment, vertical alignment, and styles.
For your table, your cols specification should be:
[cols="1h,4a,4a", options="header"]

Related

Unordered list in a table cell with Asciidoc

I am trying to have a (simple) unordered list in a table cell in an Asciidoc document. I use asciidoctor.
I tried the following:
|===
| One | Two
| Foo
|
- Bar
- Baz
|===
But this results in the last cell having simply the text - Bar - Baz as a simple string, no list formatting. I would like it to be formatted as a list, on two lines, with a bullet on each line. Any idea?
The default style of a table cell accepts only inline markup. To insert block elements you could change the cell style to "AsciiDoc". See this document for details.
For example:
|===
| One | Two
| Foo
a|
- Bar
- Baz
|===
Word of caution: The contents of the cell is treated as a separate AsciiDoc document, so certain markup (such as footnotes) behave badly as they no longer belong to the main document.

Change text size of table in Asciidoc

How to change the font size of a specific table in Asciidoc (PDF)?
I already tried a custom role:
role:
small:
font-size: 10
Table:
[.small]
[options="header"]
|===
|Vielfachheit |Feldname |Beschreibung |XML-Tag
|1 |Einzelsicht | |view (Tag)
|===
But it didn't change anything.
EDIT:
Looks like this isn't possible according to a similar question: Is there any way to change the text size (font size) of specific blocks when you using asciidoc?
Your solution does work when converting to html but not when converting to pdf. It is currently not possible to set a custom roles to a table with with PDF styling, see https://docs.asciidoctor.org/pdf-converter/latest/theme/custom-role/
Custom roles only apply to paragraphs and inline phrases.
The solution you have is to set the role directly to the text:
[options="header"]
|===
|[.small]#Vielfachheit# |Feldname |Beschreibung |XML-Tag
|1 |[.small]#Einzelsicht# | |view (Tag)
|===
Obvisouly the readability is not good but it does work and you do that for only a few cells this might be ok.
Note: I do not know why you want to change the font size for one single table but if you want to highlight it differently than the rest you could also put it inside an example block or a sidebar

creating donuts chart in oracle OBIEE

hello all
I'm trying to create a donut chart in OBIEE from oracle , the version I'm using is : 12.2.1.4.0 .
please note that our OBIEE is located on our organization network and there is no internet access.
so i can't use any solutions that need internet like Google API.
donuts chart sample:
only pie chart is available:
Many thanks all ..
Data Visualization has the donut chart type out of the box. It's available in 12.2.1.4.
You can use D3 to and create this via a narrative but you will need to code it yourself.
To do this you need to
Make d3 available on your BI server (I can't remember whether d3.js is already there in 12.2.1.4 or not)
Create analysis you want to chart
Take code from https://www.d3-graph-gallery.com/graph/donut_basic.html and put into narative (remembering to tick the contains HTML check box)
Assuming you have a table that looks something like
| Name | Value |
| ---- | ---- |
| a | 9 |
| b | 20 |
| c | 30 |
| d | 8 |
| e | 12 |
Prefix
<!-- Load D3 library, need to change URL acccordingly -->
<script src="/analytics/res/[release string]/d3.js" />
<!-- Create div to hold your chart -->
<div id="my_dataviz"></div>
<!-- Start my donut chart script -->
<Script>
var data = {
Narrative
#1: #2
Row Separator
,
Postfix
}
// the d3 script references above minus the starting <script> tag and the section which sets data
</script>
How Does It Work
The key is the narrative bit. #1 references the first column, #2 the second and so on.
This just builds up the script dynamically so the output would end up looking like
var data = {a: 9, b: 20, c:30, d:8, e:12}
You can change this as necessary, add tooltips to display values when you hover over, display a total in the middle etc.
If D3 is not already there (and it is a bit of a faff to find but go to domain home and find . -name "d3*js" and see what pops up) then you will need somewhere to make the d3 library available (easy if you have OHS in front of BI) have a look at https://gianniceresa.com/2016/12/deploy-custom-folder-obiee-12c-analyticsres/ to create somewhere to access script locally
Cons
This approach isn't without cons. The first one is that you need to code this up in javascript. It isn't too difficult and there are plenty of examples on the internet but it is obviously more difficult than just creating a normal chart.
Another one is exporting. As these charts are rendered in the browser and BI just thinks they are html they will not export properly (you will see the raw HTML / javascript)

Can I change the styling of the code box in a markdown file with scss?

I am trying to find out if I can effect the code box inside of a mark down document with scss?
I am working on a jekyll project and I am using markdown for my posts. Id like to edit the styling of the code box inside of the .md but cant seem to figure it out.
Is this possible?
Found the answer Here
Kramdown treats each new line as a row and doesn't render Markdown bullet lists inside table cells, and instead of rendering HTML, it is escaped and outputted as a single line of text.
You can tell Kramdown to leave the HTML alone and output as is, with the nomarkdown extension. Just wrap the HTML code with {::nomarkdown} ... {:/}
| Name | Value |
|------|-----------------------------------------|
| one | {::nomarkdown}<i>foo</i>{:/} |
| two | {::nomarkdown}<ul><li>bar</li></ul>{:/} |

MarionetteJS - Multiple nested side by side views

I am looking at the example here http://davidsulc.github.io/backbone.marionette-nested-views/ it shows how you can create a list a superheroes and for each hero have an inner list of villains.
How would one extend this to not only list villains for each hero, but also their top three favorite colors? for example.
So I could have something like
Batman
-----------------------------------
Bane | Black
Ra's Al Ghul | Blue
The Joker | Orange
The Riddler |
===================================
Spiderman
-----------------------------------
Green Goblin | Red
Venom | Green
| Violet
===================================
Wonder Woman
-----------------------------------
Ares | Silver
Doctor Psycho | Purple
Silver Swan | White
===================================
In the composite view it is as if I need two sets of itemviews and itemcomtainers, something like
HeroView = Backbone.Marionette.CompositeView.extend({
template: "#accordion-group-template",
className: "accordion-group",
itemView: VillainView,
itemViewContainer: "#villainUL",
itemView2: FavoriteColorView,
itemViewContainer2: "#colorUL",
...
But of course such a thing doesn't exist.
Edit: this http://jsfiddle.net/derickbailey/AdWjU/ will probably serve as a solution, but I will have to wait until the morning to adapt it.
First of all, hopefully you're aware of the blog post I wrote to go with the code: http://davidsulc.com/blog/2013/02/03/tutorial-nested-views-using-backbone-marionettes-compositeview/
Bad news: I think you'll actually need more work to achieve what you want...
The jsFiddle you linked (http://jsfiddle.net/derickbailey/AdWjU/) displays a list of element that are sub-elements. What you want to do is display two separate lists!
Here's what I'd try: you need to replace the VillainView (which is an ItemView) with a layout which we'll call HeroInfo, in this layout you need to declare 2 regions (one for the villain list, the other for the colors). This new layout also won't be rendered within a ul so you can remove the itemViewContainer from the view definition and the template.
Note you might not be able to specify the layout regions as an object (you can't use ids in the template since they'll be repeated, and you might not yet have access to this.$el). If that's the case, you need to initialize them with something like this:
initialize: function(){
// assuming you have an element with class "js-villain-region" in your layout template
this.addRegion("villainRegion", this.$el.find(".js-villain-region").first());
}
Next, you need to define a VillainView and a ColorView (both are collection views) to be displayed in the layout's regions on the "show" event (see example code using a layout here: https://github.com/davidsulc/marionette-gentle-introduction/blob/master/assets/js/apps/contacts/list/list_controller.js#L43
I hope this helps to set you on the right path!
Also, as a side note: this seems to be more challenging than it looks at first glance. If you're doing this as a learning experience, don't get discouraged: you're attempting a challenging, complex view implementation, which will be tricky when first getting into Marionette.

Resources